From c3e6cf13b37799bdeb61509da5e070026a5b3d1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 21:11:41 +0000 Subject: [PATCH 01/12] Bump Submodule/github/rest-api-description from `0e84946` to `9eeb21a` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `0e84946` to `9eeb21a`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/0e84946a411c87c1cb48ba453dea88409fc295c7...9eeb21a45b4c3d00de498624445a196062c7dfde) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description 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 0e84946a411..9eeb21a45b4 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 0e84946a411c87c1cb48ba453dea88409fc295c7 +Subproject commit 9eeb21a45b4c3d00de498624445a196062c7dfde From f50f1c2653d4cbd674e5df355fac2c7c9c4516d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 19 Aug 2024 21:27:31 +0000 Subject: [PATCH 02/12] Commit via running ake Sources/actions --- Sources/actions/Types.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index 47dc724f8b9..b81f0496849 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -5215,6 +5215,8 @@ public enum Components { public var slug: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/node_id`. public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. + public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// The name of the GitHub app @@ -5345,8 +5347,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. public var installations_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. - public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. public var client_secret: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. @@ -5359,6 +5359,7 @@ public enum Components { /// - id: Unique identifier of the GitHub app /// - slug: The slug name of the GitHub app /// - node_id: + /// - client_id: /// - owner: /// - name: The name of the GitHub app /// - description: @@ -5369,7 +5370,6 @@ public enum Components { /// - permissions: The set of permissions for the GitHub app /// - events: The list of events for the GitHub app /// - installations_count: The number of installations associated with the GitHub app - /// - client_id: /// - client_secret: /// - webhook_secret: /// - pem: @@ -5377,6 +5377,7 @@ public enum Components { id: Swift.Int, slug: Swift.String? = nil, node_id: Swift.String, + client_id: Swift.String? = nil, owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, name: Swift.String, description: Swift.String? = nil, @@ -5387,7 +5388,6 @@ public enum Components { permissions: Components.Schemas.nullable_hyphen_integration.permissionsPayload, events: [Swift.String], installations_count: Swift.Int? = nil, - client_id: Swift.String? = nil, client_secret: Swift.String? = nil, webhook_secret: Swift.String? = nil, pem: Swift.String? = nil @@ -5395,6 +5395,7 @@ public enum Components { self.id = id self.slug = slug self.node_id = node_id + self.client_id = client_id self.owner = owner self.name = name self.description = description @@ -5405,7 +5406,6 @@ public enum Components { self.permissions = permissions self.events = events self.installations_count = installations_count - self.client_id = client_id self.client_secret = client_secret self.webhook_secret = webhook_secret self.pem = pem @@ -5414,6 +5414,7 @@ public enum Components { case id case slug case node_id + case client_id case owner case name case description @@ -5424,7 +5425,6 @@ public enum Components { case permissions case events case installations_count - case client_id case client_secret case webhook_secret case pem From e7722215e3e13ac614de0013a59ae4ba0782f73a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 19 Aug 2024 21:27:53 +0000 Subject: [PATCH 03/12] Commit via running ake Sources/activity --- Sources/activity/Types.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/activity/Types.swift b/Sources/activity/Types.swift index 09231940490..e764875c002 100644 --- a/Sources/activity/Types.swift +++ b/Sources/activity/Types.swift @@ -2300,6 +2300,8 @@ public enum Components { public var slug: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/node_id`. public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. + public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// The name of the GitHub app @@ -2430,8 +2432,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. public var installations_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. - public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. public var client_secret: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. @@ -2444,6 +2444,7 @@ public enum Components { /// - id: Unique identifier of the GitHub app /// - slug: The slug name of the GitHub app /// - node_id: + /// - client_id: /// - owner: /// - name: The name of the GitHub app /// - description: @@ -2454,7 +2455,6 @@ public enum Components { /// - permissions: The set of permissions for the GitHub app /// - events: The list of events for the GitHub app /// - installations_count: The number of installations associated with the GitHub app - /// - client_id: /// - client_secret: /// - webhook_secret: /// - pem: @@ -2462,6 +2462,7 @@ public enum Components { id: Swift.Int, slug: Swift.String? = nil, node_id: Swift.String, + client_id: Swift.String? = nil, owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, name: Swift.String, description: Swift.String? = nil, @@ -2472,7 +2473,6 @@ public enum Components { permissions: Components.Schemas.nullable_hyphen_integration.permissionsPayload, events: [Swift.String], installations_count: Swift.Int? = nil, - client_id: Swift.String? = nil, client_secret: Swift.String? = nil, webhook_secret: Swift.String? = nil, pem: Swift.String? = nil @@ -2480,6 +2480,7 @@ public enum Components { self.id = id self.slug = slug self.node_id = node_id + self.client_id = client_id self.owner = owner self.name = name self.description = description @@ -2490,7 +2491,6 @@ public enum Components { self.permissions = permissions self.events = events self.installations_count = installations_count - self.client_id = client_id self.client_secret = client_secret self.webhook_secret = webhook_secret self.pem = pem @@ -2499,6 +2499,7 @@ public enum Components { case id case slug case node_id + case client_id case owner case name case description @@ -2509,7 +2510,6 @@ public enum Components { case permissions case events case installations_count - case client_id case client_secret case webhook_secret case pem From 345a3be453c2c9661a2ef1c96dd704fd8dfffba6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 19 Aug 2024 21:28:13 +0000 Subject: [PATCH 04/12] Commit via running ake Sources/apps --- Sources/apps/Types.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/apps/Types.swift b/Sources/apps/Types.swift index f94f2c69c9e..cf1b9cc4451 100644 --- a/Sources/apps/Types.swift +++ b/Sources/apps/Types.swift @@ -1341,6 +1341,8 @@ public enum Components { public var slug: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/node_id`. public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/integration/client_id`. + public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/owner`. public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// The name of the GitHub app @@ -1471,8 +1473,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/integration/installations_count`. public var installations_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/integration/client_id`. - public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/client_secret`. public var client_secret: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/webhook_secret`. @@ -1485,6 +1485,7 @@ public enum Components { /// - id: Unique identifier of the GitHub app /// - slug: The slug name of the GitHub app /// - node_id: + /// - client_id: /// - owner: /// - name: The name of the GitHub app /// - description: @@ -1495,7 +1496,6 @@ public enum Components { /// - permissions: The set of permissions for the GitHub app /// - events: The list of events for the GitHub app /// - installations_count: The number of installations associated with the GitHub app - /// - client_id: /// - client_secret: /// - webhook_secret: /// - pem: @@ -1503,6 +1503,7 @@ public enum Components { id: Swift.Int, slug: Swift.String? = nil, node_id: Swift.String, + client_id: Swift.String? = nil, owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, name: Swift.String, description: Swift.String? = nil, @@ -1513,7 +1514,6 @@ public enum Components { permissions: Components.Schemas.integration.permissionsPayload, events: [Swift.String], installations_count: Swift.Int? = nil, - client_id: Swift.String? = nil, client_secret: Swift.String? = nil, webhook_secret: Swift.String? = nil, pem: Swift.String? = nil @@ -1521,6 +1521,7 @@ public enum Components { self.id = id self.slug = slug self.node_id = node_id + self.client_id = client_id self.owner = owner self.name = name self.description = description @@ -1531,7 +1532,6 @@ public enum Components { self.permissions = permissions self.events = events self.installations_count = installations_count - self.client_id = client_id self.client_secret = client_secret self.webhook_secret = webhook_secret self.pem = pem @@ -1540,6 +1540,7 @@ public enum Components { case id case slug case node_id + case client_id case owner case name case description @@ -1550,7 +1551,6 @@ public enum Components { case permissions case events case installations_count - case client_id case client_secret case webhook_secret case pem From 239a7780095551960742e61828c9e085b5987a48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 19 Aug 2024 21:28:55 +0000 Subject: [PATCH 05/12] Commit via running ake Sources/checks --- Sources/checks/Types.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/checks/Types.swift b/Sources/checks/Types.swift index d4aa2f859c7..fcc84f1dfe9 100644 --- a/Sources/checks/Types.swift +++ b/Sources/checks/Types.swift @@ -789,6 +789,8 @@ public enum Components { public var slug: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/node_id`. public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. + public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// The name of the GitHub app @@ -919,8 +921,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. public var installations_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. - public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. public var client_secret: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. @@ -933,6 +933,7 @@ public enum Components { /// - id: Unique identifier of the GitHub app /// - slug: The slug name of the GitHub app /// - node_id: + /// - client_id: /// - owner: /// - name: The name of the GitHub app /// - description: @@ -943,7 +944,6 @@ public enum Components { /// - permissions: The set of permissions for the GitHub app /// - events: The list of events for the GitHub app /// - installations_count: The number of installations associated with the GitHub app - /// - client_id: /// - client_secret: /// - webhook_secret: /// - pem: @@ -951,6 +951,7 @@ public enum Components { id: Swift.Int, slug: Swift.String? = nil, node_id: Swift.String, + client_id: Swift.String? = nil, owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, name: Swift.String, description: Swift.String? = nil, @@ -961,7 +962,6 @@ public enum Components { permissions: Components.Schemas.nullable_hyphen_integration.permissionsPayload, events: [Swift.String], installations_count: Swift.Int? = nil, - client_id: Swift.String? = nil, client_secret: Swift.String? = nil, webhook_secret: Swift.String? = nil, pem: Swift.String? = nil @@ -969,6 +969,7 @@ public enum Components { self.id = id self.slug = slug self.node_id = node_id + self.client_id = client_id self.owner = owner self.name = name self.description = description @@ -979,7 +980,6 @@ public enum Components { self.permissions = permissions self.events = events self.installations_count = installations_count - self.client_id = client_id self.client_secret = client_secret self.webhook_secret = webhook_secret self.pem = pem @@ -988,6 +988,7 @@ public enum Components { case id case slug case node_id + case client_id case owner case name case description @@ -998,7 +999,6 @@ public enum Components { case permissions case events case installations_count - case client_id case client_secret case webhook_secret case pem From b47be22b0c9174c571bb98423d5429352be56952 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 19 Aug 2024 21:32:03 +0000 Subject: [PATCH 06/12] Commit via running ake Sources/issues --- Sources/issues/Types.swift | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 63fa1666ebf..094041126fb 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -1534,6 +1534,8 @@ public enum Components { public var slug: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/node_id`. public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/integration/client_id`. + public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/owner`. public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// The name of the GitHub app @@ -1664,8 +1666,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/integration/installations_count`. public var installations_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/integration/client_id`. - public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/client_secret`. public var client_secret: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/webhook_secret`. @@ -1678,6 +1678,7 @@ public enum Components { /// - id: Unique identifier of the GitHub app /// - slug: The slug name of the GitHub app /// - node_id: + /// - client_id: /// - owner: /// - name: The name of the GitHub app /// - description: @@ -1688,7 +1689,6 @@ public enum Components { /// - permissions: The set of permissions for the GitHub app /// - events: The list of events for the GitHub app /// - installations_count: The number of installations associated with the GitHub app - /// - client_id: /// - client_secret: /// - webhook_secret: /// - pem: @@ -1696,6 +1696,7 @@ public enum Components { id: Swift.Int, slug: Swift.String? = nil, node_id: Swift.String, + client_id: Swift.String? = nil, owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, name: Swift.String, description: Swift.String? = nil, @@ -1706,7 +1707,6 @@ public enum Components { permissions: Components.Schemas.integration.permissionsPayload, events: [Swift.String], installations_count: Swift.Int? = nil, - client_id: Swift.String? = nil, client_secret: Swift.String? = nil, webhook_secret: Swift.String? = nil, pem: Swift.String? = nil @@ -1714,6 +1714,7 @@ public enum Components { self.id = id self.slug = slug self.node_id = node_id + self.client_id = client_id self.owner = owner self.name = name self.description = description @@ -1724,7 +1725,6 @@ public enum Components { self.permissions = permissions self.events = events self.installations_count = installations_count - self.client_id = client_id self.client_secret = client_secret self.webhook_secret = webhook_secret self.pem = pem @@ -1733,6 +1733,7 @@ public enum Components { case id case slug case node_id + case client_id case owner case name case description @@ -1743,7 +1744,6 @@ public enum Components { case permissions case events case installations_count - case client_id case client_secret case webhook_secret case pem @@ -3093,6 +3093,8 @@ public enum Components { public var slug: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/node_id`. public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. + public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// The name of the GitHub app @@ -3223,8 +3225,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. public var installations_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. - public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. public var client_secret: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. @@ -3237,6 +3237,7 @@ public enum Components { /// - id: Unique identifier of the GitHub app /// - slug: The slug name of the GitHub app /// - node_id: + /// - client_id: /// - owner: /// - name: The name of the GitHub app /// - description: @@ -3247,7 +3248,6 @@ public enum Components { /// - permissions: The set of permissions for the GitHub app /// - events: The list of events for the GitHub app /// - installations_count: The number of installations associated with the GitHub app - /// - client_id: /// - client_secret: /// - webhook_secret: /// - pem: @@ -3255,6 +3255,7 @@ public enum Components { id: Swift.Int, slug: Swift.String? = nil, node_id: Swift.String, + client_id: Swift.String? = nil, owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, name: Swift.String, description: Swift.String? = nil, @@ -3265,7 +3266,6 @@ public enum Components { permissions: Components.Schemas.nullable_hyphen_integration.permissionsPayload, events: [Swift.String], installations_count: Swift.Int? = nil, - client_id: Swift.String? = nil, client_secret: Swift.String? = nil, webhook_secret: Swift.String? = nil, pem: Swift.String? = nil @@ -3273,6 +3273,7 @@ public enum Components { self.id = id self.slug = slug self.node_id = node_id + self.client_id = client_id self.owner = owner self.name = name self.description = description @@ -3283,7 +3284,6 @@ public enum Components { self.permissions = permissions self.events = events self.installations_count = installations_count - self.client_id = client_id self.client_secret = client_secret self.webhook_secret = webhook_secret self.pem = pem @@ -3292,6 +3292,7 @@ public enum Components { case id case slug case node_id + case client_id case owner case name case description @@ -3302,7 +3303,6 @@ public enum Components { case permissions case events case installations_count - case client_id case client_secret case webhook_secret case pem From 143f47598f3303ceceda877877e6d2f7c9347e72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 19 Aug 2024 21:34:30 +0000 Subject: [PATCH 07/12] Commit via running ake Sources/orgs --- Sources/orgs/Client.swift | 8 ++--- Sources/orgs/Types.swift | 70 ++++++++++++++++++++++----------------- 2 files changed, 43 insertions(+), 35 deletions(-) diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index aa1172aad99..3ab8bd3028e 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -5551,7 +5551,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.org_hyphen_custom_hyphen_property].self, + [Components.Schemas.custom_hyphen_property].self, from: responseBody, transforming: { value in .json(value) @@ -5672,7 +5672,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.org_hyphen_custom_hyphen_property].self, + [Components.Schemas.custom_hyphen_property].self, from: responseBody, transforming: { value in .json(value) @@ -5782,7 +5782,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.org_hyphen_custom_hyphen_property.self, + Components.Schemas.custom_hyphen_property.self, from: responseBody, transforming: { value in .json(value) @@ -5904,7 +5904,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.org_hyphen_custom_hyphen_property.self, + Components.Schemas.custom_hyphen_property.self, from: responseBody, transforming: { value in .json(value) diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index f07907611ea..4c8aef3c32c 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -6726,15 +6726,19 @@ public enum Components { } /// Custom property defined on an organization /// - /// - Remark: Generated from `#/components/schemas/org-custom-property`. - public struct org_hyphen_custom_hyphen_property: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/custom-property`. + public struct custom_hyphen_property: Codable, Hashable, Sendable { /// The name of the property /// - /// - Remark: Generated from `#/components/schemas/org-custom-property/property_name`. + /// - Remark: Generated from `#/components/schemas/custom-property/property_name`. public var property_name: Swift.String + /// The URL that can be used to fetch, update, or delete info about this property via the API. + /// + /// - Remark: Generated from `#/components/schemas/custom-property/url`. + public var url: Swift.String? /// The type of the value for the property /// - /// - Remark: Generated from `#/components/schemas/org-custom-property/value_type`. + /// - Remark: Generated from `#/components/schemas/custom-property/value_type`. @frozen public enum value_typePayload: String, Codable, Hashable, Sendable { case string = "string" case single_select = "single_select" @@ -6743,19 +6747,19 @@ public enum Components { } /// The type of the value for the property /// - /// - Remark: Generated from `#/components/schemas/org-custom-property/value_type`. - public var value_type: Components.Schemas.org_hyphen_custom_hyphen_property.value_typePayload + /// - Remark: Generated from `#/components/schemas/custom-property/value_type`. + public var value_type: Components.Schemas.custom_hyphen_property.value_typePayload /// Whether the property is required. /// - /// - Remark: Generated from `#/components/schemas/org-custom-property/required`. + /// - Remark: Generated from `#/components/schemas/custom-property/required`. public var required: Swift.Bool? /// Default value of the property /// - /// - Remark: Generated from `#/components/schemas/org-custom-property/default_value`. + /// - Remark: Generated from `#/components/schemas/custom-property/default_value`. @frozen public enum default_valuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/org-custom-property/default_value/case1`. + /// - Remark: Generated from `#/components/schemas/custom-property/default_value/case1`. case case1(Swift.String) - /// - Remark: Generated from `#/components/schemas/org-custom-property/default_value/case2`. + /// - Remark: Generated from `#/components/schemas/custom-property/default_value/case2`. case case2([Swift.String]) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] @@ -6788,32 +6792,33 @@ public enum Components { } /// Default value of the property /// - /// - Remark: Generated from `#/components/schemas/org-custom-property/default_value`. - public var default_value: Components.Schemas.org_hyphen_custom_hyphen_property.default_valuePayload? + /// - Remark: Generated from `#/components/schemas/custom-property/default_value`. + public var default_value: Components.Schemas.custom_hyphen_property.default_valuePayload? /// Short description of the property /// - /// - Remark: Generated from `#/components/schemas/org-custom-property/description`. + /// - Remark: Generated from `#/components/schemas/custom-property/description`. public var description: Swift.String? /// An ordered list of the allowed values of the property. /// The property can have up to 200 allowed values. /// - /// - Remark: Generated from `#/components/schemas/org-custom-property/allowed_values`. + /// - Remark: Generated from `#/components/schemas/custom-property/allowed_values`. public var allowed_values: [Swift.String]? /// Who can edit the values of the property /// - /// - Remark: Generated from `#/components/schemas/org-custom-property/values_editable_by`. + /// - Remark: Generated from `#/components/schemas/custom-property/values_editable_by`. @frozen public enum values_editable_byPayload: String, Codable, Hashable, Sendable { case org_actors = "org_actors" case org_and_repo_actors = "org_and_repo_actors" } /// Who can edit the values of the property /// - /// - Remark: Generated from `#/components/schemas/org-custom-property/values_editable_by`. - public var values_editable_by: Components.Schemas.org_hyphen_custom_hyphen_property.values_editable_byPayload? - /// Creates a new `org_hyphen_custom_hyphen_property`. + /// - Remark: Generated from `#/components/schemas/custom-property/values_editable_by`. + public var values_editable_by: Components.Schemas.custom_hyphen_property.values_editable_byPayload? + /// Creates a new `custom_hyphen_property`. /// /// - Parameters: /// - property_name: The name of the property + /// - url: The URL that can be used to fetch, update, or delete info about this property via the API. /// - value_type: The type of the value for the property /// - required: Whether the property is required. /// - default_value: Default value of the property @@ -6822,14 +6827,16 @@ public enum Components { /// - values_editable_by: Who can edit the values of the property public init( property_name: Swift.String, - value_type: Components.Schemas.org_hyphen_custom_hyphen_property.value_typePayload, + url: Swift.String? = nil, + value_type: Components.Schemas.custom_hyphen_property.value_typePayload, required: Swift.Bool? = nil, - default_value: Components.Schemas.org_hyphen_custom_hyphen_property.default_valuePayload? = nil, + default_value: Components.Schemas.custom_hyphen_property.default_valuePayload? = nil, description: Swift.String? = nil, allowed_values: [Swift.String]? = nil, - values_editable_by: Components.Schemas.org_hyphen_custom_hyphen_property.values_editable_byPayload? = nil + values_editable_by: Components.Schemas.custom_hyphen_property.values_editable_byPayload? = nil ) { self.property_name = property_name + self.url = url self.value_type = value_type self.required = required self.default_value = default_value @@ -6839,6 +6846,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case property_name + case url case value_type case required case default_value @@ -18141,12 +18149,12 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/responses/200/content/application\/json`. - case json([Components.Schemas.org_hyphen_custom_hyphen_property]) + case json([Components.Schemas.custom_hyphen_property]) /// 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.org_hyphen_custom_hyphen_property] { + public var json: [Components.Schemas.custom_hyphen_property] { get throws { switch self { case let .json(body): @@ -18312,12 +18320,12 @@ public enum Operations { /// The array of custom properties to create or update. /// /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody/json/properties`. - public var properties: [Components.Schemas.org_hyphen_custom_hyphen_property] + public var properties: [Components.Schemas.custom_hyphen_property] /// Creates a new `jsonPayload`. /// /// - Parameters: /// - properties: The array of custom properties to create or update. - public init(properties: [Components.Schemas.org_hyphen_custom_hyphen_property]) { + public init(properties: [Components.Schemas.custom_hyphen_property]) { self.properties = properties } public enum CodingKeys: String, CodingKey { @@ -18349,12 +18357,12 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/responses/200/content/application\/json`. - case json([Components.Schemas.org_hyphen_custom_hyphen_property]) + case json([Components.Schemas.custom_hyphen_property]) /// 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.org_hyphen_custom_hyphen_property] { + public var json: [Components.Schemas.custom_hyphen_property] { get throws { switch self { case let .json(body): @@ -18537,12 +18545,12 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.org_hyphen_custom_hyphen_property) + case json(Components.Schemas.custom_hyphen_property) /// 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.org_hyphen_custom_hyphen_property { + public var json: Components.Schemas.custom_hyphen_property { get throws { switch self { case let .json(body): @@ -18835,12 +18843,12 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/responses/200/content/application\/json`. - case json(Components.Schemas.org_hyphen_custom_hyphen_property) + case json(Components.Schemas.custom_hyphen_property) /// 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.org_hyphen_custom_hyphen_property { + public var json: Components.Schemas.custom_hyphen_property { get throws { switch self { case let .json(body): From 8040453599475450fb558a0e76fcc52a896e4ea9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 19 Aug 2024 21:36:36 +0000 Subject: [PATCH 08/12] Commit via running ake Sources/repos --- Sources/repos/Client.swift | 2 ++ Sources/repos/Types.swift | 59 ++++++++++++++++++++++++++++---------- 2 files changed, 46 insertions(+), 15 deletions(-) diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index f8165e9c202..4cb921c6b93 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -14745,6 +14745,8 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 304: + return .notModified(.init()) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.not_found.Body diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 7d227a6211f..d03a2681163 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -6221,6 +6221,8 @@ public enum Components { public var slug: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/node_id`. public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/integration/client_id`. + public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/owner`. public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// The name of the GitHub app @@ -6351,8 +6353,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/integration/installations_count`. public var installations_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/integration/client_id`. - public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/client_secret`. public var client_secret: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/webhook_secret`. @@ -6365,6 +6365,7 @@ public enum Components { /// - id: Unique identifier of the GitHub app /// - slug: The slug name of the GitHub app /// - node_id: + /// - client_id: /// - owner: /// - name: The name of the GitHub app /// - description: @@ -6375,7 +6376,6 @@ public enum Components { /// - permissions: The set of permissions for the GitHub app /// - events: The list of events for the GitHub app /// - installations_count: The number of installations associated with the GitHub app - /// - client_id: /// - client_secret: /// - webhook_secret: /// - pem: @@ -6383,6 +6383,7 @@ public enum Components { id: Swift.Int, slug: Swift.String? = nil, node_id: Swift.String, + client_id: Swift.String? = nil, owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, name: Swift.String, description: Swift.String? = nil, @@ -6393,7 +6394,6 @@ public enum Components { permissions: Components.Schemas.integration.permissionsPayload, events: [Swift.String], installations_count: Swift.Int? = nil, - client_id: Swift.String? = nil, client_secret: Swift.String? = nil, webhook_secret: Swift.String? = nil, pem: Swift.String? = nil @@ -6401,6 +6401,7 @@ public enum Components { self.id = id self.slug = slug self.node_id = node_id + self.client_id = client_id self.owner = owner self.name = name self.description = description @@ -6411,7 +6412,6 @@ public enum Components { self.permissions = permissions self.events = events self.installations_count = installations_count - self.client_id = client_id self.client_secret = client_secret self.webhook_secret = webhook_secret self.pem = pem @@ -6420,6 +6420,7 @@ public enum Components { case id case slug case node_id + case client_id case owner case name case description @@ -6430,7 +6431,6 @@ public enum Components { case permissions case events case installations_count - case client_id case client_secret case webhook_secret case pem @@ -8261,6 +8261,8 @@ public enum Components { public var slug: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/node_id`. public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. + public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// The name of the GitHub app @@ -8391,8 +8393,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. public var installations_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. - public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. public var client_secret: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. @@ -8405,6 +8405,7 @@ public enum Components { /// - id: Unique identifier of the GitHub app /// - slug: The slug name of the GitHub app /// - node_id: + /// - client_id: /// - owner: /// - name: The name of the GitHub app /// - description: @@ -8415,7 +8416,6 @@ public enum Components { /// - permissions: The set of permissions for the GitHub app /// - events: The list of events for the GitHub app /// - installations_count: The number of installations associated with the GitHub app - /// - client_id: /// - client_secret: /// - webhook_secret: /// - pem: @@ -8423,6 +8423,7 @@ public enum Components { id: Swift.Int, slug: Swift.String? = nil, node_id: Swift.String, + client_id: Swift.String? = nil, owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, name: Swift.String, description: Swift.String? = nil, @@ -8433,7 +8434,6 @@ public enum Components { permissions: Components.Schemas.nullable_hyphen_integration.permissionsPayload, events: [Swift.String], installations_count: Swift.Int? = nil, - client_id: Swift.String? = nil, client_secret: Swift.String? = nil, webhook_secret: Swift.String? = nil, pem: Swift.String? = nil @@ -8441,6 +8441,7 @@ public enum Components { self.id = id self.slug = slug self.node_id = node_id + self.client_id = client_id self.owner = owner self.name = name self.description = description @@ -8451,7 +8452,6 @@ public enum Components { self.permissions = permissions self.events = events self.installations_count = installations_count - self.client_id = client_id self.client_secret = client_secret self.webhook_secret = webhook_secret self.pem = pem @@ -8460,6 +8460,7 @@ public enum Components { case id case slug case node_id + case client_id case owner case name case description @@ -8470,7 +8471,6 @@ public enum Components { case permissions case events case installations_count - case client_id case client_secret case webhook_secret case pem @@ -14477,6 +14477,8 @@ public enum Components { public var owner: Components.Schemas.branch_hyphen_restriction_hyphen_policy.appsPayloadPayload.ownerPayload? /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/appsPayload/name`. public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/appsPayload/client_id`. + public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/appsPayload/description`. public var description: Swift.String? /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/appsPayload/external_url`. @@ -14534,6 +14536,7 @@ public enum Components { /// - node_id: /// - owner: /// - name: + /// - client_id: /// - description: /// - external_url: /// - html_url: @@ -14547,6 +14550,7 @@ public enum Components { node_id: Swift.String? = nil, owner: Components.Schemas.branch_hyphen_restriction_hyphen_policy.appsPayloadPayload.ownerPayload? = nil, name: Swift.String? = nil, + client_id: Swift.String? = nil, description: Swift.String? = nil, external_url: Swift.String? = nil, html_url: Swift.String? = nil, @@ -14560,6 +14564,7 @@ public enum Components { self.node_id = node_id self.owner = owner self.name = name + self.client_id = client_id self.description = description self.external_url = external_url self.html_url = html_url @@ -14574,6 +14579,7 @@ public enum Components { case node_id case owner case name + case client_id case description case external_url case html_url @@ -25238,7 +25244,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_push_protection`. public var secret_scanning_push_protection: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.secret_scanning_push_protectionPayload? - /// Use the `status` property to enable or disable secret scanning non-provider patterns for this repository. For more information, see "[Secret scanning supported secrets](/code-security/secret-scanning/secret-scanning-patterns#supported-secrets)." + /// Use the `status` property to enable or disable secret scanning non-provider patterns for this repository. For more information, see "[Supported secret scanning patterns](/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_non_provider_patterns`. public struct secret_scanning_non_provider_patternsPayload: Codable, Hashable, Sendable { @@ -25257,7 +25263,7 @@ public enum Operations { case status } } - /// Use the `status` property to enable or disable secret scanning non-provider patterns for this repository. For more information, see "[Secret scanning supported secrets](/code-security/secret-scanning/secret-scanning-patterns#supported-secrets)." + /// Use the `status` property to enable or disable secret scanning non-provider patterns for this repository. For more information, see "[Supported secret scanning patterns](/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.secret_scanning_non_provider_patternsPayload? @@ -25267,7 +25273,7 @@ public enum Operations { /// - advanced_security: Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." /// - secret_scanning: Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." /// - secret_scanning_push_protection: Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." - /// - secret_scanning_non_provider_patterns: Use the `status` property to enable or disable secret scanning non-provider patterns for this repository. For more information, see "[Secret scanning supported secrets](/code-security/secret-scanning/secret-scanning-patterns#supported-secrets)." + /// - secret_scanning_non_provider_patterns: Use the `status` property to enable or disable secret scanning non-provider patterns for this repository. For more information, see "[Supported secret scanning patterns](/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." public init( advanced_security: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.advanced_securityPayload? = nil, secret_scanning: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.secret_scanningPayload? = nil, @@ -53670,6 +53676,29 @@ public enum Operations { } } } + /// Not modified + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/readme/get(repos/get-readme)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.not_modified) + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.not_modified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } /// Resource not found /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/readme/get(repos/get-readme)/responses/404`. From 426ebc75b5696b1634c99b1795b1692f5d44865b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 19 Aug 2024 21:36:57 +0000 Subject: [PATCH 09/12] Commit via running ake Sources/search --- Sources/search/Types.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index a250ef7acf4..2fb5e9d41fa 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -1737,6 +1737,8 @@ public enum Components { public var slug: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/node_id`. public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. + public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// The name of the GitHub app @@ -1867,8 +1869,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. public var installations_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. - public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. public var client_secret: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. @@ -1881,6 +1881,7 @@ public enum Components { /// - id: Unique identifier of the GitHub app /// - slug: The slug name of the GitHub app /// - node_id: + /// - client_id: /// - owner: /// - name: The name of the GitHub app /// - description: @@ -1891,7 +1892,6 @@ public enum Components { /// - permissions: The set of permissions for the GitHub app /// - events: The list of events for the GitHub app /// - installations_count: The number of installations associated with the GitHub app - /// - client_id: /// - client_secret: /// - webhook_secret: /// - pem: @@ -1899,6 +1899,7 @@ public enum Components { id: Swift.Int, slug: Swift.String? = nil, node_id: Swift.String, + client_id: Swift.String? = nil, owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, name: Swift.String, description: Swift.String? = nil, @@ -1909,7 +1910,6 @@ public enum Components { permissions: Components.Schemas.nullable_hyphen_integration.permissionsPayload, events: [Swift.String], installations_count: Swift.Int? = nil, - client_id: Swift.String? = nil, client_secret: Swift.String? = nil, webhook_secret: Swift.String? = nil, pem: Swift.String? = nil @@ -1917,6 +1917,7 @@ public enum Components { self.id = id self.slug = slug self.node_id = node_id + self.client_id = client_id self.owner = owner self.name = name self.description = description @@ -1927,7 +1928,6 @@ public enum Components { self.permissions = permissions self.events = events self.installations_count = installations_count - self.client_id = client_id self.client_secret = client_secret self.webhook_secret = webhook_secret self.pem = pem @@ -1936,6 +1936,7 @@ public enum Components { case id case slug case node_id + case client_id case owner case name case description @@ -1946,7 +1947,6 @@ public enum Components { case permissions case events case installations_count - case client_id case client_secret case webhook_secret case pem From 45d558bd7ccb8dfb259b15da1f078d3197168d53 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 19 Aug 2024 21:37:18 +0000 Subject: [PATCH 10/12] Commit via running ake Sources/secret-scanning --- Sources/secret-scanning/Client.swift | 106 ++++++++ Sources/secret-scanning/Types.swift | 370 ++++++++++++++++++++++++++- 2 files changed, 470 insertions(+), 6 deletions(-) diff --git a/Sources/secret-scanning/Client.swift b/Sources/secret-scanning/Client.swift index 82e6c56bbc2..c66162b2ebb 100644 --- a/Sources/secret-scanning/Client.swift +++ b/Sources/secret-scanning/Client.swift @@ -895,4 +895,110 @@ public struct Client: APIProtocol { } ) } + /// Create a push protection bypass + /// + /// Creates a bypass for a previously push protected secret. + /// + /// The authenticated user must be the original author of the committed secret. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/post(secret-scanning/create-push-protection-bypass)`. + public func secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass(_ input: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input) async throws -> Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output { + try await client.send( + input: input, + forOperation: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/secret-scanning/push-protection-bypasses", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + 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 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.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.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 403: + return .forbidden(.init()) + case 404: + return .notFound(.init()) + case 422: + return .unprocessableContent(.init()) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.service_unavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.service_unavailable.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } } diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index 785b23ccd5d..5c51a462605 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -79,6 +79,17 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)`. func secret_hyphen_scanning_sol_list_hyphen_locations_hyphen_for_hyphen_alert(_ input: Operations.secret_hyphen_scanning_sol_list_hyphen_locations_hyphen_for_hyphen_alert.Input) async throws -> Operations.secret_hyphen_scanning_sol_list_hyphen_locations_hyphen_for_hyphen_alert.Output + /// Create a push protection bypass + /// + /// Creates a bypass for a previously push protected secret. + /// + /// The authenticated user must be the original author of the committed secret. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/post(secret-scanning/create-push-protection-bypass)`. + func secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass(_ input: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input) async throws -> Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output } /// Convenience overloads for operation inputs. @@ -209,6 +220,27 @@ extension APIProtocol { headers: headers )) } + /// Create a push protection bypass + /// + /// Creates a bypass for a previously push protected secret. + /// + /// The authenticated user must be the original author of the committed secret. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/post(secret-scanning/create-push-protection-bypass)`. + public func secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass( + path: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input.Path, + headers: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input.Headers = .init(), + body: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input.Body + ) async throws -> Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output { + try await secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass(Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input( + path: path, + headers: headers, + body: body + )) + } } /// Server URLs defined in the OpenAPI document. @@ -986,7 +1018,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/secret_type`. public var secret_type: Swift.String? /// User-friendly name for the detected secret, matching the `secret_type`. - /// For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)." + /// For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." /// /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/secret_type_display_name`. public var secret_type_display_name: Swift.String? @@ -1142,7 +1174,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/secret_type`. public var secret_type: Swift.String? /// User-friendly name for the detected secret, matching the `secret_type`. - /// For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)." + /// For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." /// /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/secret_type_display_name`. public var secret_type_display_name: Swift.String? @@ -1824,6 +1856,51 @@ public enum Components { case details } } + /// The reason for bypassing push protection. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-push-protection-bypass-reason`. + @frozen public enum secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_reason: String, Codable, Hashable, Sendable { + case false_positive = "false_positive" + case used_in_tests = "used_in_tests" + case will_fix_later = "will_fix_later" + } + /// The ID of the push protection bypass placeholder. This value is returned on any push protected routes. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-push-protection-bypass-placeholder-id`. + public typealias secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_placeholder_hyphen_id = Swift.String + /// - Remark: Generated from `#/components/schemas/secret-scanning-push-protection-bypass`. + public struct secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/secret-scanning-push-protection-bypass/reason`. + public var reason: Components.Schemas.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_reason? + /// The time that the bypass will expire in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-push-protection-bypass/expire_at`. + public var expire_at: Foundation.Date? + /// The token type this bypass is for. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-push-protection-bypass/token_type`. + public var token_type: Swift.String? + /// Creates a new `secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass`. + /// + /// - Parameters: + /// - reason: + /// - expire_at: The time that the bypass will expire in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - token_type: The token type this bypass is for. + public init( + reason: Components.Schemas.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_reason? = nil, + expire_at: Foundation.Date? = nil, + token_type: Swift.String? = nil + ) { + self.reason = reason + self.expire_at = expire_at + self.token_type = token_type + } + public enum CodingKeys: String, CodingKey { + case reason + case expire_at + case token_type + } + } } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { @@ -1862,7 +1939,7 @@ public enum Components { case resolved = "resolved" } /// A comma-separated list of secret types to return. By default all secret types are returned. - /// See "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)" + /// See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" /// for a complete list of secret types. /// /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-secret-type`. @@ -2052,7 +2129,7 @@ public enum Operations { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/state`. public var state: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_state? /// A comma-separated list of secret types to return. By default all secret types are returned. - /// See "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)" + /// See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" /// for a complete list of secret types. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/secret_type`. @@ -2346,7 +2423,7 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/state`. public var state: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_state? /// A comma-separated list of secret types to return. By default all secret types are returned. - /// See "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)" + /// See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" /// for a complete list of secret types. /// /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/secret_type`. @@ -2656,7 +2733,7 @@ public enum Operations { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/state`. public var state: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_state? /// A comma-separated list of secret types to return. By default all secret types are returned. - /// See "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)" + /// See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" /// for a complete list of secret types. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/secret_type`. @@ -3669,4 +3746,285 @@ public enum Operations { } } } + /// Create a push protection bypass + /// + /// Creates a bypass for a previously push protected secret. + /// + /// The authenticated user must be the original author of the committed secret. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/post(secret-scanning/create-push-protection-bypass)`. + public enum secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass { + public static let id: Swift.String = "secret-scanning/create-push-protection-bypass" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/POST/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}/secret-scanning/push-protection-bypasses/POST/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}/secret-scanning/push-protection-bypasses/POST/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.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/POST/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.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/POST/requestBody/json/reason`. + public var reason: Components.Schemas.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_reason + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/POST/requestBody/json/placeholder_id`. + public var placeholder_id: Components.Schemas.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_placeholder_hyphen_id + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - reason: + /// - placeholder_id: + public init( + reason: Components.Schemas.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_reason, + placeholder_id: Components.Schemas.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_placeholder_hyphen_id + ) { + self.reason = reason + self.placeholder_id = placeholder_id + } + public enum CodingKeys: String, CodingKey { + case reason + case placeholder_id + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/POST/requestBody/content/application\/json`. + case json(Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input.Body.jsonPayload) + } + public var body: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input.Path, + headers: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input.Headers = .init(), + body: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/POST/responses/200/content/application\/json`. + case json(Components.Schemas.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass) + /// 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.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/post(secret-scanning/create-push-protection-bypass)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.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.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// Creates a new `Forbidden`. + public init() {} + } + /// User does not have enough permissions to perform this action. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/post(secret-scanning/create-push-protection-bypass)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Placeholder ID not found, or push protection is disabled on this repository. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/post(secret-scanning/create-push-protection-bypass)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output.NotFound) + /// 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.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Bad request, input data missing or incorrect. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/post(secret-scanning/create-push-protection-bypass)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output.UnprocessableContent) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/post(secret-scanning/create-push-protection-bypass)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.service_unavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.service_unavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + 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 + ] + } + } + } } From a8af028aff9682204a66049f04e0b86c62ba1553 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 19 Aug 2024 21:38:42 +0000 Subject: [PATCH 11/12] Commit via running ake Sources/copilot --- Sources/copilot/Client.swift | 197 ++++++++++++++++++++ Sources/copilot/Types.swift | 346 +++++++++++++++++++++++++++++++++++ 2 files changed, 543 insertions(+) diff --git a/Sources/copilot/Client.swift b/Sources/copilot/Client.swift index 6b39c8a604a..601629eab90 100644 --- a/Sources/copilot/Client.swift +++ b/Sources/copilot/Client.swift @@ -2015,4 +2015,201 @@ public struct Client: APIProtocol { } ) } + /// Get a summary of Copilot usage for a team + /// + /// > [!NOTE] + /// > This endpoint is in beta and is subject to change. + /// + /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE + /// for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. + /// See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the team had five or more members with active Copilot licenses, as evaluated at the end of that day. + /// + /// Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/team/{team_slug}/copilot/usage`. + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)`. + public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Output { + try await client.send( + input: input, + forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/team/{}/copilot/usage", + parameters: [ + input.path.org, + input.path.team_slug + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "until", + value: input.query.until + ) + 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.per_page + ) + 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.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.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.copilot_hyphen_usage_hyphen_metrics].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.internal_error.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.requires_authentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } } diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index 5700c10b2b9..1b9fd1199b9 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -215,6 +215,29 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/members/{username}/copilot`. /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/copilot/get(copilot/get-copilot-seat-details-for-user)`. func copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user(_ input: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Input) async throws -> Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Output + /// Get a summary of Copilot usage for a team + /// + /// > [!NOTE] + /// > This endpoint is in beta and is subject to change. + /// + /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE + /// for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. + /// See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the team had five or more members with active Copilot licenses, as evaluated at the end of that day. + /// + /// Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/team/{team_slug}/copilot/usage`. + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)`. + func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Output } /// Convenience overloads for operation inputs. @@ -529,6 +552,39 @@ extension APIProtocol { headers: headers )) } + /// Get a summary of Copilot usage for a team + /// + /// > [!NOTE] + /// > This endpoint is in beta and is subject to change. + /// + /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE + /// for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. + /// See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the team had five or more members with active Copilot licenses, as evaluated at the end of that day. + /// + /// Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/team/{team_slug}/copilot/usage`. + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)`. + public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team( + path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Path, + query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Query = .init(), + headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Headers = .init() + ) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Output { + try await copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team(Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input( + path: path, + query: query, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -5223,4 +5279,294 @@ public enum Operations { } } } + /// Get a summary of Copilot usage for a team + /// + /// > [!NOTE] + /// > This endpoint is in beta and is subject to change. + /// + /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE + /// for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. + /// See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the team had five or more members with active Copilot licenses, as evaluated at the end of that day. + /// + /// Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/team/{team_slug}/copilot/usage`. + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)`. + public enum copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team { + public static let id: Swift.String = "copilot/usage-metrics-for-team" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/usage/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/usage/GET/path/org`. + public var org: Components.Parameters.org + /// The slug of the team name. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/usage/GET/path/team_slug`. + public var team_slug: Components.Parameters.team_hyphen_slug + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - team_slug: The slug of the team name. + public init( + org: Components.Parameters.org, + team_slug: Components.Parameters.team_hyphen_slug + ) { + self.org = org + self.team_slug = team_slug + } + } + public var path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/usage/GET/query`. + public struct Query: Sendable, Hashable { + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/usage/GET/query/since`. + public var since: Swift.String? + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/usage/GET/query/until`. + public var until: Swift.String? + /// 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}/team/{team_slug}/copilot/usage/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of days of metrics to display per page (max 28). 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}/team/{team_slug}/copilot/usage/GET/query/per_page`. + public var per_page: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - since: Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// - until: Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + /// - 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)." + /// - per_page: The number of days of metrics to display per page (max 28). 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( + since: Swift.String? = nil, + until: Swift.String? = nil, + page: Components.Parameters.page? = nil, + per_page: Swift.Int? = nil + ) { + self.since = since + self.until = until + self.page = page + self.per_page = per_page + } + } + public var query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/usage/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.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Path, + query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Query = .init(), + headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.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}/team/{team_slug}/copilot/usage/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/usage/GET/responses/200/content/application\/json`. + case json([Components.Schemas.copilot_hyphen_usage_hyphen_metrics]) + /// 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.copilot_hyphen_usage_hyphen_metrics] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.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.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.internal_error) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.internal_error { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.requires_authentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.requires_authentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + 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 + ] + } + } + } } From b8336f8f41457f7dce837db4e431db6f6bb7e4e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 19 Aug 2024 21:40:47 +0000 Subject: [PATCH 12/12] Commit via running ake Sources/code-security --- Sources/code-security/Client.swift | 117 ++++++++ Sources/code-security/Types.swift | 464 +++++++++++++++++++++++++++++ 2 files changed, 581 insertions(+) diff --git a/Sources/code-security/Client.swift b/Sources/code-security/Client.swift index c7c472015bd..a6275de7d16 100644 --- a/Sources/code-security/Client.swift +++ b/Sources/code-security/Client.swift @@ -1212,4 +1212,121 @@ public struct Client: APIProtocol { } ) } + /// Get the code security configuration associated with a repository + /// + /// Get the code security configuration that manages a repository's code security settings. + /// + /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-security-configuration`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-security-configuration/get(code-security/get-configuration-for-repository)`. + public func code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository(_ input: Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/code-security-configuration", + 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.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.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.code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 204: + return .noContent(.init()) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } } diff --git a/Sources/code-security/Types.swift b/Sources/code-security/Types.swift index d013b4aa624..76d78c0936f 100644 --- a/Sources/code-security/Types.swift +++ b/Sources/code-security/Types.swift @@ -128,6 +128,17 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-configuration)`. func code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Output + /// Get the code security configuration associated with a repository + /// + /// Get the code security configuration that manages a repository's code security settings. + /// + /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-security-configuration`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-security-configuration/get(code-security/get-configuration-for-repository)`. + func code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository(_ input: Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Output } /// Convenience overloads for operation inputs. @@ -343,6 +354,25 @@ extension APIProtocol { headers: headers )) } + /// Get the code security configuration associated with a repository + /// + /// Get the code security configuration that manages a repository's code security settings. + /// + /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-security-configuration`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-security-configuration/get(code-security/get-configuration-for-repository)`. + public func code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository( + path: Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Input.Path, + headers: Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Output { + try await code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository(Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Input( + path: path, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -1013,6 +1043,41 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph`. public var dependency_graph: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graphPayload? + /// The enablement status of Automatic dependency submission + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action`. + @frozen public enum dependency_graph_autosubmit_actionPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Automatic dependency submission + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action`. + public var dependency_graph_autosubmit_action: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graph_autosubmit_actionPayload? + /// Feature options for Automatic dependency submission + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action_options`. + public struct dependency_graph_autosubmit_action_optionsPayload: Codable, Hashable, Sendable { + /// Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action_options/labeled_runners`. + public var labeled_runners: Swift.Bool? + /// Creates a new `dependency_graph_autosubmit_action_optionsPayload`. + /// + /// - Parameters: + /// - labeled_runners: Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + public init(labeled_runners: Swift.Bool? = nil) { + self.labeled_runners = labeled_runners + } + public enum CodingKeys: String, CodingKey { + case labeled_runners + } + } + /// Feature options for Automatic dependency submission + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action_options`. + public var dependency_graph_autosubmit_action_options: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graph_autosubmit_action_optionsPayload? /// The enablement status of Dependabot alerts /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_alerts`. @@ -1129,6 +1194,8 @@ public enum Components { /// - description: A description of the code security configuration /// - advanced_security: The enablement status of GitHub Advanced Security /// - dependency_graph: The enablement status of Dependency Graph + /// - dependency_graph_autosubmit_action: The enablement status of Automatic dependency submission + /// - dependency_graph_autosubmit_action_options: Feature options for Automatic dependency submission /// - dependabot_alerts: The enablement status of Dependabot alerts /// - dependabot_security_updates: The enablement status of Dependabot security updates /// - code_scanning_default_setup: The enablement status of code scanning default setup @@ -1148,6 +1215,8 @@ public enum Components { description: Swift.String? = nil, advanced_security: Components.Schemas.code_hyphen_security_hyphen_configuration.advanced_securityPayload? = nil, dependency_graph: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graphPayload? = nil, + dependency_graph_autosubmit_action: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graph_autosubmit_actionPayload? = nil, + dependency_graph_autosubmit_action_options: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graph_autosubmit_action_optionsPayload? = nil, dependabot_alerts: Components.Schemas.code_hyphen_security_hyphen_configuration.dependabot_alertsPayload? = nil, dependabot_security_updates: Components.Schemas.code_hyphen_security_hyphen_configuration.dependabot_security_updatesPayload? = nil, code_scanning_default_setup: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setupPayload? = nil, @@ -1167,6 +1236,8 @@ public enum Components { self.description = description self.advanced_security = advanced_security self.dependency_graph = dependency_graph + self.dependency_graph_autosubmit_action = dependency_graph_autosubmit_action + self.dependency_graph_autosubmit_action_options = dependency_graph_autosubmit_action_options self.dependabot_alerts = dependabot_alerts self.dependabot_security_updates = dependabot_security_updates self.code_scanning_default_setup = code_scanning_default_setup @@ -1187,6 +1258,8 @@ public enum Components { case description case advanced_security case dependency_graph + case dependency_graph_autosubmit_action + case dependency_graph_autosubmit_action_options case dependabot_alerts case dependabot_security_updates case code_scanning_default_setup @@ -1270,6 +1343,46 @@ public enum Components { case repository } } + /// Code security configuration associated with a repository and attachment status + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration-for-repository`. + public struct code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository: Codable, Hashable, Sendable { + /// The attachment status of the code security configuration on the repository. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration-for-repository/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case attached = "attached" + case attaching = "attaching" + case detached = "detached" + case removed = "removed" + case enforced = "enforced" + case failed = "failed" + case updating = "updating" + case removed_by_enterprise = "removed_by_enterprise" + } + /// The attachment status of the code security configuration on the repository. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration-for-repository/status`. + public var status: Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository.statusPayload? + /// - Remark: Generated from `#/components/schemas/code-security-configuration-for-repository/configuration`. + public var configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? + /// Creates a new `code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository`. + /// + /// - Parameters: + /// - status: The attachment status of the code security configuration on the repository. + /// - configuration: + public init( + status: Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository.statusPayload? = nil, + configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? = nil + ) { + self.status = status + self.configuration = configuration + } + public enum CodingKeys: String, CodingKey { + case status + case configuration + } + } } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { @@ -1281,6 +1394,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/pagination-after`. public typealias pagination_hyphen_after = Swift.String + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/owner`. + public typealias owner = Swift.String + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/repo`. + public typealias repo = Swift.String /// The organization name. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/org`. @@ -1776,6 +1897,41 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependency_graph`. public var dependency_graph: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependency_graphPayload? + /// The enablement status of Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependency_graph_autosubmit_action`. + @frozen public enum dependency_graph_autosubmit_actionPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependency_graph_autosubmit_action`. + public var dependency_graph_autosubmit_action: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_actionPayload? + /// Feature options for Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependency_graph_autosubmit_action_options`. + public struct dependency_graph_autosubmit_action_optionsPayload: Codable, Hashable, Sendable { + /// Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependency_graph_autosubmit_action_options/labeled_runners`. + public var labeled_runners: Swift.Bool? + /// Creates a new `dependency_graph_autosubmit_action_optionsPayload`. + /// + /// - Parameters: + /// - labeled_runners: Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + public init(labeled_runners: Swift.Bool? = nil) { + self.labeled_runners = labeled_runners + } + public enum CodingKeys: String, CodingKey { + case labeled_runners + } + } + /// Feature options for Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependency_graph_autosubmit_action_options`. + public var dependency_graph_autosubmit_action_options: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_action_optionsPayload? /// The enablement status of Dependabot alerts /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependabot_alerts`. @@ -1878,6 +2034,8 @@ public enum Operations { /// - description: A description of the code security configuration /// - advanced_security: The enablement status of GitHub Advanced Security /// - dependency_graph: The enablement status of Dependency Graph + /// - dependency_graph_autosubmit_action: The enablement status of Automatic dependency submission + /// - dependency_graph_autosubmit_action_options: Feature options for Automatic dependency submission /// - dependabot_alerts: The enablement status of Dependabot alerts /// - dependabot_security_updates: The enablement status of Dependabot security updates /// - code_scanning_default_setup: The enablement status of code scanning default setup @@ -1891,6 +2049,8 @@ public enum Operations { description: Swift.String, advanced_security: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.advanced_securityPayload? = nil, dependency_graph: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependency_graphPayload? = nil, + dependency_graph_autosubmit_action: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_actionPayload? = nil, + dependency_graph_autosubmit_action_options: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_action_optionsPayload? = nil, dependabot_alerts: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependabot_alertsPayload? = nil, dependabot_security_updates: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependabot_security_updatesPayload? = nil, code_scanning_default_setup: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload? = nil, @@ -1904,6 +2064,8 @@ public enum Operations { self.description = description self.advanced_security = advanced_security self.dependency_graph = dependency_graph + self.dependency_graph_autosubmit_action = dependency_graph_autosubmit_action + self.dependency_graph_autosubmit_action_options = dependency_graph_autosubmit_action_options self.dependabot_alerts = dependabot_alerts self.dependabot_security_updates = dependabot_security_updates self.code_scanning_default_setup = code_scanning_default_setup @@ -1918,6 +2080,8 @@ public enum Operations { case description case advanced_security case dependency_graph + case dependency_graph_autosubmit_action + case dependency_graph_autosubmit_action_options case dependabot_alerts case dependabot_security_updates case code_scanning_default_setup @@ -1945,6 +2109,14 @@ public enum Operations { Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependency_graphPayload.self, forKey: .dependency_graph ) + dependency_graph_autosubmit_action = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_actionPayload.self, + forKey: .dependency_graph_autosubmit_action + ) + dependency_graph_autosubmit_action_options = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_action_optionsPayload.self, + forKey: .dependency_graph_autosubmit_action_options + ) dependabot_alerts = try container.decodeIfPresent( Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependabot_alertsPayload.self, forKey: .dependabot_alerts @@ -1982,6 +2154,8 @@ public enum Operations { "description", "advanced_security", "dependency_graph", + "dependency_graph_autosubmit_action", + "dependency_graph_autosubmit_action_options", "dependabot_alerts", "dependabot_security_updates", "code_scanning_default_setup", @@ -2842,6 +3016,41 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph`. public var dependency_graph: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependency_graphPayload? + /// The enablement status of Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph_autosubmit_action`. + @frozen public enum dependency_graph_autosubmit_actionPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph_autosubmit_action`. + public var dependency_graph_autosubmit_action: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_actionPayload? + /// Feature options for Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph_autosubmit_action_options`. + public struct dependency_graph_autosubmit_action_optionsPayload: Codable, Hashable, Sendable { + /// Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph_autosubmit_action_options/labeled_runners`. + public var labeled_runners: Swift.Bool? + /// Creates a new `dependency_graph_autosubmit_action_optionsPayload`. + /// + /// - Parameters: + /// - labeled_runners: Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + public init(labeled_runners: Swift.Bool? = nil) { + self.labeled_runners = labeled_runners + } + public enum CodingKeys: String, CodingKey { + case labeled_runners + } + } + /// Feature options for Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph_autosubmit_action_options`. + public var dependency_graph_autosubmit_action_options: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_action_optionsPayload? /// The enablement status of Dependabot alerts /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependabot_alerts`. @@ -2944,6 +3153,8 @@ public enum Operations { /// - description: A description of the code security configuration /// - advanced_security: The enablement status of GitHub Advanced Security /// - dependency_graph: The enablement status of Dependency Graph + /// - dependency_graph_autosubmit_action: The enablement status of Automatic dependency submission + /// - dependency_graph_autosubmit_action_options: Feature options for Automatic dependency submission /// - dependabot_alerts: The enablement status of Dependabot alerts /// - dependabot_security_updates: The enablement status of Dependabot security updates /// - code_scanning_default_setup: The enablement status of code scanning default setup @@ -2957,6 +3168,8 @@ public enum Operations { description: Swift.String? = nil, advanced_security: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.advanced_securityPayload? = nil, dependency_graph: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependency_graphPayload? = nil, + dependency_graph_autosubmit_action: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_actionPayload? = nil, + dependency_graph_autosubmit_action_options: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_action_optionsPayload? = nil, dependabot_alerts: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependabot_alertsPayload? = nil, dependabot_security_updates: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependabot_security_updatesPayload? = nil, code_scanning_default_setup: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload? = nil, @@ -2970,6 +3183,8 @@ public enum Operations { self.description = description self.advanced_security = advanced_security self.dependency_graph = dependency_graph + self.dependency_graph_autosubmit_action = dependency_graph_autosubmit_action + self.dependency_graph_autosubmit_action_options = dependency_graph_autosubmit_action_options self.dependabot_alerts = dependabot_alerts self.dependabot_security_updates = dependabot_security_updates self.code_scanning_default_setup = code_scanning_default_setup @@ -2984,6 +3199,8 @@ public enum Operations { case description case advanced_security case dependency_graph + case dependency_graph_autosubmit_action + case dependency_graph_autosubmit_action_options case dependabot_alerts case dependabot_security_updates case code_scanning_default_setup @@ -3011,6 +3228,14 @@ public enum Operations { Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependency_graphPayload.self, forKey: .dependency_graph ) + dependency_graph_autosubmit_action = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_actionPayload.self, + forKey: .dependency_graph_autosubmit_action + ) + dependency_graph_autosubmit_action_options = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_action_optionsPayload.self, + forKey: .dependency_graph_autosubmit_action_options + ) dependabot_alerts = try container.decodeIfPresent( Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependabot_alertsPayload.self, forKey: .dependabot_alerts @@ -3048,6 +3273,8 @@ public enum Operations { "description", "advanced_security", "dependency_graph", + "dependency_graph_autosubmit_action", + "dependency_graph_autosubmit_action_options", "dependabot_alerts", "dependabot_security_updates", "code_scanning_default_setup", @@ -4081,4 +4308,241 @@ public enum Operations { } } } + /// Get the code security configuration associated with a repository + /// + /// Get the code security configuration that manages a repository's code security settings. + /// + /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-security-configuration`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-security-configuration/get(code-security/get-configuration-for-repository)`. + public enum code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository { + public static let id: Swift.String = "code-security/get-configuration-for-repository" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-security-configuration/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}/code-security-configuration/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}/code-security-configuration/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.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-security-configuration/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.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Input.Path, + headers: Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.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}/code-security-configuration/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-security-configuration/GET/responses/200/content/application\/json`. + case json(Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository) + /// 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.code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-security-configuration/get(code-security/get-configuration-for-repository)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.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.code_hyphen_security_sol_get_hyphen_configuration_hyphen_for_hyphen_repository.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-security-configuration/get(code-security/get-configuration-for-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.no_content) + /// 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.no_content { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-security-configuration/get(code-security/get-configuration-for-repository)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.not_modified) + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.not_modified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-security-configuration/get(code-security/get-configuration-for-repository)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-security-configuration/get(code-security/get-configuration-for-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + 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 + ] + } + } + } }