From 5823afc426efb6bed60c94eb7871447d27dc5489 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:10:06 +0000 Subject: [PATCH 1/7] Bump Submodule/github/rest-api-description from `23ea15f` to `dee4dc2` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `23ea15f` to `dee4dc2`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/23ea15fe816288eb00bb9c764c5c137fd16f4115...dee4dc2b1ab40c75c2ae562e4300503b632f4424) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description dependency-version: dee4dc2b1ab40c75c2ae562e4300503b632f4424 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Submodule/github/rest-api-description | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 23ea15fe81..dee4dc2b1a 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 23ea15fe816288eb00bb9c764c5c137fd16f4115 +Subproject commit dee4dc2b1ab40c75c2ae562e4300503b632f4424 From e6e9cd7f1f72f60fbe568e55797b43f7ea1b56e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 6 Oct 2025 21:37:33 +0000 Subject: [PATCH 2/7] Commit via running: make Sources/apps --- Sources/apps/Types.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/apps/Types.swift b/Sources/apps/Types.swift index 5e4e6f9ef6..63955dd256 100644 --- a/Sources/apps/Types.swift +++ b/Sources/apps/Types.swift @@ -2531,7 +2531,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_org_roles`. public var organizationCustomOrgRoles: Components.Schemas.AppPermissions.OrganizationCustomOrgRolesPayload? - /// The level of permission to grant the access token for custom property management. + /// The level of permission to grant the access token for repository custom properties management at the organization level. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_properties`. @frozen public enum OrganizationCustomPropertiesPayload: String, Codable, Hashable, Sendable, CaseIterable { @@ -2539,7 +2539,7 @@ public enum Components { case write = "write" case admin = "admin" } - /// The level of permission to grant the access token for custom property management. + /// The level of permission to grant the access token for repository custom properties management at the organization level. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_properties`. public var organizationCustomProperties: Components.Schemas.AppPermissions.OrganizationCustomPropertiesPayload? @@ -2790,7 +2790,7 @@ public enum Components { /// - organizationAdministration: The level of permission to grant the access token to manage access to an organization. /// - organizationCustomRoles: The level of permission to grant the access token for custom repository roles management. /// - organizationCustomOrgRoles: The level of permission to grant the access token for custom organization roles management. - /// - organizationCustomProperties: The level of permission to grant the access token for custom property management. + /// - organizationCustomProperties: The level of permission to grant the access token for repository custom properties management at the organization level. /// - organizationCopilotSeatManagement: The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change. /// - organizationAnnouncementBanners: The level of permission to grant the access token to view and manage announcement banners for an organization. /// - organizationEvents: The level of permission to grant the access token to view events triggered by an activity in an organization. From 6c5308e1fb9138ed40834d42aaa019cd9a040955 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 6 Oct 2025 21:39:50 +0000 Subject: [PATCH 3/7] Commit via running: make Sources/dependabot --- Sources/dependabot/Client.swift | 7 ++ Sources/dependabot/Types.swift | 142 ++++++++++++++++++++++++++++---- 2 files changed, 134 insertions(+), 15 deletions(-) diff --git a/Sources/dependabot/Client.swift b/Sources/dependabot/Client.swift index b3b2760c11..1559c1fdb6 100644 --- a/Sources/dependabot/Client.swift +++ b/Sources/dependabot/Client.swift @@ -693,6 +693,13 @@ public struct Client: APIProtocol { name: "has", value: input.query.has ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "runtime_risk", + value: input.query.runtimeRisk + ) try converter.setQueryItemAsURI( in: &request, style: .form, diff --git a/Sources/dependabot/Types.swift b/Sources/dependabot/Types.swift index 0daf06d913..1cd6495e12 100644 --- a/Sources/dependabot/Types.swift +++ b/Sources/dependabot/Types.swift @@ -4322,6 +4322,57 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-artifact-registry`. public typealias DependabotAlertCommaSeparatedArtifactRegistry = Swift.String + /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. + /// Multiple `has` filters can be passed to filter for alerts that have all of the values. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has`. + @frozen public enum DependabotAlertOrgScopeCommaSeparatedHas: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/Case2Payload`. + @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case patch = "patch" + case deployment = "deployment" + } + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`. + public typealias Case2Payload = [Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2PayloadPayload] + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`. + case case2(Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// A comma-separated list of runtime risk strings. If specified, only alerts for repositories with deployment records matching these risks will be returned. + /// + /// Can be: `critical-resource`, `internet-exposed`, `sensitive-data`, `lateral-movement` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-runtime-risk`. + public typealias DependabotAlertCommaSeparatedRuntimeRisk = Swift.String /// A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned. /// /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-manifests`. @@ -5631,18 +5682,19 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/artifact_registry`. public var artifactRegistry: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistry? - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. - @frozen public enum DependabotAlertCommaSeparatedHas: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has`. + @frozen public enum DependabotAlertOrgScopeCommaSeparatedHas: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case1`. case case1(Swift.String) - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/Case2Payload`. @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { case patch = "patch" + case deployment = "deployment" } - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. - public typealias Case2Payload = [Components.Parameters.DependabotAlertCommaSeparatedHas.Case2PayloadPayload] - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. - case case2(Components.Parameters.DependabotAlertCommaSeparatedHas.Case2Payload) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`. + public typealias Case2Payload = [Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2PayloadPayload] + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`. + case case2(Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2Payload) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] do { @@ -5673,10 +5725,16 @@ public enum Operations { } } /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. - /// Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported. + /// Multiple `has` filters can be passed to filter for alerts that have all of the values. /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/has`. - public var has: Components.Parameters.DependabotAlertCommaSeparatedHas? + public var has: Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas? + /// A comma-separated list of runtime risk strings. If specified, only alerts for repositories with deployment records matching these risks will be returned. + /// + /// Can be: `critical-resource`, `internet-exposed`, `sensitive-data`, `lateral-movement` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/runtime_risk`. + public var runtimeRisk: Components.Parameters.DependabotAlertCommaSeparatedRuntimeRisk? /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @frozen public enum DependabotAlertScope: String, Codable, Hashable, Sendable, CaseIterable { case development = "development" @@ -5743,6 +5801,7 @@ public enum Operations { /// - artifactRegistryUrl: A comma-separated list of artifact registry URLs. If specified, only alerts for repositories with storage records matching these URLs will be returned. /// - artifactRegistry: A comma-separated list of Artifact Registry name strings. If specified, only alerts for repositories with storage records matching these registries will be returned. /// - has: Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. + /// - runtimeRisk: A comma-separated list of runtime risk strings. If specified, only alerts for repositories with deployment records matching these risks will be returned. /// - scope: The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. /// - sort: The property by which to sort the results. /// - direction: The direction to sort the results by. @@ -5759,7 +5818,8 @@ public enum Operations { epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? = nil, artifactRegistryUrl: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistryUrls? = nil, artifactRegistry: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistry? = nil, - has: Components.Parameters.DependabotAlertCommaSeparatedHas? = nil, + has: Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas? = nil, + runtimeRisk: Components.Parameters.DependabotAlertCommaSeparatedRuntimeRisk? = nil, scope: Components.Parameters.DependabotAlertScope? = nil, sort: Components.Parameters.DependabotAlertSort? = nil, direction: Components.Parameters.Direction? = nil, @@ -5777,6 +5837,7 @@ public enum Operations { self.artifactRegistryUrl = artifactRegistryUrl self.artifactRegistry = artifactRegistry self.has = has + self.runtimeRisk = runtimeRisk self.scope = scope self.sort = sort self.direction = direction @@ -6582,22 +6643,73 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/visibility`. public var visibility: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload - /// An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/SelectedRepositoryIdsPayload`. + public struct SelectedRepositoryIdsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/SelectedRepositoryIdsPayload/value1`. + public var value1: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/SelectedRepositoryIdsPayload/value2`. + public var value2: Swift.String? + /// Creates a new `SelectedRepositoryIdsPayloadPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Swift.Int? = nil, + value2: Swift.String? = nil + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self.value1 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value2 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeFirstNonNilValueToSingleValueContainer([ + self.value1, + self.value2 + ]) + } + } + /// An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. Use integers when possible, as strings are supported only to maintain backwards compatibility and may be removed in the future. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/selected_repository_ids`. + public typealias SelectedRepositoryIdsPayload = [Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.SelectedRepositoryIdsPayloadPayload] + /// An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. Use integers when possible, as strings are supported only to maintain backwards compatibility and may be removed in the future. /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.String]? + public var selectedRepositoryIds: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.SelectedRepositoryIdsPayload? /// Creates a new `JsonPayload`. /// /// - Parameters: /// - encryptedValue: Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key) endpoint. /// - keyId: ID of the key you used to encrypt the secret. /// - visibility: Which type of organization repositories have access to the organization secret. `selected` means only the repositories specified by `selected_repository_ids` can access the secret. - /// - selectedRepositoryIds: An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + /// - selectedRepositoryIds: An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. Use integers when possible, as strings are supported only to maintain backwards compatibility and may be removed in the future. public init( encryptedValue: Swift.String? = nil, keyId: Swift.String? = nil, visibility: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload, - selectedRepositoryIds: [Swift.String]? = nil + selectedRepositoryIds: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.SelectedRepositoryIdsPayload? = nil ) { self.encryptedValue = encryptedValue self.keyId = keyId From 567ec0ca630321e5bcedf712a4558eb81e731b63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 6 Oct 2025 21:44:23 +0000 Subject: [PATCH 4/7] Commit via running: make Sources/orgs --- Sources/orgs/Client.swift | 334 ++++++++++++++ Sources/orgs/Types.swift | 907 +++++++++++++++++++++++++++++++++++++- 2 files changed, 1238 insertions(+), 3 deletions(-) diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index 21cc862d1b..a956b70644 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -8718,6 +8718,340 @@ public struct Client: APIProtocol { } ) } + /// Get immutable releases settings for an organization + /// + /// Gets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/get(orgs/get-immutable-releases-settings)`. + public func orgsGetImmutableReleasesSettings(_ input: Operations.OrgsGetImmutableReleasesSettings.Input) async throws -> Operations.OrgsGetImmutableReleasesSettings.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsGetImmutableReleasesSettings.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/immutable-releases", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsGetImmutableReleasesSettings.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ImmutableReleasesOrganizationSettings.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set immutable releases settings for an organization + /// + /// Sets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)`. + public func orgsSetImmutableReleasesSettings(_ input: Operations.OrgsSetImmutableReleasesSettings.Input) async throws -> Operations.OrgsSetImmutableReleasesSettings.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsSetImmutableReleasesSettings.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/immutable-releases", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List selected repositories for immutable releases enforcement + /// + /// List all of the repositories that have been selected for immutable releases enforcement in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/get(orgs/get-immutable-releases-settings-repositories)`. + public func orgsGetImmutableReleasesSettingsRepositories(_ input: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input) async throws -> Operations.OrgsGetImmutableReleasesSettingsRepositories.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsGetImmutableReleasesSettingsRepositories.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/immutable-releases/repositories", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set selected repositories for immutable releases enforcement + /// + /// 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`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)`. + public func orgsSetImmutableReleasesSettingsRepositories(_ input: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input) async throws -> Operations.OrgsSetImmutableReleasesSettingsRepositories.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsSetImmutableReleasesSettingsRepositories.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/immutable-releases/repositories", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Enable a selected repository for immutable releases in an organization + /// + /// 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`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)`. + public func orgsEnableSelectedRepositoryImmutableReleasesOrganization(_ input: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Input) async throws -> Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/immutable-releases/repositories/{}", + parameters: [ + input.path.org, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Disable a selected repository for immutable releases in an organization + /// + /// 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`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)`. + public func orgsDisableSelectedRepositoryImmutableReleasesOrganization(_ input: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Input) async throws -> Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/immutable-releases/repositories/{}", + parameters: [ + input.path.org, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Enable or disable a security feature for an organization /// /// > [!WARNING] diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 48433def71..7d42a70307 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -869,6 +869,60 @@ public protocol APIProtocol: Sendable { /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)`. @available(*, deprecated) func orgsRemoveSecurityManagerTeam(_ input: Operations.OrgsRemoveSecurityManagerTeam.Input) async throws -> Operations.OrgsRemoveSecurityManagerTeam.Output + /// Get immutable releases settings for an organization + /// + /// Gets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/get(orgs/get-immutable-releases-settings)`. + func orgsGetImmutableReleasesSettings(_ input: Operations.OrgsGetImmutableReleasesSettings.Input) async throws -> Operations.OrgsGetImmutableReleasesSettings.Output + /// Set immutable releases settings for an organization + /// + /// Sets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)`. + func orgsSetImmutableReleasesSettings(_ input: Operations.OrgsSetImmutableReleasesSettings.Input) async throws -> Operations.OrgsSetImmutableReleasesSettings.Output + /// List selected repositories for immutable releases enforcement + /// + /// List all of the repositories that have been selected for immutable releases enforcement in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/get(orgs/get-immutable-releases-settings-repositories)`. + func orgsGetImmutableReleasesSettingsRepositories(_ input: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input) async throws -> Operations.OrgsGetImmutableReleasesSettingsRepositories.Output + /// Set selected repositories for immutable releases enforcement + /// + /// 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`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)`. + func orgsSetImmutableReleasesSettingsRepositories(_ input: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input) async throws -> Operations.OrgsSetImmutableReleasesSettingsRepositories.Output + /// Enable a selected repository for immutable releases in an organization + /// + /// 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`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)`. + func orgsEnableSelectedRepositoryImmutableReleasesOrganization(_ input: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Input) async throws -> Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Output + /// Disable a selected repository for immutable releases in an organization + /// + /// 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`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)`. + func orgsDisableSelectedRepositoryImmutableReleasesOrganization(_ input: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Input) async throws -> Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Output /// Enable or disable a security feature for an organization /// /// > [!WARNING] @@ -2516,6 +2570,98 @@ extension APIProtocol { public func orgsRemoveSecurityManagerTeam(path: Operations.OrgsRemoveSecurityManagerTeam.Input.Path) async throws -> Operations.OrgsRemoveSecurityManagerTeam.Output { try await orgsRemoveSecurityManagerTeam(Operations.OrgsRemoveSecurityManagerTeam.Input(path: path)) } + /// Get immutable releases settings for an organization + /// + /// Gets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/get(orgs/get-immutable-releases-settings)`. + public func orgsGetImmutableReleasesSettings( + path: Operations.OrgsGetImmutableReleasesSettings.Input.Path, + headers: Operations.OrgsGetImmutableReleasesSettings.Input.Headers = .init() + ) async throws -> Operations.OrgsGetImmutableReleasesSettings.Output { + try await orgsGetImmutableReleasesSettings(Operations.OrgsGetImmutableReleasesSettings.Input( + path: path, + headers: headers + )) + } + /// Set immutable releases settings for an organization + /// + /// Sets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)`. + public func orgsSetImmutableReleasesSettings( + path: Operations.OrgsSetImmutableReleasesSettings.Input.Path, + body: Operations.OrgsSetImmutableReleasesSettings.Input.Body + ) async throws -> Operations.OrgsSetImmutableReleasesSettings.Output { + try await orgsSetImmutableReleasesSettings(Operations.OrgsSetImmutableReleasesSettings.Input( + path: path, + body: body + )) + } + /// List selected repositories for immutable releases enforcement + /// + /// List all of the repositories that have been selected for immutable releases enforcement in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/get(orgs/get-immutable-releases-settings-repositories)`. + public func orgsGetImmutableReleasesSettingsRepositories( + path: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Path, + query: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Query = .init(), + headers: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Headers = .init() + ) async throws -> Operations.OrgsGetImmutableReleasesSettingsRepositories.Output { + try await orgsGetImmutableReleasesSettingsRepositories(Operations.OrgsGetImmutableReleasesSettingsRepositories.Input( + path: path, + query: query, + headers: headers + )) + } + /// Set selected repositories for immutable releases enforcement + /// + /// 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`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)`. + public func orgsSetImmutableReleasesSettingsRepositories( + path: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Path, + body: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Body + ) async throws -> Operations.OrgsSetImmutableReleasesSettingsRepositories.Output { + try await orgsSetImmutableReleasesSettingsRepositories(Operations.OrgsSetImmutableReleasesSettingsRepositories.Input( + path: path, + body: body + )) + } + /// Enable a selected repository for immutable releases in an organization + /// + /// 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`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)`. + public func orgsEnableSelectedRepositoryImmutableReleasesOrganization(path: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Input.Path) async throws -> Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Output { + try await orgsEnableSelectedRepositoryImmutableReleasesOrganization(Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Input(path: path)) + } + /// Disable a selected repository for immutable releases in an organization + /// + /// 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`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)`. + public func orgsDisableSelectedRepositoryImmutableReleasesOrganization(path: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Input.Path) async throws -> Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Output { + try await orgsDisableSelectedRepositoryImmutableReleasesOrganization(Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Input(path: path)) + } /// Enable or disable a security feature for an organization /// /// > [!WARNING] @@ -3859,7 +4005,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_org_roles`. public var organizationCustomOrgRoles: Components.Schemas.AppPermissions.OrganizationCustomOrgRolesPayload? - /// The level of permission to grant the access token for custom property management. + /// The level of permission to grant the access token for repository custom properties management at the organization level. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_properties`. @frozen public enum OrganizationCustomPropertiesPayload: String, Codable, Hashable, Sendable, CaseIterable { @@ -3867,7 +4013,7 @@ public enum Components { case write = "write" case admin = "admin" } - /// The level of permission to grant the access token for custom property management. + /// The level of permission to grant the access token for repository custom properties management at the organization level. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_properties`. public var organizationCustomProperties: Components.Schemas.AppPermissions.OrganizationCustomPropertiesPayload? @@ -4118,7 +4264,7 @@ public enum Components { /// - organizationAdministration: The level of permission to grant the access token to manage access to an organization. /// - organizationCustomRoles: The level of permission to grant the access token for custom repository roles management. /// - organizationCustomOrgRoles: The level of permission to grant the access token for custom organization roles management. - /// - organizationCustomProperties: The level of permission to grant the access token for custom property management. + /// - organizationCustomProperties: The level of permission to grant the access token for repository custom properties management at the organization level. /// - organizationCopilotSeatManagement: The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change. /// - organizationAnnouncementBanners: The level of permission to grant the access token to view and manage announcement banners for an organization. /// - organizationEvents: The level of permission to grant the access token to view events triggered by an activity in an organization. @@ -8643,6 +8789,43 @@ public enum Components { try self.value2.encode(to: encoder) } } + /// Check immutable releases settings for an organization. + /// + /// - Remark: Generated from `#/components/schemas/immutable-releases-organization-settings`. + public struct ImmutableReleasesOrganizationSettings: Codable, Hashable, Sendable { + /// The policy that controls how immutable releases are enforced in the organization. + /// + /// - Remark: Generated from `#/components/schemas/immutable-releases-organization-settings/enforced_repositories`. + @frozen public enum EnforcedRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case none = "none" + case selected = "selected" + } + /// The policy that controls how immutable releases are enforced in the organization. + /// + /// - Remark: Generated from `#/components/schemas/immutable-releases-organization-settings/enforced_repositories`. + public var enforcedRepositories: Components.Schemas.ImmutableReleasesOrganizationSettings.EnforcedRepositoriesPayload + /// The API URL to use to get or set the selected repositories for immutable releases enforcement, when `enforced_repositories` is set to `selected`. + /// + /// - Remark: Generated from `#/components/schemas/immutable-releases-organization-settings/selected_repositories_url`. + public var selectedRepositoriesUrl: Swift.String? + /// Creates a new `ImmutableReleasesOrganizationSettings`. + /// + /// - Parameters: + /// - enforcedRepositories: The policy that controls how immutable releases are enforced in the organization. + /// - selectedRepositoriesUrl: The API URL to use to get or set the selected repositories for immutable releases enforcement, when `enforced_repositories` is set to `selected`. + public init( + enforcedRepositories: Components.Schemas.ImmutableReleasesOrganizationSettings.EnforcedRepositoriesPayload, + selectedRepositoriesUrl: Swift.String? = nil + ) { + self.enforcedRepositories = enforcedRepositories + self.selectedRepositoriesUrl = selectedRepositoriesUrl + } + public enum CodingKeys: String, CodingKey { + case enforcedRepositories = "enforced_repositories" + case selectedRepositoriesUrl = "selected_repositories_url" + } + } } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { @@ -8691,6 +8874,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/org`. public typealias Org = Swift.String + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/components/parameters/repository-id`. + public typealias RepositoryId = Swift.Int /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// /// - Remark: Generated from `#/components/parameters/hook-id`. @@ -26795,6 +26982,720 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } + /// Get immutable releases settings for an organization + /// + /// Gets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/get(orgs/get-immutable-releases-settings)`. + public enum OrgsGetImmutableReleasesSettings { + public static let id: Swift.String = "orgs/get-immutable-releases-settings" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsGetImmutableReleasesSettings.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsGetImmutableReleasesSettings.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsGetImmutableReleasesSettings.Input.Path, + headers: Operations.OrgsGetImmutableReleasesSettings.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ImmutableReleasesOrganizationSettings) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ImmutableReleasesOrganizationSettings { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsGetImmutableReleasesSettings.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsGetImmutableReleasesSettings.Output.Ok.Body) { + self.body = body + } + } + /// Immutable releases settings response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/get(orgs/get-immutable-releases-settings)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsGetImmutableReleasesSettings.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsGetImmutableReleasesSettings.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set immutable releases settings for an organization + /// + /// Sets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)`. + public enum OrgsSetImmutableReleasesSettings { + public static let id: Swift.String = "orgs/set-immutable-releases-settings" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsSetImmutableReleasesSettings.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The policy that controls how immutable releases are enforced in the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/requestBody/json/enforced_repositories`. + @frozen public enum EnforcedRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case none = "none" + case selected = "selected" + } + /// The policy that controls how immutable releases are enforced in the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/requestBody/json/enforced_repositories`. + public var enforcedRepositories: Operations.OrgsSetImmutableReleasesSettings.Input.Body.JsonPayload.EnforcedRepositoriesPayload + /// An array of repository ids for which immutable releases enforcement should be applied. You can only provide a list of repository ids when the `enforced_repositories` is set to `selected`. You can add and remove individual repositories using the [Enable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization) and [Disable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization) endpoints. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enforcedRepositories: The policy that controls how immutable releases are enforced in the organization. + /// - selectedRepositoryIds: An array of repository ids for which immutable releases enforcement should be applied. You can only provide a list of repository ids when the `enforced_repositories` is set to `selected`. You can add and remove individual repositories using the [Enable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization) and [Disable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization) endpoints. + public init( + enforcedRepositories: Operations.OrgsSetImmutableReleasesSettings.Input.Body.JsonPayload.EnforcedRepositoriesPayload, + selectedRepositoryIds: [Swift.Int]? = nil + ) { + self.enforcedRepositories = enforcedRepositories + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case enforcedRepositories = "enforced_repositories" + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/requestBody/content/application\/json`. + case json(Operations.OrgsSetImmutableReleasesSettings.Input.Body.JsonPayload) + } + public var body: Operations.OrgsSetImmutableReleasesSettings.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.OrgsSetImmutableReleasesSettings.Input.Path, + body: Operations.OrgsSetImmutableReleasesSettings.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsSetImmutableReleasesSettings.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsSetImmutableReleasesSettings.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List selected repositories for immutable releases enforcement + /// + /// List all of the repositories that have been selected for immutable releases enforcement in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/get(orgs/get-immutable-releases-settings-repositories)`. + public enum OrgsGetImmutableReleasesSettingsRepositories { + public static let id: Swift.String = "orgs/get-immutable-releases-settings-repositories" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.page = page + self.perPage = perPage + } + } + public var query: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Path, + query: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Query = .init(), + headers: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.MinimalRepository] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - repositories: + public init( + totalCount: Swift.Int, + repositories: [Components.Schemas.MinimalRepository] + ) { + self.totalCount = totalCount + self.repositories = repositories + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case repositories + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/responses/200/content/application\/json`. + case json(Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/get(orgs/get-immutable-releases-settings-repositories)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set selected repositories for immutable releases enforcement + /// + /// 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`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)`. + public enum OrgsSetImmutableReleasesSettingsRepositories { + public static let id: Swift.String = "orgs/set-immutable-releases-settings-repositories" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/PUT/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// An array of repository ids for which immutable releases enforcement should be applied. You can only provide a list of repository ids when the `enforced_repositories` is set to `selected`. You can add and remove individual repositories using the [Enable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization) and [Disable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization) endpoints. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedRepositoryIds: An array of repository ids for which immutable releases enforcement should be applied. You can only provide a list of repository ids when the `enforced_repositories` is set to `selected`. You can add and remove individual repositories using the [Enable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization) and [Disable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization) endpoints. + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Body.JsonPayload) + } + public var body: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Path, + body: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsSetImmutableReleasesSettingsRepositories.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsSetImmutableReleasesSettingsRepositories.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Enable a selected repository for immutable releases in an organization + /// + /// 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`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)`. + public enum OrgsEnableSelectedRepositoryImmutableReleasesOrganization { + public static let id: Swift.String = "orgs/enable-selected-repository-immutable-releases-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/{repository_id}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/{repository_id}/PUT/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - repositoryId: The unique identifier of the repository. + public init( + org: Components.Parameters.Org, + repositoryId: Components.Parameters.RepositoryId + ) { + self.org = org + self.repositoryId = repositoryId + } + } + public var path: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Disable a selected repository for immutable releases in an organization + /// + /// 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`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)`. + public enum OrgsDisableSelectedRepositoryImmutableReleasesOrganization { + public static let id: Swift.String = "orgs/disable-selected-repository-immutable-releases-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/{repository_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/{repository_id}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/{repository_id}/DELETE/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - repositoryId: The unique identifier of the repository. + public init( + org: Components.Parameters.Org, + repositoryId: Components.Parameters.RepositoryId + ) { + self.org = org + self.repositoryId = repositoryId + } + } + public var path: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } /// Enable or disable a security feature for an organization /// /// > [!WARNING] From 83356df2ec6fee164247441bb6e02383031d0e72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 6 Oct 2025 21:46:41 +0000 Subject: [PATCH 5/7] Commit via running: make Sources/repos --- Sources/repos/Client.swift | 202 +++++++++++++ Sources/repos/Types.swift | 562 +++++++++++++++++++++++++++++++++++++ 2 files changed, 764 insertions(+) diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index 7ed008312a..2f93a1be99 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -12245,6 +12245,208 @@ public struct Client: APIProtocol { } ) } + /// Check if immutable releases are enabled for a repository + /// + /// Shows whether immutable releases are enabled or disabled. Also identifies whether immutability is being + /// enforced by the repository owner. The authenticated user must have admin read access to the repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)`. + public func reposCheckImmutableReleases(_ input: Operations.ReposCheckImmutableReleases.Input) async throws -> Operations.ReposCheckImmutableReleases.Output { + try await client.send( + input: input, + forOperation: Operations.ReposCheckImmutableReleases.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/immutable-releases", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ReposCheckImmutableReleases.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.CheckImmutableReleases.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + return .notFound(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Enable immutable releases + /// + /// Enables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)`. + public func reposEnableImmutableReleases(_ input: Operations.ReposEnableImmutableReleases.Input) async throws -> Operations.ReposEnableImmutableReleases.Output { + try await client.send( + input: input, + forOperation: Operations.ReposEnableImmutableReleases.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/immutable-releases", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Disable immutable releases + /// + /// Disables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)`. + public func reposDisableImmutableReleases(_ input: Operations.ReposDisableImmutableReleases.Input) async throws -> Operations.ReposDisableImmutableReleases.Output { + try await client.send( + input: input, + forOperation: Operations.ReposDisableImmutableReleases.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/immutable-releases", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List repository invitations /// /// When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 8cc427b806..3fa9537b53 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -1375,6 +1375,28 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /repos/{owner}/{repo}/hooks/{hook_id}/tests`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/hooks/{hook_id}/tests/post(repos/test-push-webhook)`. func reposTestPushWebhook(_ input: Operations.ReposTestPushWebhook.Input) async throws -> Operations.ReposTestPushWebhook.Output + /// Check if immutable releases are enabled for a repository + /// + /// Shows whether immutable releases are enabled or disabled. Also identifies whether immutability is being + /// enforced by the repository owner. The authenticated user must have admin read access to the repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)`. + func reposCheckImmutableReleases(_ input: Operations.ReposCheckImmutableReleases.Input) async throws -> Operations.ReposCheckImmutableReleases.Output + /// Enable immutable releases + /// + /// Enables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)`. + func reposEnableImmutableReleases(_ input: Operations.ReposEnableImmutableReleases.Input) async throws -> Operations.ReposEnableImmutableReleases.Output + /// Disable immutable releases + /// + /// Disables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)`. + func reposDisableImmutableReleases(_ input: Operations.ReposDisableImmutableReleases.Input) async throws -> Operations.ReposDisableImmutableReleases.Output /// List repository invitations /// /// When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. @@ -4503,6 +4525,52 @@ extension APIProtocol { headers: headers )) } + /// Check if immutable releases are enabled for a repository + /// + /// Shows whether immutable releases are enabled or disabled. Also identifies whether immutability is being + /// enforced by the repository owner. The authenticated user must have admin read access to the repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)`. + public func reposCheckImmutableReleases( + path: Operations.ReposCheckImmutableReleases.Input.Path, + headers: Operations.ReposCheckImmutableReleases.Input.Headers = .init() + ) async throws -> Operations.ReposCheckImmutableReleases.Output { + try await reposCheckImmutableReleases(Operations.ReposCheckImmutableReleases.Input( + path: path, + headers: headers + )) + } + /// Enable immutable releases + /// + /// Enables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)`. + public func reposEnableImmutableReleases( + path: Operations.ReposEnableImmutableReleases.Input.Path, + headers: Operations.ReposEnableImmutableReleases.Input.Headers = .init() + ) async throws -> Operations.ReposEnableImmutableReleases.Output { + try await reposEnableImmutableReleases(Operations.ReposEnableImmutableReleases.Input( + path: path, + headers: headers + )) + } + /// Disable immutable releases + /// + /// Disables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)`. + public func reposDisableImmutableReleases( + path: Operations.ReposDisableImmutableReleases.Input.Path, + headers: Operations.ReposDisableImmutableReleases.Input.Headers = .init() + ) async throws -> Operations.ReposDisableImmutableReleases.Output { + try await reposDisableImmutableReleases(Operations.ReposDisableImmutableReleases.Input( + path: path, + headers: headers + )) + } /// List repository invitations /// /// When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. @@ -20545,6 +20613,35 @@ public enum Components { case lastResponse = "last_response" } } + /// Check immutable releases + /// + /// - Remark: Generated from `#/components/schemas/check-immutable-releases`. + public struct CheckImmutableReleases: Codable, Hashable, Sendable { + /// Whether immutable releases are enabled for the repository. + /// + /// - Remark: Generated from `#/components/schemas/check-immutable-releases/enabled`. + public var enabled: Swift.Bool + /// Whether immutable releases are enforced by the repository owner. + /// + /// - Remark: Generated from `#/components/schemas/check-immutable-releases/enforced_by_owner`. + public var enforcedByOwner: Swift.Bool + /// Creates a new `CheckImmutableReleases`. + /// + /// - Parameters: + /// - enabled: Whether immutable releases are enabled for the repository. + /// - enforcedByOwner: Whether immutable releases are enforced by the repository owner. + public init( + enabled: Swift.Bool, + enforcedByOwner: Swift.Bool + ) { + self.enabled = enabled + self.enforcedByOwner = enforcedByOwner + } + public enum CodingKeys: String, CodingKey { + case enabled + case enforcedByOwner = "enforced_by_owner" + } + } /// An SSH key granting access to a single repository. /// /// - Remark: Generated from `#/components/schemas/deploy-key`. @@ -49646,6 +49743,471 @@ public enum Operations { } } } + /// Check if immutable releases are enabled for a repository + /// + /// Shows whether immutable releases are enabled or disabled. Also identifies whether immutability is being + /// enforced by the repository owner. The authenticated user must have admin read access to the repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)`. + public enum ReposCheckImmutableReleases { + public static let id: Swift.String = "repos/check-immutable-releases" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ReposCheckImmutableReleases.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ReposCheckImmutableReleases.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ReposCheckImmutableReleases.Input.Path, + headers: Operations.ReposCheckImmutableReleases.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CheckImmutableReleases) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.CheckImmutableReleases { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ReposCheckImmutableReleases.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ReposCheckImmutableReleases.Output.Ok.Body) { + self.body = body + } + } + /// Response if immutable releases are enabled + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ReposCheckImmutableReleases.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ReposCheckImmutableReleases.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Not Found if immutable releases are not enabled for the repository + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.ReposCheckImmutableReleases.Output.NotFound) + /// Not Found if immutable releases are not enabled for the repository + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.ReposCheckImmutableReleases.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Enable immutable releases + /// + /// Enables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)`. + public enum ReposEnableImmutableReleases { + public static let id: Swift.String = "repos/enable-immutable-releases" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/PUT/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/PUT/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/PUT/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ReposEnableImmutableReleases.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ReposEnableImmutableReleases.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ReposEnableImmutableReleases.Input.Path, + headers: Operations.ReposEnableImmutableReleases.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.NoContent) + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Components.Responses.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Disable immutable releases + /// + /// Disables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)`. + public enum ReposDisableImmutableReleases { + public static let id: Swift.String = "repos/disable-immutable-releases" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/DELETE/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ReposDisableImmutableReleases.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ReposDisableImmutableReleases.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ReposDisableImmutableReleases.Input.Path, + headers: Operations.ReposDisableImmutableReleases.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.NoContent) + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Components.Responses.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// List repository invitations /// /// When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. From a77f0000afa2c9ef4488363b64654ed444c3729b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 6 Oct 2025 21:47:04 +0000 Subject: [PATCH 6/7] Commit via running: make Sources/search --- Sources/search/Client.swift | 7 ------- Sources/search/Types.swift | 19 +------------------ 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/Sources/search/Client.swift b/Sources/search/Client.swift index 80609104bd..95c2694c62 100644 --- a/Sources/search/Client.swift +++ b/Sources/search/Client.swift @@ -393,13 +393,6 @@ public struct Client: APIProtocol { name: "advanced_search", value: input.query.advancedSearch ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "search_type", - value: input.query.searchType - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index 3c2ac0f816..d3d33af1bb 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -5255,12 +5255,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/issues-advanced-search`. public typealias IssuesAdvancedSearch = Swift.String - /// The type of search to perform. Set to `semantic` to perform a semantic search. - /// - /// - Remark: Generated from `#/components/parameters/search-type`. - @frozen public enum SearchType: String, Codable, Hashable, Sendable, CaseIterable { - case semantic = "semantic" - } } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} @@ -6035,14 +6029,6 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/search/issues/GET/query/advanced_search`. public var advancedSearch: Components.Parameters.IssuesAdvancedSearch? - /// - Remark: Generated from `#/components/parameters/search-type`. - @frozen public enum SearchType: String, Codable, Hashable, Sendable, CaseIterable { - case semantic = "semantic" - } - /// The type of search to perform. Set to `semantic` to perform a semantic search. - /// - /// - Remark: Generated from `#/paths/search/issues/GET/query/search_type`. - public var searchType: Components.Parameters.SearchType? /// Creates a new `Query`. /// /// - Parameters: @@ -6052,15 +6038,13 @@ public enum Operations { /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - advancedSearch: Set to `true` to use advanced search. - /// - searchType: The type of search to perform. Set to `semantic` to perform a semantic search. public init( q: Swift.String, sort: Operations.SearchIssuesAndPullRequests.Input.Query.SortPayload? = nil, order: Components.Parameters.Order? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil, - advancedSearch: Components.Parameters.IssuesAdvancedSearch? = nil, - searchType: Components.Parameters.SearchType? = nil + advancedSearch: Components.Parameters.IssuesAdvancedSearch? = nil ) { self.q = q self.sort = sort @@ -6068,7 +6052,6 @@ public enum Operations { self.perPage = perPage self.page = page self.advancedSearch = advancedSearch - self.searchType = searchType } } public var query: Operations.SearchIssuesAndPullRequests.Input.Query From e580605c62b1a76ff0634a0033e8bcc5d28a8627 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 6 Oct 2025 21:47:26 +0000 Subject: [PATCH 7/7] Commit via running: make Sources/secret-scanning --- Sources/secret-scanning/Types.swift | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index 2e736c8d67..3fc5279e53 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -1890,6 +1890,8 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/has_more_locations`. public var hasMoreLocations: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/assigned_to`. + public var assignedTo: Components.Schemas.NullableSimpleUser? /// Creates a new `OrganizationSecretScanningAlert`. /// /// - Parameters: @@ -1921,6 +1923,7 @@ public enum Components { /// - isBase64Encoded: A boolean value representing whether or not alert is base64 encoded /// - firstLocationDetected: /// - hasMoreLocations: A boolean value representing whether or not the token in the alert was detected in more than one location. + /// - assignedTo: public init( number: Components.Schemas.AlertNumber? = nil, createdAt: Components.Schemas.AlertCreatedAt? = nil, @@ -1949,7 +1952,8 @@ public enum Components { multiRepo: Swift.Bool? = nil, isBase64Encoded: Swift.Bool? = nil, firstLocationDetected: Components.Schemas.NullableSecretScanningFirstDetectedLocation? = nil, - hasMoreLocations: Swift.Bool? = nil + hasMoreLocations: Swift.Bool? = nil, + assignedTo: Components.Schemas.NullableSimpleUser? = nil ) { self.number = number self.createdAt = createdAt @@ -1979,6 +1983,7 @@ public enum Components { self.isBase64Encoded = isBase64Encoded self.firstLocationDetected = firstLocationDetected self.hasMoreLocations = hasMoreLocations + self.assignedTo = assignedTo } public enum CodingKeys: String, CodingKey { case number @@ -2009,6 +2014,7 @@ public enum Components { case isBase64Encoded = "is_base64_encoded" case firstLocationDetected = "first_location_detected" case hasMoreLocations = "has_more_locations" + case assignedTo = "assigned_to" } } /// The version of the entity. This is used to confirm you're updating the current version of the entity and mitigate unintentionally overriding someone else's update. @@ -2281,6 +2287,8 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/has_more_locations`. public var hasMoreLocations: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/assigned_to`. + public var assignedTo: Components.Schemas.NullableSimpleUser? /// Creates a new `SecretScanningAlert`. /// /// - Parameters: @@ -2311,6 +2319,7 @@ public enum Components { /// - isBase64Encoded: A boolean value representing whether or not alert is base64 encoded /// - firstLocationDetected: /// - hasMoreLocations: A boolean value representing whether or not the token in the alert was detected in more than one location. + /// - assignedTo: public init( number: Components.Schemas.AlertNumber? = nil, createdAt: Components.Schemas.AlertCreatedAt? = nil, @@ -2338,7 +2347,8 @@ public enum Components { multiRepo: Swift.Bool? = nil, isBase64Encoded: Swift.Bool? = nil, firstLocationDetected: Components.Schemas.NullableSecretScanningFirstDetectedLocation? = nil, - hasMoreLocations: Swift.Bool? = nil + hasMoreLocations: Swift.Bool? = nil, + assignedTo: Components.Schemas.NullableSimpleUser? = nil ) { self.number = number self.createdAt = createdAt @@ -2367,6 +2377,7 @@ public enum Components { self.isBase64Encoded = isBase64Encoded self.firstLocationDetected = firstLocationDetected self.hasMoreLocations = hasMoreLocations + self.assignedTo = assignedTo } public enum CodingKeys: String, CodingKey { case number @@ -2396,6 +2407,7 @@ public enum Components { case isBase64Encoded = "is_base64_encoded" case firstLocationDetected = "first_location_detected" case hasMoreLocations = "has_more_locations" + case assignedTo = "assigned_to" } } /// An optional comment when closing or reopening an alert. Cannot be updated or deleted.