diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index be94db61de4..5e81f4a0d05 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -4956,6 +4956,251 @@ public enum Components { case html_url } } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var node_id: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// + /// - Parameters: + /// - id: Unique identifier of the team + /// - node_id: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + public init( + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil + ) { + self.id = id + self.node_id = node_id + self.url = url + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case url + case members_url + case name + case description + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `permissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. + /// + /// - Parameters: + /// - id: + /// - node_id: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: + /// - html_url: + /// - members_url: + /// - repositories_url: + /// - parent: + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case slug + case description + case privacy + case notification_setting + case permission + case permissions + case url + case html_url + case members_url + case repositories_url + case parent + } + } /// GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. /// /// - Remark: Generated from `#/components/schemas/nullable-integration`. @@ -6551,251 +6796,6 @@ public enum Components { case selected_repositories_url } } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var node_id: Swift.String - /// URL for the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. - public var name: Swift.String - /// Description of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. - public var description: Swift.String? - /// Permission that the team will have for its repositories - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. - /// - /// - Parameters: - /// - id: Unique identifier of the team - /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set - /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment - public init( - id: Swift.Int, - node_id: Swift.String, - url: Swift.String, - members_url: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil - ) { - self.id = id - self.node_id = node_id - self.url = url - self.members_url = members_url - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting - self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case url - case members_url - case name - case description - case permission - case privacy - case notification_setting - case html_url - case repositories_url - case slug - case ldap_dn - } - } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. - /// - /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin - } - public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin - } - } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil - ) { - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent - } - } /// An artifact /// /// - Remark: Generated from `#/components/schemas/artifact`. diff --git a/Sources/code-security/Client.swift b/Sources/code-security/Client.swift index 87202523ac7..03d06cab2f8 100644 --- a/Sources/code-security/Client.swift +++ b/Sources/code-security/Client.swift @@ -38,4 +38,1023 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// Get code security configurations for an organization + /// + /// Lists all code security configurations available in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)`. + public func code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org(_ input: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/code-security/configurations", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "target_type", + value: input.query.target_type + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + 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_configurations_hyphen_for_hyphen_org.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].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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 + ) + ) + } + } + ) + } + /// Create a code security configuration + /// + /// Creates a code security configuration in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/code-security/configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/post(code-security/create-configuration)`. + public func code_hyphen_security_sol_create_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_create_hyphen_configuration.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_create_hyphen_configuration.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/code-security/configurations", + parameters: [ + input.path.org + ] + ) + 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 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.code_hyphen_security_sol_create_hyphen_configuration.Output.Created.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.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get default code security configurations + /// + /// Lists the default code security configurations for an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/defaults`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)`. + public func code_hyphen_security_sol_get_hyphen_default_hyphen_configurations(_ input: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/code-security/configurations/defaults", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.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_default_hyphen_configurations.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + 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 + ) + ) + } + } + ) + } + /// Get a code security configuration + /// + /// Gets a code security configuration available in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/get(code-security/get-configuration)`. + public func code_hyphen_security_sol_get_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_get_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_configuration.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_get_hyphen_configuration.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/code-security/configurations/{}", + parameters: [ + input.path.org, + input.path.configuration_id + ] + ) + 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.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.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + 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 + ) + ) + } + } + ) + } + /// Update a code security configuration + /// + /// Updates a code security configuration in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/patch(code-security/update-configuration)`. + public func code_hyphen_security_sol_update_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_update_hyphen_configuration.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_update_hyphen_configuration.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/code-security/configurations/{}", + parameters: [ + input.path.org, + input.path.configuration_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + 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.code_hyphen_security_sol_update_hyphen_configuration.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.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()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a code security configuration + /// + /// Deletes the desired code security configuration from an organization. + /// Repositories attached to the configuration will retain their settings but will no longer be associated with + /// the configuration. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration)`. + public func code_hyphen_security_sol_delete_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_delete_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_delete_hyphen_configuration.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_delete_hyphen_configuration.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/code-security/configurations/{}", + parameters: [ + input.path.org, + input.path.configuration_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.bad_request.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.scim_hyphen_error.self, + from: responseBody, + transforming: { value in + .application_scim_plus_json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.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)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Attach a configuration to repositories + /// + /// Attach a code security configuration to a set of repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration. + /// + /// If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/code-security/configurations/{configuration_id}/attach`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-configuration)`. + public func code_hyphen_security_sol_attach_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_attach_hyphen_configuration.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_attach_hyphen_configuration.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/code-security/configurations/{}/attach", + parameters: [ + input.path.org, + input.path.configuration_id + ] + ) + 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 202: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.accepted.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + OpenAPIRuntime.OpenAPIObjectContainer.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .accepted(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set a code security configuration as a default for an organization + /// + /// Sets a code security configuration as a default to be applied to new repositories in your organization. + /// + /// This configuration will be applied to the matching repository type (all, none, public, private and internal) by default when they are created. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default)`. + public func code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default(_ input: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input) async throws -> Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/code-security/configurations/{}/defaults", + parameters: [ + input.path.org, + input.path.configuration_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + 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.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Output.Ok.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + 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 + ) + ) + } + } + ) + } + /// Get repositories associated with a code security configuration + /// + /// Lists the repositories associated with a code security configuration in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - 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)`. + public 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 { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/code-security/configurations/{}/repositories", + parameters: [ + input.path.org, + input.path.configuration_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "status", + value: input.query.status + ) + 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_repositories_hyphen_for_hyphen_configuration.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_repositories].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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/code-security/Types.swift b/Sources/code-security/Types.swift index 2a210decbff..5653045534b 100644 --- a/Sources/code-security/Types.swift +++ b/Sources/code-security/Types.swift @@ -10,10 +10,305 @@ import struct Foundation.Data import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. -public protocol APIProtocol: Sendable {} +public protocol APIProtocol: Sendable { + /// Get code security configurations for an organization + /// + /// Lists all code security configurations available in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)`. + func code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org(_ input: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Output + /// Create a code security configuration + /// + /// Creates a code security configuration in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/code-security/configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/post(code-security/create-configuration)`. + func code_hyphen_security_sol_create_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_create_hyphen_configuration.Output + /// Get default code security configurations + /// + /// Lists the default code security configurations for an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/defaults`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)`. + func code_hyphen_security_sol_get_hyphen_default_hyphen_configurations(_ input: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Output + /// Get a code security configuration + /// + /// Gets a code security configuration available in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/get(code-security/get-configuration)`. + func code_hyphen_security_sol_get_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_get_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_configuration.Output + /// Update a code security configuration + /// + /// Updates a code security configuration in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/patch(code-security/update-configuration)`. + func code_hyphen_security_sol_update_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_update_hyphen_configuration.Output + /// Delete a code security configuration + /// + /// Deletes the desired code security configuration from an organization. + /// Repositories attached to the configuration will retain their settings but will no longer be associated with + /// the configuration. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration)`. + func code_hyphen_security_sol_delete_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_delete_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_delete_hyphen_configuration.Output + /// Attach a configuration to repositories + /// + /// Attach a code security configuration to a set of repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration. + /// + /// If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/code-security/configurations/{configuration_id}/attach`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-configuration)`. + func code_hyphen_security_sol_attach_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_attach_hyphen_configuration.Output + /// Set a code security configuration as a default for an organization + /// + /// Sets a code security configuration as a default to be applied to new repositories in your organization. + /// + /// This configuration will be applied to the matching repository type (all, none, public, private and internal) by default when they are created. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default)`. + func code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default(_ input: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input) async throws -> Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Output + /// Get repositories associated with a code security configuration + /// + /// Lists the repositories associated with a code security configuration in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - 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 +} /// Convenience overloads for operation inputs. extension APIProtocol { + /// Get code security configurations for an organization + /// + /// Lists all code security configurations available in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)`. + public func code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org( + path: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Input.Path, + query: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Output { + try await code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org(Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a code security configuration + /// + /// Creates a code security configuration in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/code-security/configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/post(code-security/create-configuration)`. + public func code_hyphen_security_sol_create_hyphen_configuration( + path: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body + ) async throws -> Operations.code_hyphen_security_sol_create_hyphen_configuration.Output { + try await code_hyphen_security_sol_create_hyphen_configuration(Operations.code_hyphen_security_sol_create_hyphen_configuration.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get default code security configurations + /// + /// Lists the default code security configurations for an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/defaults`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)`. + public func code_hyphen_security_sol_get_hyphen_default_hyphen_configurations( + path: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Input.Path, + headers: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Output { + try await code_hyphen_security_sol_get_hyphen_default_hyphen_configurations(Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Input( + path: path, + headers: headers + )) + } + /// Get a code security configuration + /// + /// Gets a code security configuration available in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/get(code-security/get-configuration)`. + public func code_hyphen_security_sol_get_hyphen_configuration( + path: Operations.code_hyphen_security_sol_get_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_get_hyphen_configuration.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_security_sol_get_hyphen_configuration.Output { + try await code_hyphen_security_sol_get_hyphen_configuration(Operations.code_hyphen_security_sol_get_hyphen_configuration.Input( + path: path, + headers: headers + )) + } + /// Update a code security configuration + /// + /// Updates a code security configuration in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/patch(code-security/update-configuration)`. + public func code_hyphen_security_sol_update_hyphen_configuration( + path: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body + ) async throws -> Operations.code_hyphen_security_sol_update_hyphen_configuration.Output { + try await code_hyphen_security_sol_update_hyphen_configuration(Operations.code_hyphen_security_sol_update_hyphen_configuration.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a code security configuration + /// + /// Deletes the desired code security configuration from an organization. + /// Repositories attached to the configuration will retain their settings but will no longer be associated with + /// the configuration. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration)`. + public func code_hyphen_security_sol_delete_hyphen_configuration( + path: Operations.code_hyphen_security_sol_delete_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_delete_hyphen_configuration.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_security_sol_delete_hyphen_configuration.Output { + try await code_hyphen_security_sol_delete_hyphen_configuration(Operations.code_hyphen_security_sol_delete_hyphen_configuration.Input( + path: path, + headers: headers + )) + } + /// Attach a configuration to repositories + /// + /// Attach a code security configuration to a set of repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration. + /// + /// If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/code-security/configurations/{configuration_id}/attach`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-configuration)`. + public func code_hyphen_security_sol_attach_hyphen_configuration( + path: Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input.Body + ) async throws -> Operations.code_hyphen_security_sol_attach_hyphen_configuration.Output { + try await code_hyphen_security_sol_attach_hyphen_configuration(Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input( + path: path, + headers: headers, + body: body + )) + } + /// Set a code security configuration as a default for an organization + /// + /// Sets a code security configuration as a default to be applied to new repositories in your organization. + /// + /// This configuration will be applied to the matching repository type (all, none, public, private and internal) by default when they are created. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default)`. + public func code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default( + path: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input.Path, + headers: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input.Body + ) async throws -> Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Output { + try await code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default(Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get repositories associated with a code security configuration + /// + /// Lists the repositories associated with a code security configuration in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - 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)`. + public func code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration( + path: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Input.Path, + query: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Input.Query = .init(), + headers: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Output { + try await code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration(Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Input( + path: path, + query: query, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -29,16 +324,3370 @@ public enum Servers { /// Types generated from the components section of the OpenAPI document. public enum Components { /// Types generated from the `#/components/schemas` section of the OpenAPI document. - public enum Schemas {} + public enum Schemas { + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/simple-user`. + public struct simple_hyphen_user: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/simple-user/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gravatar_id`. + public var gravatar_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/followers_url`. + public var followers_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/following_url`. + public var following_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gists_url`. + public var gists_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/starred_url`. + public var starred_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/subscriptions_url`. + public var subscriptions_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/organizations_url`. + public var organizations_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/received_events_url`. + public var received_events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/site_admin`. + public var site_admin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. + public var starred_at: Swift.String? + /// Creates a new `simple_hyphen_user`. + /// + /// - Parameters: + /// - name: + /// - email: + /// - login: + /// - id: + /// - node_id: + /// - avatar_url: + /// - gravatar_id: + /// - url: + /// - html_url: + /// - followers_url: + /// - following_url: + /// - gists_url: + /// - starred_url: + /// - subscriptions_url: + /// - organizations_url: + /// - repos_url: + /// - events_url: + /// - received_events_url: + /// - _type: + /// - site_admin: + /// - starred_at: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int, + node_id: Swift.String, + avatar_url: Swift.String, + gravatar_id: Swift.String? = nil, + url: Swift.String, + html_url: Swift.String, + followers_url: Swift.String, + following_url: Swift.String, + gists_url: Swift.String, + starred_url: Swift.String, + subscriptions_url: Swift.String, + organizations_url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + received_events_url: Swift.String, + _type: Swift.String, + site_admin: Swift.Bool, + starred_at: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.node_id = node_id + self.avatar_url = avatar_url + self.gravatar_id = gravatar_id + self.url = url + self.html_url = html_url + self.followers_url = followers_url + self.following_url = following_url + self.gists_url = gists_url + self.starred_url = starred_url + self.subscriptions_url = subscriptions_url + self.organizations_url = organizations_url + self.repos_url = repos_url + self.events_url = events_url + self.received_events_url = received_events_url + self._type = _type + self.site_admin = site_admin + self.starred_at = starred_at + } + public enum CodingKeys: String, CodingKey { + case name + case email + case login + case id + case node_id + case avatar_url + case gravatar_id + case url + case html_url + case followers_url + case following_url + case gists_url + case starred_url + case subscriptions_url + case organizations_url + case repos_url + case events_url + case received_events_url + case _type = "type" + case site_admin + case starred_at + } + } + /// Basic Error + /// + /// - Remark: Generated from `#/components/schemas/basic-error`. + public struct basic_hyphen_error: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/basic-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/documentation_url`. + public var documentation_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/status`. + public var status: Swift.String? + /// Creates a new `basic_hyphen_error`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + /// - url: + /// - status: + public init( + message: Swift.String? = nil, + documentation_url: Swift.String? = nil, + url: Swift.String? = nil, + status: Swift.String? = nil + ) { + self.message = message + self.documentation_url = documentation_url + self.url = url + self.status = status + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + case url + case status + } + } + /// Scim Error + /// + /// - Remark: Generated from `#/components/schemas/scim-error`. + public struct scim_hyphen_error: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/scim-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/scim-error/documentation_url`. + public var documentation_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/scim-error/detail`. + public var detail: Swift.String? + /// - Remark: Generated from `#/components/schemas/scim-error/status`. + public var status: Swift.Int? + /// - Remark: Generated from `#/components/schemas/scim-error/scimType`. + public var scimType: Swift.String? + /// - Remark: Generated from `#/components/schemas/scim-error/schemas`. + public var schemas: [Swift.String]? + /// Creates a new `scim_hyphen_error`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + /// - detail: + /// - status: + /// - scimType: + /// - schemas: + public init( + message: Swift.String? = nil, + documentation_url: Swift.String? = nil, + detail: Swift.String? = nil, + status: Swift.Int? = nil, + scimType: Swift.String? = nil, + schemas: [Swift.String]? = nil + ) { + self.message = message + self.documentation_url = documentation_url + self.detail = detail + self.status = status + self.scimType = scimType + self.schemas = schemas + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + case detail + case status + case scimType + case schemas + } + } + /// A GitHub repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository`. + public struct simple_hyphen_repository: Codable, Hashable, Sendable { + /// A unique identifier of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/id`. + public var id: Swift.Int + /// The GraphQL identifier of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/node_id`. + public var node_id: Swift.String + /// The name of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/name`. + public var name: Swift.String + /// The full, globally unique, name of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/full_name`. + public var full_name: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-repository/owner`. + public var owner: Components.Schemas.simple_hyphen_user + /// Whether the repository is private. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/private`. + public var _private: Swift.Bool + /// The URL to view the repository on GitHub.com. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/html_url`. + public var html_url: Swift.String + /// The repository description. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/description`. + public var description: Swift.String? + /// Whether the repository is a fork. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/fork`. + public var fork: Swift.Bool + /// The URL to get more information about the repository from the GitHub API. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/url`. + public var url: Swift.String + /// A template for the API URL to download the repository as an archive. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/archive_url`. + public var archive_url: Swift.String + /// A template for the API URL to list the available assignees for issues in the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/assignees_url`. + public var assignees_url: Swift.String + /// A template for the API URL to create or retrieve a raw Git blob in the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/blobs_url`. + public var blobs_url: Swift.String + /// A template for the API URL to get information about branches in the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/branches_url`. + public var branches_url: Swift.String + /// A template for the API URL to get information about collaborators of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/collaborators_url`. + public var collaborators_url: Swift.String + /// A template for the API URL to get information about comments on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/comments_url`. + public var comments_url: Swift.String + /// A template for the API URL to get information about commits on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/commits_url`. + public var commits_url: Swift.String + /// A template for the API URL to compare two commits or refs. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/compare_url`. + public var compare_url: Swift.String + /// A template for the API URL to get the contents of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/contents_url`. + public var contents_url: Swift.String + /// A template for the API URL to list the contributors to the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/contributors_url`. + public var contributors_url: Swift.String + /// The API URL to list the deployments of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/deployments_url`. + public var deployments_url: Swift.String + /// The API URL to list the downloads on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/downloads_url`. + public var downloads_url: Swift.String + /// The API URL to list the events of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/events_url`. + public var events_url: Swift.String + /// The API URL to list the forks of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/forks_url`. + public var forks_url: Swift.String + /// A template for the API URL to get information about Git commits of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/git_commits_url`. + public var git_commits_url: Swift.String + /// A template for the API URL to get information about Git refs of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/git_refs_url`. + public var git_refs_url: Swift.String + /// A template for the API URL to get information about Git tags of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/git_tags_url`. + public var git_tags_url: Swift.String + /// A template for the API URL to get information about issue comments on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/issue_comment_url`. + public var issue_comment_url: Swift.String + /// A template for the API URL to get information about issue events on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/issue_events_url`. + public var issue_events_url: Swift.String + /// A template for the API URL to get information about issues on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/issues_url`. + public var issues_url: Swift.String + /// A template for the API URL to get information about deploy keys on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/keys_url`. + public var keys_url: Swift.String + /// A template for the API URL to get information about labels of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/labels_url`. + public var labels_url: Swift.String + /// The API URL to get information about the languages of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/languages_url`. + public var languages_url: Swift.String + /// The API URL to merge branches in the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/merges_url`. + public var merges_url: Swift.String + /// A template for the API URL to get information about milestones of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/milestones_url`. + public var milestones_url: Swift.String + /// A template for the API URL to get information about notifications on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/notifications_url`. + public var notifications_url: Swift.String + /// A template for the API URL to get information about pull requests on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/pulls_url`. + public var pulls_url: Swift.String + /// A template for the API URL to get information about releases on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/releases_url`. + public var releases_url: Swift.String + /// The API URL to list the stargazers on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/stargazers_url`. + public var stargazers_url: Swift.String + /// A template for the API URL to get information about statuses of a commit. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/statuses_url`. + public var statuses_url: Swift.String + /// The API URL to list the subscribers on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/subscribers_url`. + public var subscribers_url: Swift.String + /// The API URL to subscribe to notifications for this repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/subscription_url`. + public var subscription_url: Swift.String + /// The API URL to get information about tags on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/tags_url`. + public var tags_url: Swift.String + /// The API URL to list the teams on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/teams_url`. + public var teams_url: Swift.String + /// A template for the API URL to create or retrieve a raw Git tree of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/trees_url`. + public var trees_url: Swift.String + /// The API URL to list the hooks on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/hooks_url`. + public var hooks_url: Swift.String + /// Creates a new `simple_hyphen_repository`. + /// + /// - Parameters: + /// - id: A unique identifier of the repository. + /// - node_id: The GraphQL identifier of the repository. + /// - name: The name of the repository. + /// - full_name: The full, globally unique, name of the repository. + /// - owner: + /// - _private: Whether the repository is private. + /// - html_url: The URL to view the repository on GitHub.com. + /// - description: The repository description. + /// - fork: Whether the repository is a fork. + /// - url: The URL to get more information about the repository from the GitHub API. + /// - archive_url: A template for the API URL to download the repository as an archive. + /// - assignees_url: A template for the API URL to list the available assignees for issues in the repository. + /// - blobs_url: A template for the API URL to create or retrieve a raw Git blob in the repository. + /// - branches_url: A template for the API URL to get information about branches in the repository. + /// - collaborators_url: A template for the API URL to get information about collaborators of the repository. + /// - comments_url: A template for the API URL to get information about comments on the repository. + /// - commits_url: A template for the API URL to get information about commits on the repository. + /// - compare_url: A template for the API URL to compare two commits or refs. + /// - contents_url: A template for the API URL to get the contents of the repository. + /// - contributors_url: A template for the API URL to list the contributors to the repository. + /// - deployments_url: The API URL to list the deployments of the repository. + /// - downloads_url: The API URL to list the downloads on the repository. + /// - events_url: The API URL to list the events of the repository. + /// - forks_url: The API URL to list the forks of the repository. + /// - git_commits_url: A template for the API URL to get information about Git commits of the repository. + /// - git_refs_url: A template for the API URL to get information about Git refs of the repository. + /// - git_tags_url: A template for the API URL to get information about Git tags of the repository. + /// - issue_comment_url: A template for the API URL to get information about issue comments on the repository. + /// - issue_events_url: A template for the API URL to get information about issue events on the repository. + /// - issues_url: A template for the API URL to get information about issues on the repository. + /// - keys_url: A template for the API URL to get information about deploy keys on the repository. + /// - labels_url: A template for the API URL to get information about labels of the repository. + /// - languages_url: The API URL to get information about the languages of the repository. + /// - merges_url: The API URL to merge branches in the repository. + /// - milestones_url: A template for the API URL to get information about milestones of the repository. + /// - notifications_url: A template for the API URL to get information about notifications on the repository. + /// - pulls_url: A template for the API URL to get information about pull requests on the repository. + /// - releases_url: A template for the API URL to get information about releases on the repository. + /// - stargazers_url: The API URL to list the stargazers on the repository. + /// - statuses_url: A template for the API URL to get information about statuses of a commit. + /// - subscribers_url: The API URL to list the subscribers on the repository. + /// - subscription_url: The API URL to subscribe to notifications for this repository. + /// - tags_url: The API URL to get information about tags on the repository. + /// - teams_url: The API URL to list the teams on the repository. + /// - trees_url: A template for the API URL to create or retrieve a raw Git tree of the repository. + /// - hooks_url: The API URL to list the hooks on the repository. + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + full_name: Swift.String, + owner: Components.Schemas.simple_hyphen_user, + _private: Swift.Bool, + html_url: Swift.String, + description: Swift.String? = nil, + fork: Swift.Bool, + url: Swift.String, + archive_url: Swift.String, + assignees_url: Swift.String, + blobs_url: Swift.String, + branches_url: Swift.String, + collaborators_url: Swift.String, + comments_url: Swift.String, + commits_url: Swift.String, + compare_url: Swift.String, + contents_url: Swift.String, + contributors_url: Swift.String, + deployments_url: Swift.String, + downloads_url: Swift.String, + events_url: Swift.String, + forks_url: Swift.String, + git_commits_url: Swift.String, + git_refs_url: Swift.String, + git_tags_url: Swift.String, + issue_comment_url: Swift.String, + issue_events_url: Swift.String, + issues_url: Swift.String, + keys_url: Swift.String, + labels_url: Swift.String, + languages_url: Swift.String, + merges_url: Swift.String, + milestones_url: Swift.String, + notifications_url: Swift.String, + pulls_url: Swift.String, + releases_url: Swift.String, + stargazers_url: Swift.String, + statuses_url: Swift.String, + subscribers_url: Swift.String, + subscription_url: Swift.String, + tags_url: Swift.String, + teams_url: Swift.String, + trees_url: Swift.String, + hooks_url: Swift.String + ) { + self.id = id + self.node_id = node_id + self.name = name + self.full_name = full_name + self.owner = owner + self._private = _private + self.html_url = html_url + self.description = description + self.fork = fork + self.url = url + self.archive_url = archive_url + self.assignees_url = assignees_url + self.blobs_url = blobs_url + self.branches_url = branches_url + self.collaborators_url = collaborators_url + self.comments_url = comments_url + self.commits_url = commits_url + self.compare_url = compare_url + self.contents_url = contents_url + self.contributors_url = contributors_url + self.deployments_url = deployments_url + self.downloads_url = downloads_url + self.events_url = events_url + self.forks_url = forks_url + self.git_commits_url = git_commits_url + self.git_refs_url = git_refs_url + self.git_tags_url = git_tags_url + self.issue_comment_url = issue_comment_url + self.issue_events_url = issue_events_url + self.issues_url = issues_url + self.keys_url = keys_url + self.labels_url = labels_url + self.languages_url = languages_url + self.merges_url = merges_url + self.milestones_url = milestones_url + self.notifications_url = notifications_url + self.pulls_url = pulls_url + self.releases_url = releases_url + self.stargazers_url = stargazers_url + self.statuses_url = statuses_url + self.subscribers_url = subscribers_url + self.subscription_url = subscription_url + self.tags_url = tags_url + self.teams_url = teams_url + self.trees_url = trees_url + self.hooks_url = hooks_url + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case full_name + case owner + case _private = "private" + case html_url + case description + case fork + case url + case archive_url + case assignees_url + case blobs_url + case branches_url + case collaborators_url + case comments_url + case commits_url + case compare_url + case contents_url + case contributors_url + case deployments_url + case downloads_url + case events_url + case forks_url + case git_commits_url + case git_refs_url + case git_tags_url + case issue_comment_url + case issue_events_url + case issues_url + case keys_url + case labels_url + case languages_url + case merges_url + case milestones_url + case notifications_url + case pulls_url + case releases_url + case stargazers_url + case statuses_url + case subscribers_url + case subscription_url + case tags_url + case teams_url + case trees_url + case hooks_url + } + } + /// A code security configuration + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration`. + public struct code_hyphen_security_hyphen_configuration: Codable, Hashable, Sendable { + /// The ID of the code security configuration + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/id`. + public var id: Swift.Int? + /// The name of the code security configuration. Must be unique within the organization. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/name`. + public var name: Swift.String? + /// The type of the code security configuration. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/target_type`. + @frozen public enum target_typePayload: String, Codable, Hashable, Sendable { + case global = "global" + case organization = "organization" + } + /// The type of the code security configuration. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/target_type`. + public var target_type: Components.Schemas.code_hyphen_security_hyphen_configuration.target_typePayload? + /// A description of the code security configuration + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/description`. + public var description: Swift.String? + /// The enablement status of GitHub Advanced Security + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/advanced_security`. + @frozen public enum advanced_securityPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// The enablement status of GitHub Advanced Security + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/advanced_security`. + public var advanced_security: Components.Schemas.code_hyphen_security_hyphen_configuration.advanced_securityPayload? + /// The enablement status of Dependency Graph + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph`. + @frozen public enum dependency_graphPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependency Graph + /// + /// - 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 Dependabot alerts + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_alerts`. + @frozen public enum dependabot_alertsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependabot alerts + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_alerts`. + public var dependabot_alerts: Components.Schemas.code_hyphen_security_hyphen_configuration.dependabot_alertsPayload? + /// The enablement status of Dependabot security updates + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_security_updates`. + @frozen public enum dependabot_security_updatesPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependabot security updates + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_security_updates`. + public var dependabot_security_updates: Components.Schemas.code_hyphen_security_hyphen_configuration.dependabot_security_updatesPayload? + /// The enablement status of code scanning default setup + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup`. + @frozen public enum code_scanning_default_setupPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of code scanning default setup + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup`. + public var code_scanning_default_setup: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setupPayload? + /// The enablement status of secret scanning + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning`. + @frozen public enum secret_scanningPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning`. + public var secret_scanning: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanningPayload? + /// The enablement status of secret scanning push protection + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_push_protection`. + @frozen public enum secret_scanning_push_protectionPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning push protection + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_push_protection`. + public var secret_scanning_push_protection: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_push_protectionPayload? + /// The enablement status of private vulnerability reporting + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/private_vulnerability_reporting`. + @frozen public enum private_vulnerability_reportingPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of private vulnerability reporting + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/private_vulnerability_reporting`. + public var private_vulnerability_reporting: Components.Schemas.code_hyphen_security_hyphen_configuration.private_vulnerability_reportingPayload? + /// The URL of the configuration + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/url`. + public var url: Swift.String? + /// The URL of the configuration + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/html_url`. + public var html_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/code-security-configuration/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/code-security-configuration/updated_at`. + public var updated_at: Foundation.Date? + /// Creates a new `code_hyphen_security_hyphen_configuration`. + /// + /// - Parameters: + /// - id: The ID of the code security configuration + /// - name: The name of the code security configuration. Must be unique within the organization. + /// - target_type: The type of the code security configuration. + /// - 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 + /// - 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 + /// - secret_scanning: The enablement status of secret scanning + /// - secret_scanning_push_protection: The enablement status of secret scanning push protection + /// - private_vulnerability_reporting: The enablement status of private vulnerability reporting + /// - url: The URL of the configuration + /// - html_url: The URL of the configuration + /// - created_at: + /// - updated_at: + public init( + id: Swift.Int? = nil, + name: Swift.String? = nil, + target_type: Components.Schemas.code_hyphen_security_hyphen_configuration.target_typePayload? = nil, + 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, + 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, + secret_scanning: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanningPayload? = nil, + secret_scanning_push_protection: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_push_protectionPayload? = nil, + private_vulnerability_reporting: Components.Schemas.code_hyphen_security_hyphen_configuration.private_vulnerability_reportingPayload? = nil, + url: Swift.String? = nil, + html_url: Swift.String? = nil, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil + ) { + self.id = id + self.name = name + self.target_type = target_type + self.description = description + self.advanced_security = advanced_security + self.dependency_graph = dependency_graph + self.dependabot_alerts = dependabot_alerts + self.dependabot_security_updates = dependabot_security_updates + self.code_scanning_default_setup = code_scanning_default_setup + self.secret_scanning = secret_scanning + self.secret_scanning_push_protection = secret_scanning_push_protection + self.private_vulnerability_reporting = private_vulnerability_reporting + self.url = url + self.html_url = html_url + self.created_at = created_at + self.updated_at = updated_at + } + public enum CodingKeys: String, CodingKey { + case id + case name + case target_type + case description + case advanced_security + case dependency_graph + case dependabot_alerts + case dependabot_security_updates + case code_scanning_default_setup + case secret_scanning + case secret_scanning_push_protection + case private_vulnerability_reporting + case url + case html_url + case created_at + case updated_at + } + } + /// - Remark: Generated from `#/components/schemas/code_hyphen_security_hyphen_default_hyphen_configurations`. + public struct code_hyphen_security_hyphen_default_hyphen_configurationsPayload: Codable, Hashable, Sendable { + /// The visibility of newly created repositories for which the code security configuration will be applied to by default + /// + /// - Remark: Generated from `#/components/schemas/code_hyphen_security_hyphen_default_hyphen_configurations/default_for_new_repos`. + public var default_for_new_repos: OpenAPIRuntime.OpenAPIValueContainer? + /// - Remark: Generated from `#/components/schemas/code_hyphen_security_hyphen_default_hyphen_configurations/configuration`. + public var configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? + /// Creates a new `code_hyphen_security_hyphen_default_hyphen_configurationsPayload`. + /// + /// - Parameters: + /// - default_for_new_repos: The visibility of newly created repositories for which the code security configuration will be applied to by default + /// - configuration: + public init( + default_for_new_repos: OpenAPIRuntime.OpenAPIValueContainer? = nil, + configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? = nil + ) { + self.default_for_new_repos = default_for_new_repos + self.configuration = configuration + } + public enum CodingKeys: String, CodingKey { + case default_for_new_repos + case configuration + } + } + /// A list of default code security configurations + /// + /// - Remark: Generated from `#/components/schemas/code-security-default-configurations`. + public typealias code_hyphen_security_hyphen_default_hyphen_configurations = [Components.Schemas.code_hyphen_security_hyphen_default_hyphen_configurationsPayload] + /// Repositories associated with a code security configuration and attachment status + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration-repositories`. + public struct code_hyphen_security_hyphen_configuration_hyphen_repositories: Codable, Hashable, Sendable { + /// The attachment status of the code security configuration on the repository. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration-repositories/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case attached = "attached" + case attaching = "attaching" + case detached = "detached" + case enforced = "enforced" + case failed = "failed" + case updating = "updating" + } + /// The attachment status of the code security configuration on the repository. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration-repositories/status`. + public var status: Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_repositories.statusPayload? + /// - Remark: Generated from `#/components/schemas/code-security-configuration-repositories/repository`. + public var repository: Components.Schemas.simple_hyphen_repository? + /// Creates a new `code_hyphen_security_hyphen_configuration_hyphen_repositories`. + /// + /// - Parameters: + /// - status: The attachment status of the code security configuration on the repository. + /// - repository: + public init( + status: Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_repositories.statusPayload? = nil, + repository: Components.Schemas.simple_hyphen_repository? = nil + ) { + self.status = status + self.repository = repository + } + public enum CodingKeys: String, CodingKey { + case status + case repository + } + } + } /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters {} + public enum Parameters { + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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 `#/components/parameters/pagination-before`. + public typealias pagination_hyphen_before = Swift.String + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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 `#/components/parameters/pagination-after`. + public typealias pagination_hyphen_after = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias org = Swift.String + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/components/parameters/configuration-id`. + public typealias configuration_hyphen_id = Swift.Int + } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses {} + public enum Responses { + public struct not_found: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// 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.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.not_found.Body + /// Creates a new `not_found`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.not_found.Body) { + self.body = body + } + } + public struct bad_request: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// 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.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/json", + body: self + ) + } + } + } + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/scim+json`. + case application_scim_plus_json(Components.Schemas.scim_hyphen_error) + /// The associated value of the enum case if `self` is `.application_scim_plus_json`. + /// + /// - Throws: An error if `self` is not `.application_scim_plus_json`. + /// - SeeAlso: `.application_scim_plus_json`. + public var application_scim_plus_json: Components.Schemas.scim_hyphen_error { + get throws { + switch self { + case let .application_scim_plus_json(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/scim+json", + body: self + ) + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.bad_request.Body + /// Creates a new `bad_request`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.bad_request.Body) { + self.body = body + } + } + public struct accepted: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/accepted/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/accepted/content/application\/json`. + case json(OpenAPIRuntime.OpenAPIObjectContainer) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: OpenAPIRuntime.OpenAPIObjectContainer { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.accepted.Body + /// Creates a new `accepted`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.accepted.Body) { + self.body = body + } + } + public struct not_modified: Sendable, Hashable { + /// Creates a new `not_modified`. + public init() {} + } + public struct forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// 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.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.forbidden.Body + /// Creates a new `forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.forbidden.Body) { + self.body = body + } + } + public struct conflict: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// 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.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.conflict.Body + /// Creates a new `conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.conflict.Body) { + self.body = body + } + } + public struct no_content: Sendable, Hashable { + /// Creates a new `no_content`. + public init() {} + } + } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers {} } /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations {} +public enum Operations { + /// Get code security configurations for an organization + /// + /// Lists all code security configurations available in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)`. + public enum code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org { + public static let id: Swift.String = "code-security/get-configurations-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/GET/path/org`. + public var org: Components.Parameters.org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.org) { + self.org = org + } + } + public var path: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/GET/query/target_type`. + @frozen public enum target_typePayload: String, Codable, Hashable, Sendable { + case global = "global" + case all = "all" + } + /// The target type of the code security configuration + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/GET/query/target_type`. + public var target_type: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Input.Query.target_typePayload? + /// 'The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."' + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/GET/query/per_page`. + public var per_page: Swift.Int? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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}/code-security/configurations/GET/query/before`. + public var before: Components.Parameters.pagination_hyphen_before? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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}/code-security/configurations/GET/query/after`. + public var after: Components.Parameters.pagination_hyphen_after? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - target_type: The target type of the code security configuration + /// - per_page: 'The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."' + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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( + target_type: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Input.Query.target_typePayload? = nil, + per_page: Swift.Int? = nil, + before: Components.Parameters.pagination_hyphen_before? = nil, + after: Components.Parameters.pagination_hyphen_after? = nil + ) { + self.target_type = target_type + self.per_page = per_page + self.before = before + self.after = after + } + } + public var query: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/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_configurations_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Input.Path, + query: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.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}/code-security/configurations/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/GET/responses/200/content/application\/json`. + case json([Components.Schemas.code_hyphen_security_hyphen_configuration]) + /// 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] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_org.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_configurations_hyphen_for_hyphen_org.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)/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}/code-security/configurations/get(code-security/get-configurations-for-org)/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 + ] + } + } + } + /// Create a code security configuration + /// + /// Creates a code security configuration in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/code-security/configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/post(code-security/create-configuration)`. + public enum code_hyphen_security_sol_create_hyphen_configuration { + public static let id: Swift.String = "code-security/create-configuration" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/path/org`. + public var org: Components.Parameters.org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.org) { + self.org = org + } + } + public var path: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/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.code_hyphen_security_sol_create_hyphen_configuration.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The name of the code security configuration. Must be unique within the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/name`. + public var name: Swift.String + /// A description of the code security configuration + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/description`. + public var description: Swift.String + /// The enablement status of GitHub Advanced Security + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/advanced_security`. + @frozen public enum advanced_securityPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// The enablement status of GitHub Advanced Security + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/advanced_security`. + public var advanced_security: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.advanced_securityPayload? + /// The enablement status of Dependency Graph + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependency_graph`. + @frozen public enum dependency_graphPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependency Graph + /// + /// - 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 Dependabot alerts + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependabot_alerts`. + @frozen public enum dependabot_alertsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependabot alerts + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependabot_alerts`. + public var dependabot_alerts: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependabot_alertsPayload? + /// The enablement status of Dependabot security updates + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependabot_security_updates`. + @frozen public enum dependabot_security_updatesPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependabot security updates + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependabot_security_updates`. + public var dependabot_security_updates: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependabot_security_updatesPayload? + /// The enablement status of code scanning default setup + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_default_setup`. + @frozen public enum code_scanning_default_setupPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of code scanning default setup + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_default_setup`. + public var code_scanning_default_setup: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload? + /// The enablement status of secret scanning + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning`. + @frozen public enum secret_scanningPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning`. + public var secret_scanning: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload? + /// The enablement status of secret scanning push protection + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_push_protection`. + @frozen public enum secret_scanning_push_protectionPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning push protection + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_push_protection`. + public var secret_scanning_push_protection: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload? + /// The enablement status of private vulnerability reporting + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/private_vulnerability_reporting`. + @frozen public enum private_vulnerability_reportingPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of private vulnerability reporting + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/private_vulnerability_reporting`. + public var private_vulnerability_reporting: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - name: The name of the code security configuration. Must be unique within the organization. + /// - 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 + /// - 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 + /// - secret_scanning: The enablement status of secret scanning + /// - secret_scanning_push_protection: The enablement status of secret scanning push protection + /// - private_vulnerability_reporting: The enablement status of private vulnerability reporting + public init( + name: Swift.String, + 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, + 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, + secret_scanning: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload? = nil, + secret_scanning_push_protection: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload? = nil, + private_vulnerability_reporting: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload? = nil + ) { + self.name = name + self.description = description + self.advanced_security = advanced_security + self.dependency_graph = dependency_graph + self.dependabot_alerts = dependabot_alerts + self.dependabot_security_updates = dependabot_security_updates + self.code_scanning_default_setup = code_scanning_default_setup + self.secret_scanning = secret_scanning + self.secret_scanning_push_protection = secret_scanning_push_protection + self.private_vulnerability_reporting = private_vulnerability_reporting + } + public enum CodingKeys: String, CodingKey { + case name + case description + case advanced_security + case dependency_graph + case dependabot_alerts + case dependabot_security_updates + case code_scanning_default_setup + case secret_scanning + case secret_scanning_push_protection + case private_vulnerability_reporting + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + name = try container.decode( + Swift.String.self, + forKey: .name + ) + description = try container.decode( + Swift.String.self, + forKey: .description + ) + advanced_security = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.advanced_securityPayload.self, + forKey: .advanced_security + ) + dependency_graph = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependency_graphPayload.self, + forKey: .dependency_graph + ) + dependabot_alerts = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependabot_alertsPayload.self, + forKey: .dependabot_alerts + ) + dependabot_security_updates = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependabot_security_updatesPayload.self, + forKey: .dependabot_security_updates + ) + code_scanning_default_setup = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload.self, + forKey: .code_scanning_default_setup + ) + secret_scanning = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload.self, + forKey: .secret_scanning + ) + secret_scanning_push_protection = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload.self, + forKey: .secret_scanning_push_protection + ) + private_vulnerability_reporting = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload.self, + forKey: .private_vulnerability_reporting + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "description", + "advanced_security", + "dependency_graph", + "dependabot_alerts", + "dependabot_security_updates", + "code_scanning_default_setup", + "secret_scanning", + "secret_scanning_push_protection", + "private_vulnerability_reporting" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/content/application\/json`. + case json(Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload) + } + public var body: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/responses/201/content/application\/json`. + case json(Components.Schemas.code_hyphen_security_hyphen_configuration) + /// 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 { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_create_hyphen_configuration.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_create_hyphen_configuration.Output.Created.Body) { + self.body = body + } + } + /// Successfully created code security configuration + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/post(code-security/create-configuration)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.code_hyphen_security_sol_create_hyphen_configuration.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.code_hyphen_security_sol_create_hyphen_configuration.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + 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 + ] + } + } + } + /// Get default code security configurations + /// + /// Lists the default code security configurations for an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/defaults`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)`. + public enum code_hyphen_security_sol_get_hyphen_default_hyphen_configurations { + public static let id: Swift.String = "code-security/get-default-configurations" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/defaults/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/defaults/GET/path/org`. + public var org: Components.Parameters.org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.org) { + self.org = org + } + } + public var path: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/defaults/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_default_hyphen_configurations.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Input.Path, + headers: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/defaults/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/defaults/GET/responses/200/content/application\/json`. + case json(Components.Schemas.code_hyphen_security_hyphen_default_hyphen_configurations) + /// 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_default_hyphen_configurations { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations.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_default_hyphen_configurations.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)/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//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)/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}/code-security/configurations/defaults/get(code-security/get-default-configurations)/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 + ] + } + } + } + /// Get a code security configuration + /// + /// Gets a code security configuration available in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/get(code-security/get-configuration)`. + public enum code_hyphen_security_sol_get_hyphen_configuration { + public static let id: Swift.String = "code-security/get-configuration" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/GET/path/org`. + public var org: Components.Parameters.org + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/GET/path/configuration_id`. + public var configuration_id: Components.Parameters.configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - configuration_id: The unique identifier of the code security configuration. + public init( + org: Components.Parameters.org, + configuration_id: Components.Parameters.configuration_hyphen_id + ) { + self.org = org + self.configuration_id = configuration_id + } + } + public var path: Operations.code_hyphen_security_sol_get_hyphen_configuration.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/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.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.code_hyphen_security_sol_get_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_get_hyphen_configuration.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.code_hyphen_security_hyphen_configuration) + /// 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 { + 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.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_get_hyphen_configuration.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/get(code-security/get-configuration)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_get_hyphen_configuration.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.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/get(code-security/get-configuration)/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//orgs/{org}/code-security/configurations/{configuration_id}/get(code-security/get-configuration)/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}/code-security/configurations/{configuration_id}/get(code-security/get-configuration)/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 + ] + } + } + } + /// Update a code security configuration + /// + /// Updates a code security configuration in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/patch(code-security/update-configuration)`. + public enum code_hyphen_security_sol_update_hyphen_configuration { + public static let id: Swift.String = "code-security/update-configuration" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/path/org`. + public var org: Components.Parameters.org + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/path/configuration_id`. + public var configuration_id: Components.Parameters.configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - configuration_id: The unique identifier of the code security configuration. + public init( + org: Components.Parameters.org, + configuration_id: Components.Parameters.configuration_hyphen_id + ) { + self.org = org + self.configuration_id = configuration_id + } + } + public var path: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/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_update_hyphen_configuration.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The name of the code security configuration. Must be unique within the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// A description of the code security configuration + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/description`. + public var description: Swift.String? + /// The enablement status of GitHub Advanced Security + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. + @frozen public enum advanced_securityPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// The enablement status of GitHub Advanced Security + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. + public var advanced_security: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.advanced_securityPayload? + /// The enablement status of Dependency Graph + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph`. + @frozen public enum dependency_graphPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependency Graph + /// + /// - 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 Dependabot alerts + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependabot_alerts`. + @frozen public enum dependabot_alertsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependabot alerts + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependabot_alerts`. + public var dependabot_alerts: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependabot_alertsPayload? + /// The enablement status of Dependabot security updates + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependabot_security_updates`. + @frozen public enum dependabot_security_updatesPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependabot security updates + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependabot_security_updates`. + public var dependabot_security_updates: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependabot_security_updatesPayload? + /// The enablement status of code scanning default setup + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_default_setup`. + @frozen public enum code_scanning_default_setupPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of code scanning default setup + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_default_setup`. + public var code_scanning_default_setup: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload? + /// The enablement status of secret scanning + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning`. + @frozen public enum secret_scanningPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning`. + public var secret_scanning: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload? + /// The enablement status of secret scanning push protection + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_push_protection`. + @frozen public enum secret_scanning_push_protectionPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning push protection + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_push_protection`. + public var secret_scanning_push_protection: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload? + /// The enablement status of private vulnerability reporting + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/private_vulnerability_reporting`. + @frozen public enum private_vulnerability_reportingPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of private vulnerability reporting + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/private_vulnerability_reporting`. + public var private_vulnerability_reporting: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - name: The name of the code security configuration. Must be unique within the organization. + /// - 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 + /// - 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 + /// - secret_scanning: The enablement status of secret scanning + /// - secret_scanning_push_protection: The enablement status of secret scanning push protection + /// - private_vulnerability_reporting: The enablement status of private vulnerability reporting + public init( + name: Swift.String? = nil, + 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, + 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, + secret_scanning: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload? = nil, + secret_scanning_push_protection: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload? = nil, + private_vulnerability_reporting: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload? = nil + ) { + self.name = name + self.description = description + self.advanced_security = advanced_security + self.dependency_graph = dependency_graph + self.dependabot_alerts = dependabot_alerts + self.dependabot_security_updates = dependabot_security_updates + self.code_scanning_default_setup = code_scanning_default_setup + self.secret_scanning = secret_scanning + self.secret_scanning_push_protection = secret_scanning_push_protection + self.private_vulnerability_reporting = private_vulnerability_reporting + } + public enum CodingKeys: String, CodingKey { + case name + case description + case advanced_security + case dependency_graph + case dependabot_alerts + case dependabot_security_updates + case code_scanning_default_setup + case secret_scanning + case secret_scanning_push_protection + case private_vulnerability_reporting + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + name = try container.decodeIfPresent( + Swift.String.self, + forKey: .name + ) + description = try container.decodeIfPresent( + Swift.String.self, + forKey: .description + ) + advanced_security = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.advanced_securityPayload.self, + forKey: .advanced_security + ) + dependency_graph = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependency_graphPayload.self, + forKey: .dependency_graph + ) + dependabot_alerts = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependabot_alertsPayload.self, + forKey: .dependabot_alerts + ) + dependabot_security_updates = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependabot_security_updatesPayload.self, + forKey: .dependabot_security_updates + ) + code_scanning_default_setup = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload.self, + forKey: .code_scanning_default_setup + ) + secret_scanning = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload.self, + forKey: .secret_scanning + ) + secret_scanning_push_protection = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload.self, + forKey: .secret_scanning_push_protection + ) + private_vulnerability_reporting = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload.self, + forKey: .private_vulnerability_reporting + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "description", + "advanced_security", + "dependency_graph", + "dependabot_alerts", + "dependabot_security_updates", + "code_scanning_default_setup", + "secret_scanning", + "secret_scanning_push_protection", + "private_vulnerability_reporting" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload) + } + public var body: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_update_hyphen_configuration.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/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.code_hyphen_security_hyphen_configuration) + /// 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 { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_update_hyphen_configuration.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_update_hyphen_configuration.Output.Ok.Body) { + self.body = body + } + } + /// Response when a configuration is updated + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/patch(code-security/update-configuration)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_update_hyphen_configuration.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_update_hyphen_configuration.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response when no new updates are made + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/patch(code-security/update-configuration)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.code_hyphen_security_sol_update_hyphen_configuration.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.code_hyphen_security_sol_update_hyphen_configuration.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @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 + ] + } + } + } + /// Delete a code security configuration + /// + /// Deletes the desired code security configuration from an organization. + /// Repositories attached to the configuration will retain their settings but will no longer be associated with + /// the configuration. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration)`. + public enum code_hyphen_security_sol_delete_hyphen_configuration { + public static let id: Swift.String = "code-security/delete-configuration" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/DELETE/path/org`. + public var org: Components.Parameters.org + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/DELETE/path/configuration_id`. + public var configuration_id: Components.Parameters.configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - configuration_id: The unique identifier of the code security configuration. + public init( + org: Components.Parameters.org, + configuration_id: Components.Parameters.configuration_hyphen_id + ) { + self.org = org + self.configuration_id = configuration_id + } + } + public var path: Operations.code_hyphen_security_sol_delete_hyphen_configuration.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.code_hyphen_security_sol_delete_hyphen_configuration.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.code_hyphen_security_sol_delete_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_delete_hyphen_configuration.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration)/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 + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.bad_request) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.bad_request { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration)/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}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration)/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 + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case application_scim_plus_json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .application_scim_plus_json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .application_scim_plus_json: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .application_scim_plus_json + ] + } + } + } + /// Attach a configuration to repositories + /// + /// Attach a code security configuration to a set of repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration. + /// + /// If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/code-security/configurations/{configuration_id}/attach`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-configuration)`. + public enum code_hyphen_security_sol_attach_hyphen_configuration { + public static let id: Swift.String = "code-security/attach-configuration" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/attach/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/attach/POST/path/org`. + public var org: Components.Parameters.org + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/attach/POST/path/configuration_id`. + public var configuration_id: Components.Parameters.configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - configuration_id: The unique identifier of the code security configuration. + public init( + org: Components.Parameters.org, + configuration_id: Components.Parameters.configuration_hyphen_id + ) { + self.org = org + self.configuration_id = configuration_id + } + } + public var path: Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/attach/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.code_hyphen_security_sol_attach_hyphen_configuration.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/attach/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/attach/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The type of repositories to attach the configuration to. `selected` means the configuration will be attached to only the repositories specified by `selected_repository_ids` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/attach/POST/requestBody/json/scope`. + @frozen public enum scopePayload: String, Codable, Hashable, Sendable { + case all = "all" + case _public = "public" + case private_or_internal = "private_or_internal" + case selected = "selected" + } + /// The type of repositories to attach the configuration to. `selected` means the configuration will be attached to only the repositories specified by `selected_repository_ids` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/attach/POST/requestBody/json/scope`. + public var scope: Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input.Body.jsonPayload.scopePayload + /// An array of repository IDs to attach the configuration to. You can only provide a list of repository ids when the `scope` is set to `selected`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/attach/POST/requestBody/json/selected_repository_ids`. + public var selected_repository_ids: [Swift.Int]? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - scope: The type of repositories to attach the configuration to. `selected` means the configuration will be attached to only the repositories specified by `selected_repository_ids` + /// - selected_repository_ids: An array of repository IDs to attach the configuration to. You can only provide a list of repository ids when the `scope` is set to `selected`. + public init( + scope: Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input.Body.jsonPayload.scopePayload, + selected_repository_ids: [Swift.Int]? = nil + ) { + self.scope = scope + self.selected_repository_ids = selected_repository_ids + } + public enum CodingKeys: String, CodingKey { + case scope + case selected_repository_ids + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + scope = try container.decode( + Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input.Body.jsonPayload.scopePayload.self, + forKey: .scope + ) + selected_repository_ids = try container.decodeIfPresent( + [Swift.Int].self, + forKey: .selected_repository_ids + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "scope", + "selected_repository_ids" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/attach/POST/requestBody/content/application\/json`. + case json(Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input.Body.jsonPayload) + } + public var body: Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_attach_hyphen_configuration.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + /// Accepted + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-configuration)/responses/202`. + /// + /// HTTP response code: `202 accepted`. + case accepted(Components.Responses.accepted) + /// The associated value of the enum case if `self` is `.accepted`. + /// + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Components.Responses.accepted { + get throws { + switch self { + case let .accepted(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "accepted", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set a code security configuration as a default for an organization + /// + /// Sets a code security configuration as a default to be applied to new repositories in your organization. + /// + /// This configuration will be applied to the matching repository type (all, none, public, private and internal) by default when they are created. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults`. + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default)`. + public enum code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default { + public static let id: Swift.String = "code-security/set-configuration-as-default" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/path/org`. + public var org: Components.Parameters.org + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/path/configuration_id`. + public var configuration_id: Components.Parameters.configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - configuration_id: The unique identifier of the code security configuration. + public init( + org: Components.Parameters.org, + configuration_id: Components.Parameters.configuration_hyphen_id + ) { + self.org = org + self.configuration_id = configuration_id + } + } + public var path: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// Specify which types of repository this security configuration should be applied to by default. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/requestBody/json/default_for_new_repos`. + @frozen public enum default_for_new_reposPayload: String, Codable, Hashable, Sendable { + case all = "all" + case none = "none" + case private_and_internal = "private_and_internal" + case _public = "public" + } + /// Specify which types of repository this security configuration should be applied to by default. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/requestBody/json/default_for_new_repos`. + public var default_for_new_repos: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input.Body.jsonPayload.default_for_new_reposPayload? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - default_for_new_repos: Specify which types of repository this security configuration should be applied to by default. + public init(default_for_new_repos: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input.Body.jsonPayload.default_for_new_reposPayload? = nil) { + self.default_for_new_repos = default_for_new_repos + } + public enum CodingKeys: String, CodingKey { + case default_for_new_repos + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/requestBody/content/application\/json`. + case json(Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input.Body.jsonPayload) + } + public var body: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input.Path, + headers: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.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/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// Specifies which types of repository this security configuration is applied to by default. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/responses/200/content/json/default_for_new_repos`. + @frozen public enum default_for_new_reposPayload: String, Codable, Hashable, Sendable { + case all = "all" + case none = "none" + case private_and_internal = "private_and_internal" + case _public = "public" + } + /// Specifies which types of repository this security configuration is applied to by default. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/responses/200/content/json/default_for_new_repos`. + public var default_for_new_repos: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Output.Ok.Body.jsonPayload.default_for_new_reposPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/responses/200/content/json/configuration`. + public var configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - default_for_new_repos: Specifies which types of repository this security configuration is applied to by default. + /// - configuration: + public init( + default_for_new_repos: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Output.Ok.Body.jsonPayload.default_for_new_reposPayload? = nil, + configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? = nil + ) { + self.default_for_new_repos = default_for_new_repos + self.configuration = configuration + } + public enum CodingKeys: String, CodingKey { + case default_for_new_repos + case configuration + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/defaults/PUT/responses/200/content/application\/json`. + case json(Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Output.Ok.Body.jsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.Output.Ok.Body) { + self.body = body + } + } + /// Default successfully changed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default.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_set_hyphen_configuration_hyphen_as_hyphen_default.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default)/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}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default)/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 + ] + } + } + } + /// Get repositories associated with a code security configuration + /// + /// Lists the repositories associated with a code security configuration in an organization. + /// + /// 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 `write:org` scope to use this endpoint. + /// + /// - 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)`. + public enum code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration { + public static let id: Swift.String = "code-security/get-repositories-for-configuration" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/repositories/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/repositories/GET/path/org`. + public var org: Components.Parameters.org + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/repositories/GET/path/configuration_id`. + public var configuration_id: Components.Parameters.configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - configuration_id: The unique identifier of the code security configuration. + public init( + org: Components.Parameters.org, + configuration_id: Components.Parameters.configuration_hyphen_id + ) { + self.org = org + self.configuration_id = configuration_id + } + } + public var path: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/repositories/GET/query/per_page`. + public var per_page: Swift.Int? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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}/code-security/configurations/{configuration_id}/repositories/GET/query/before`. + public var before: Components.Parameters.pagination_hyphen_before? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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}/code-security/configurations/{configuration_id}/repositories/GET/query/after`. + public var after: Components.Parameters.pagination_hyphen_after? + /// A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned. + /// + /// Can be: `all`, `attached`, `attaching`, `detached`, `enforced`, `failed`, `updating` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/repositories/GET/query/status`. + public var status: Swift.String? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + /// - status: A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned. + public init( + per_page: Swift.Int? = nil, + before: Components.Parameters.pagination_hyphen_before? = nil, + after: Components.Parameters.pagination_hyphen_after? = nil, + status: Swift.String? = nil + ) { + self.per_page = per_page + self.before = before + self.after = after + self.status = status + } + } + public var query: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/repositories/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Input.Path, + query: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Input.Query = .init(), + headers: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.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}/code-security/configurations/{configuration_id}/repositories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/repositories/GET/responses/200/content/application\/json`. + case json([Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_repositories]) + /// 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_repositories] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-configuration)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_configuration.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_repositories_hyphen_for_hyphen_configuration.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-configuration)/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}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-configuration)/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 + ] + } + } + } +} diff --git a/Sources/copilot/Client.swift b/Sources/copilot/Client.swift index 455631abe52..31653a9d1f6 100644 --- a/Sources/copilot/Client.swift +++ b/Sources/copilot/Client.swift @@ -38,6 +38,190 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// List all Copilot seat assignments for an enterprise + /// + /// **Note**: This endpoint is in beta and is subject to change. + /// + /// Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. + /// + /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. + /// + /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// + /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. + /// + /// Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/billing/seats`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)`. + public func copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output { + try await client.send( + input: input, + forOperation: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/copilot/billing/seats", + parameters: [ + input.path.enterprise + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.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 headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Headers = .init(Link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + 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 + ) + ) + } + } + ) + } /// Get a summary of Copilot usage for enterprise members /// /// **Note**: This endpoint is in beta and is subject to change. diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index 74f586c6f5f..87eb665ed7c 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -11,6 +11,23 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { + /// List all Copilot seat assignments for an enterprise + /// + /// **Note**: This endpoint is in beta and is subject to change. + /// + /// Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. + /// + /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. + /// + /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// + /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. + /// + /// Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/billing/seats`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)`. + func copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output /// Get a summary of Copilot usage for enterprise members /// /// **Note**: This endpoint is in beta and is subject to change. @@ -165,6 +182,33 @@ public protocol APIProtocol: Sendable { /// Convenience overloads for operation inputs. extension APIProtocol { + /// List all Copilot seat assignments for an enterprise + /// + /// **Note**: This endpoint is in beta and is subject to change. + /// + /// Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. + /// + /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. + /// + /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// + /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. + /// + /// Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/billing/seats`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)`. + public func copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise( + path: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Path, + query: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Query = .init(), + headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) async throws -> Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output { + try await copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise(Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input( + path: path, + query: query, + headers: headers + )) + } /// Get a summary of Copilot usage for enterprise members /// /// **Note**: This endpoint is in beta and is subject to change. @@ -593,365 +637,439 @@ public enum Components { case status } } - /// Summary of Copilot usage. + /// Groups of organization members that gives permissions on specified repositories. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics`. - public struct copilot_hyphen_usage_hyphen_metrics: Codable, Hashable, Sendable { - /// The date for which the usage metrics are reported, in `YYYY-MM-DD` format. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/day`. - public var day: Swift.String - /// The total number of Copilot code completion suggestions shown to users. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_suggestions_count`. - public var total_suggestions_count: Swift.Int? - /// The total number of Copilot code completion suggestions accepted by users. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var node_id: Swift.String + /// URL for the team /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_acceptances_count`. - public var total_acceptances_count: Swift.Int? - /// The total number of lines of code completions suggested by Copilot. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_lines_suggested`. - public var total_lines_suggested: Swift.Int? - /// The total number of lines of code completions accepted by users. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_lines_accepted`. - public var total_lines_accepted: Swift.Int? - /// The total number of users who were shown Copilot code completion suggestions during the day specified. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_active_users`. - public var total_active_users: Swift.Int? - /// The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_chat_acceptances`. - public var total_chat_acceptances: Swift.Int? - /// The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_chat_turns`. - public var total_chat_turns: Swift.Int? - /// The total number of users who interacted with Copilot Chat in the IDE during the day specified. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_active_chat_users`. - public var total_active_chat_users: Swift.Int? - /// Breakdown of Copilot usage by editor for this language + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload`. - public struct breakdownPayloadPayload: Codable, Hashable, Sendable { - /// The language in which Copilot suggestions were shown to users in the specified editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/language`. - public var language: Swift.String? - /// The editor in which Copilot suggestions were shown to users for the specified language. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/editor`. - public var editor: Swift.String? - /// The number of Copilot suggestions shown to users in the editor specified during the day specified. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/suggestions_count`. - public var suggestions_count: Swift.Int? - /// The number of Copilot suggestions accepted by users in the editor specified during the day specified. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/acceptances_count`. - public var acceptances_count: Swift.Int? - /// The number of lines of code suggested by Copilot in the editor specified during the day specified. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/lines_suggested`. - public var lines_suggested: Swift.Int? - /// The number of lines of code accepted by users in the editor specified during the day specified. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/lines_accepted`. - public var lines_accepted: Swift.Int? - /// The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/active_users`. - public var active_users: Swift.Int? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `breakdownPayloadPayload`. + /// - Parameters: + /// - id: Unique identifier of the team + /// - node_id: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + public init( + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil + ) { + self.id = id + self.node_id = node_id + self.url = url + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case url + case members_url + case name + case description + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `permissionsPayload`. /// /// - Parameters: - /// - language: The language in which Copilot suggestions were shown to users in the specified editor. - /// - editor: The editor in which Copilot suggestions were shown to users for the specified language. - /// - suggestions_count: The number of Copilot suggestions shown to users in the editor specified during the day specified. - /// - acceptances_count: The number of Copilot suggestions accepted by users in the editor specified during the day specified. - /// - lines_suggested: The number of lines of code suggested by Copilot in the editor specified during the day specified. - /// - lines_accepted: The number of lines of code accepted by users in the editor specified during the day specified. - /// - active_users: The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. - /// - additionalProperties: A container of undocumented properties. + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: public init( - language: Swift.String? = nil, - editor: Swift.String? = nil, - suggestions_count: Swift.Int? = nil, - acceptances_count: Swift.Int? = nil, - lines_suggested: Swift.Int? = nil, - lines_accepted: Swift.Int? = nil, - active_users: Swift.Int? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool ) { - self.language = language - self.editor = editor - self.suggestions_count = suggestions_count - self.acceptances_count = acceptances_count - self.lines_suggested = lines_suggested - self.lines_accepted = lines_accepted - self.active_users = active_users - self.additionalProperties = additionalProperties + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin } public enum CodingKeys: String, CodingKey { - case language - case editor - case suggestions_count - case acceptances_count - case lines_suggested - case lines_accepted - case active_users - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - language = try container.decodeIfPresent( - Swift.String.self, - forKey: .language - ) - editor = try container.decodeIfPresent( - Swift.String.self, - forKey: .editor - ) - suggestions_count = try container.decodeIfPresent( - Swift.Int.self, - forKey: .suggestions_count - ) - acceptances_count = try container.decodeIfPresent( - Swift.Int.self, - forKey: .acceptances_count - ) - lines_suggested = try container.decodeIfPresent( - Swift.Int.self, - forKey: .lines_suggested - ) - lines_accepted = try container.decodeIfPresent( - Swift.Int.self, - forKey: .lines_accepted - ) - active_users = try container.decodeIfPresent( - Swift.Int.self, - forKey: .active_users - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "language", - "editor", - "suggestions_count", - "acceptances_count", - "lines_suggested", - "lines_accepted", - "active_users" - ]) - } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - language, - forKey: .language - ) - try container.encodeIfPresent( - editor, - forKey: .editor - ) - try container.encodeIfPresent( - suggestions_count, - forKey: .suggestions_count - ) - try container.encodeIfPresent( - acceptances_count, - forKey: .acceptances_count - ) - try container.encodeIfPresent( - lines_suggested, - forKey: .lines_suggested - ) - try container.encodeIfPresent( - lines_accepted, - forKey: .lines_accepted - ) - try container.encodeIfPresent( - active_users, - forKey: .active_users - ) - try encoder.encodeAdditionalProperties(additionalProperties) + case pull + case triage + case push + case maintain + case admin } } - /// Breakdown of Copilot code completions usage by language and editor - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdown`. - public typealias breakdownPayload = [Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayloadPayload] - /// Breakdown of Copilot code completions usage by language and editor - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdown`. - public var breakdown: Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload? - /// Creates a new `copilot_hyphen_usage_hyphen_metrics`. - /// - /// - Parameters: - /// - day: The date for which the usage metrics are reported, in `YYYY-MM-DD` format. - /// - total_suggestions_count: The total number of Copilot code completion suggestions shown to users. - /// - total_acceptances_count: The total number of Copilot code completion suggestions accepted by users. - /// - total_lines_suggested: The total number of lines of code completions suggested by Copilot. - /// - total_lines_accepted: The total number of lines of code completions accepted by users. - /// - total_active_users: The total number of users who were shown Copilot code completion suggestions during the day specified. - /// - total_chat_acceptances: The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). - /// - total_chat_turns: The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. - /// - total_active_chat_users: The total number of users who interacted with Copilot Chat in the IDE during the day specified. - /// - breakdown: Breakdown of Copilot code completions usage by language and editor - public init( - day: Swift.String, - total_suggestions_count: Swift.Int? = nil, - total_acceptances_count: Swift.Int? = nil, - total_lines_suggested: Swift.Int? = nil, - total_lines_accepted: Swift.Int? = nil, - total_active_users: Swift.Int? = nil, - total_chat_acceptances: Swift.Int? = nil, - total_chat_turns: Swift.Int? = nil, - total_active_chat_users: Swift.Int? = nil, - breakdown: Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload? = nil - ) { - self.day = day - self.total_suggestions_count = total_suggestions_count - self.total_acceptances_count = total_acceptances_count - self.total_lines_suggested = total_lines_suggested - self.total_lines_accepted = total_lines_accepted - self.total_active_users = total_active_users - self.total_chat_acceptances = total_chat_acceptances - self.total_chat_turns = total_chat_turns - self.total_active_chat_users = total_active_chat_users - self.breakdown = breakdown - } - public enum CodingKeys: String, CodingKey { - case day - case total_suggestions_count - case total_acceptances_count - case total_lines_suggested - case total_lines_accepted - case total_active_users - case total_chat_acceptances - case total_chat_turns - case total_active_chat_users - case breakdown - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - day = try container.decode( - Swift.String.self, - forKey: .day - ) - total_suggestions_count = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_suggestions_count - ) - total_acceptances_count = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_acceptances_count - ) - total_lines_suggested = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_lines_suggested - ) - total_lines_accepted = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_lines_accepted - ) - total_active_users = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_active_users - ) - total_chat_acceptances = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_chat_acceptances - ) - total_chat_turns = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_chat_turns - ) - total_active_chat_users = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_active_chat_users - ) - breakdown = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload.self, - forKey: .breakdown - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "day", - "total_suggestions_count", - "total_acceptances_count", - "total_lines_suggested", - "total_lines_accepted", - "total_active_users", - "total_chat_acceptances", - "total_chat_turns", - "total_active_chat_users", - "breakdown" - ]) - } - } - /// A GitHub organization. - /// - /// - Remark: Generated from `#/components/schemas/organization-simple`. - public struct organization_hyphen_simple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/organization-simple/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization-simple/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/url`. + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/hooks_url`. - public var hooks_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/issues_url`. - public var issues_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/members_url`. + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/public_members_url`. - public var public_members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/avatar_url`. - public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/description`. - public var description: Swift.String? - /// Creates a new `organization_hyphen_simple`. + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. /// /// - Parameters: - /// - login: /// - id: /// - node_id: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: /// - url: - /// - repos_url: - /// - events_url: - /// - hooks_url: - /// - issues_url: + /// - html_url: /// - members_url: - /// - public_members_url: - /// - avatar_url: - /// - description: + /// - repositories_url: + /// - parent: public init( - login: Swift.String, id: Swift.Int, node_id: Swift.String, - url: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - hooks_url: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case slug + case description + case privacy + case notification_setting + case permission + case permissions + case url + case html_url + case members_url + case repositories_url + case parent + } + } + /// GitHub account for managing multiple users, teams, and repositories + /// + /// - Remark: Generated from `#/components/schemas/organization`. + public struct organization: Codable, Hashable, Sendable { + /// Unique login name of the organization + /// + /// - Remark: Generated from `#/components/schemas/organization/login`. + public var login: Swift.String + /// URL for the organization + /// + /// - Remark: Generated from `#/components/schemas/organization/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/organization/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization/hooks_url`. + public var hooks_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization/issues_url`. + public var issues_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization/public_members_url`. + public var public_members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization/description`. + public var description: Swift.String? + /// Display blog url for the organization + /// + /// - Remark: Generated from `#/components/schemas/organization/blog`. + public var blog: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization/html_url`. + public var html_url: Swift.String + /// Display name for the organization + /// + /// - Remark: Generated from `#/components/schemas/organization/name`. + public var name: Swift.String? + /// Display company name for the organization + /// + /// - Remark: Generated from `#/components/schemas/organization/company`. + public var company: Swift.String? + /// Display location for the organization + /// + /// - Remark: Generated from `#/components/schemas/organization/location`. + public var location: Swift.String? + /// Display email for the organization + /// + /// - Remark: Generated from `#/components/schemas/organization/email`. + public var email: Swift.String? + /// Specifies if organization projects are enabled for this org + /// + /// - Remark: Generated from `#/components/schemas/organization/has_organization_projects`. + public var has_organization_projects: Swift.Bool + /// Specifies if repository projects are enabled for repositories that belong to this org + /// + /// - Remark: Generated from `#/components/schemas/organization/has_repository_projects`. + public var has_repository_projects: Swift.Bool + /// - Remark: Generated from `#/components/schemas/organization/is_verified`. + public var is_verified: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization/public_repos`. + public var public_repos: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization/public_gists`. + public var public_gists: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization/followers`. + public var followers: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization/following`. + public var following: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/organization/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/organization/updated_at`. + public var updated_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/organization/plan`. + public struct planPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/organization/plan/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization/plan/space`. + public var space: Swift.Int? + /// - Remark: Generated from `#/components/schemas/organization/plan/private_repos`. + public var private_repos: Swift.Int? + /// - Remark: Generated from `#/components/schemas/organization/plan/filled_seats`. + public var filled_seats: Swift.Int? + /// - Remark: Generated from `#/components/schemas/organization/plan/seats`. + public var seats: Swift.Int? + /// Creates a new `planPayload`. + /// + /// - Parameters: + /// - name: + /// - space: + /// - private_repos: + /// - filled_seats: + /// - seats: + public init( + name: Swift.String? = nil, + space: Swift.Int? = nil, + private_repos: Swift.Int? = nil, + filled_seats: Swift.Int? = nil, + seats: Swift.Int? = nil + ) { + self.name = name + self.space = space + self.private_repos = private_repos + self.filled_seats = filled_seats + self.seats = seats + } + public enum CodingKeys: String, CodingKey { + case name + case space + case private_repos + case filled_seats + case seats + } + } + /// - Remark: Generated from `#/components/schemas/organization/plan`. + public var plan: Components.Schemas.organization.planPayload? + /// Creates a new `organization`. + /// + /// - Parameters: + /// - login: Unique login name of the organization + /// - url: URL for the organization + /// - id: + /// - node_id: + /// - repos_url: + /// - events_url: + /// - hooks_url: + /// - issues_url: + /// - members_url: + /// - public_members_url: + /// - avatar_url: + /// - description: + /// - blog: Display blog url for the organization + /// - html_url: + /// - name: Display name for the organization + /// - company: Display company name for the organization + /// - location: Display location for the organization + /// - email: Display email for the organization + /// - has_organization_projects: Specifies if organization projects are enabled for this org + /// - has_repository_projects: Specifies if repository projects are enabled for repositories that belong to this org + /// - is_verified: + /// - public_repos: + /// - public_gists: + /// - followers: + /// - following: + /// - _type: + /// - created_at: + /// - updated_at: + /// - plan: + public init( + login: Swift.String, + url: Swift.String, + id: Swift.Int, + node_id: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + hooks_url: Swift.String, issues_url: Swift.String, members_url: Swift.String, public_members_url: Swift.String, avatar_url: Swift.String, - description: Swift.String? = nil + description: Swift.String? = nil, + blog: Swift.String? = nil, + html_url: Swift.String, + name: Swift.String? = nil, + company: Swift.String? = nil, + location: Swift.String? = nil, + email: Swift.String? = nil, + has_organization_projects: Swift.Bool, + has_repository_projects: Swift.Bool, + is_verified: Swift.Bool? = nil, + public_repos: Swift.Int, + public_gists: Swift.Int, + followers: Swift.Int, + following: Swift.Int, + _type: Swift.String, + created_at: Foundation.Date, + updated_at: Foundation.Date, + plan: Components.Schemas.organization.planPayload? = nil ) { self.login = login + self.url = url self.id = id self.node_id = node_id - self.url = url self.repos_url = repos_url self.events_url = events_url self.hooks_url = hooks_url @@ -960,12 +1078,29 @@ public enum Components { self.public_members_url = public_members_url self.avatar_url = avatar_url self.description = description + self.blog = blog + self.html_url = html_url + self.name = name + self.company = company + self.location = location + self.email = email + self.has_organization_projects = has_organization_projects + self.has_repository_projects = has_repository_projects + self.is_verified = is_verified + self.public_repos = public_repos + self.public_gists = public_gists + self.followers = followers + self.following = following + self._type = _type + self.created_at = created_at + self.updated_at = updated_at + self.plan = plan } public enum CodingKeys: String, CodingKey { case login + case url case id case node_id - case url case repos_url case events_url case hooks_url @@ -974,1033 +1109,942 @@ public enum Components { case public_members_url case avatar_url case description - } - } - /// The breakdown of Copilot Business seats for the organization. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown`. - public struct copilot_hyphen_seat_hyphen_breakdown: Codable, Hashable, Sendable { - /// The total number of seats being billed for the organization as of the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/total`. - public var total: Swift.Int? - /// Seats added during the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/added_this_cycle`. - public var added_this_cycle: Swift.Int? - /// The number of seats that are pending cancellation at the end of the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/pending_cancellation`. - public var pending_cancellation: Swift.Int? - /// The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/pending_invitation`. - public var pending_invitation: Swift.Int? - /// The number of seats that have used Copilot during the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/active_this_cycle`. - public var active_this_cycle: Swift.Int? - /// The number of seats that have not used Copilot during the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/inactive_this_cycle`. - public var inactive_this_cycle: Swift.Int? - /// Creates a new `copilot_hyphen_seat_hyphen_breakdown`. + case blog + case html_url + case name + case company + case location + case email + case has_organization_projects + case has_repository_projects + case is_verified + case public_repos + case public_gists + case followers + case following + case _type = "type" + case created_at + case updated_at + case plan + } + } + /// A GitHub organization. + /// + /// - Remark: Generated from `#/components/schemas/organization-simple`. + public struct organization_hyphen_simple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/organization-simple/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization-simple/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/hooks_url`. + public var hooks_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/issues_url`. + public var issues_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/public_members_url`. + public var public_members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/description`. + public var description: Swift.String? + /// Creates a new `organization_hyphen_simple`. /// /// - Parameters: - /// - total: The total number of seats being billed for the organization as of the current billing cycle. - /// - added_this_cycle: Seats added during the current billing cycle. - /// - pending_cancellation: The number of seats that are pending cancellation at the end of the current billing cycle. - /// - pending_invitation: The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. - /// - active_this_cycle: The number of seats that have used Copilot during the current billing cycle. - /// - inactive_this_cycle: The number of seats that have not used Copilot during the current billing cycle. + /// - login: + /// - id: + /// - node_id: + /// - url: + /// - repos_url: + /// - events_url: + /// - hooks_url: + /// - issues_url: + /// - members_url: + /// - public_members_url: + /// - avatar_url: + /// - description: public init( - total: Swift.Int? = nil, - added_this_cycle: Swift.Int? = nil, - pending_cancellation: Swift.Int? = nil, - pending_invitation: Swift.Int? = nil, - active_this_cycle: Swift.Int? = nil, - inactive_this_cycle: Swift.Int? = nil + login: Swift.String, + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + hooks_url: Swift.String, + issues_url: Swift.String, + members_url: Swift.String, + public_members_url: Swift.String, + avatar_url: Swift.String, + description: Swift.String? = nil ) { - self.total = total - self.added_this_cycle = added_this_cycle - self.pending_cancellation = pending_cancellation - self.pending_invitation = pending_invitation - self.active_this_cycle = active_this_cycle - self.inactive_this_cycle = inactive_this_cycle + self.login = login + self.id = id + self.node_id = node_id + self.url = url + self.repos_url = repos_url + self.events_url = events_url + self.hooks_url = hooks_url + self.issues_url = issues_url + self.members_url = members_url + self.public_members_url = public_members_url + self.avatar_url = avatar_url + self.description = description } public enum CodingKeys: String, CodingKey { - case total - case added_this_cycle - case pending_cancellation - case pending_invitation - case active_this_cycle - case inactive_this_cycle + case login + case id + case node_id + case url + case repos_url + case events_url + case hooks_url + case issues_url + case members_url + case public_members_url + case avatar_url + case description } } - /// Information about the seat breakdown and policies set for an organization with a Copilot Business subscription. + /// Group of enterprise owners and/or members /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details`. - public struct copilot_hyphen_organization_hyphen_details: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_breakdown`. - public var seat_breakdown: Components.Schemas.copilot_hyphen_seat_hyphen_breakdown - /// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. - @frozen public enum public_code_suggestionsPayload: String, Codable, Hashable, Sendable { - case allow = "allow" - case block = "block" - case unconfigured = "unconfigured" - case unknown = "unknown" - } - /// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. - public var public_code_suggestions: Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload - /// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. + /// - Remark: Generated from `#/components/schemas/enterprise-team`. + public struct enterprise_hyphen_team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. + public var sync_to_organizations: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. + public var group_id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. + public var updated_at: Foundation.Date + /// Creates a new `enterprise_hyphen_team`. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. - @frozen public enum ide_chatPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case unconfigured = "unconfigured" + /// - Parameters: + /// - id: + /// - name: + /// - slug: + /// - url: + /// - sync_to_organizations: + /// - group_id: + /// - html_url: + /// - members_url: + /// - created_at: + /// - updated_at: + public init( + id: Swift.Int, + name: Swift.String, + slug: Swift.String, + url: Swift.String, + sync_to_organizations: Swift.String, + group_id: Swift.Int? = nil, + html_url: Swift.String, + members_url: Swift.String, + created_at: Foundation.Date, + updated_at: Foundation.Date + ) { + self.id = id + self.name = name + self.slug = slug + self.url = url + self.sync_to_organizations = sync_to_organizations + self.group_id = group_id + self.html_url = html_url + self.members_url = members_url + self.created_at = created_at + self.updated_at = updated_at } - /// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. - public var ide_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload? - /// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. - @frozen public enum platform_chatPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case unconfigured = "unconfigured" + public enum CodingKeys: String, CodingKey { + case id + case name + case slug + case url + case sync_to_organizations + case group_id + case html_url + case members_url + case created_at + case updated_at } - /// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. - public var platform_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload? - /// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. + } + /// Information about a Copilot Business seat assignment for a user, team, or organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details`. + public struct copilot_hyphen_seat_hyphen_details: Codable, Hashable, Sendable { + /// The assignee that has been granted access to GitHub Copilot. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. - @frozen public enum cliPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case unconfigured = "unconfigured" + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee`. + @frozen public enum assigneePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee/case1`. + case simple_hyphen_user(Components.Schemas.simple_hyphen_user) + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee/case2`. + case team(Components.Schemas.team) + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee/case3`. + case organization(Components.Schemas.organization) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .simple_hyphen_user(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .team(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .organization(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .simple_hyphen_user(value): + try value.encode(to: encoder) + case let .team(value): + try value.encode(to: encoder) + case let .organization(value): + try value.encode(to: encoder) + } + } } - /// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. + /// The assignee that has been granted access to GitHub Copilot. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. - public var cli: Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload? - /// The mode of assigning new seats. + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee`. + public var assignee: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigneePayload + /// The organization to which this seat belongs. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. - @frozen public enum seat_management_settingPayload: String, Codable, Hashable, Sendable { - case assign_all = "assign_all" - case assign_selected = "assign_selected" - case disabled = "disabled" - case unconfigured = "unconfigured" + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization`. + @frozen public enum organizationPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization/case1`. + case organization_hyphen_simple(Components.Schemas.organization_hyphen_simple) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .organization_hyphen_simple(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .organization_hyphen_simple(value): + try value.encode(to: encoder) + } + } } - /// The mode of assigning new seats. + /// The organization to which this seat belongs. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. - public var seat_management_setting: Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `copilot_hyphen_organization_hyphen_details`. + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization`. + public var organization: Components.Schemas.copilot_hyphen_seat_hyphen_details.organizationPayload? + /// The team through which the assignee is granted access to GitHub Copilot, if applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. + @frozen public enum assigning_teamPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team/case1`. + case team(Components.Schemas.team) + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team/case2`. + case enterprise_hyphen_team(Components.Schemas.enterprise_hyphen_team) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .team(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .enterprise_hyphen_team(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .team(value): + try value.encode(to: encoder) + case let .enterprise_hyphen_team(value): + try value.encode(to: encoder) + } + } + } + /// The team through which the assignee is granted access to GitHub Copilot, if applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. + public var assigning_team: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigning_teamPayload? + /// The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/pending_cancellation_date`. + public var pending_cancellation_date: Swift.String? + /// Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_at`. + public var last_activity_at: Foundation.Date? + /// Last editor that was used by the user for a GitHub Copilot completion. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_editor`. + public var last_activity_editor: Swift.String? + /// Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/created_at`. + public var created_at: Foundation.Date + /// Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/updated_at`. + public var updated_at: Foundation.Date? + /// Creates a new `copilot_hyphen_seat_hyphen_details`. /// /// - Parameters: - /// - seat_breakdown: - /// - public_code_suggestions: The organization policy for allowing or disallowing Copilot to make suggestions that match public code. - /// - ide_chat: The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. - /// - platform_chat: The organization policy for allowing or disallowing organization members to use Copilot features within github.com. - /// - cli: The organization policy for allowing or disallowing organization members to use Copilot within their CLI. - /// - seat_management_setting: The mode of assigning new seats. - /// - additionalProperties: A container of undocumented properties. + /// - assignee: The assignee that has been granted access to GitHub Copilot. + /// - organization: The organization to which this seat belongs. + /// - assigning_team: The team through which the assignee is granted access to GitHub Copilot, if applicable. + /// - pending_cancellation_date: The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. + /// - last_activity_at: Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. + /// - last_activity_editor: Last editor that was used by the user for a GitHub Copilot completion. + /// - created_at: Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. + /// - updated_at: Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. public init( - seat_breakdown: Components.Schemas.copilot_hyphen_seat_hyphen_breakdown, - public_code_suggestions: Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload, - ide_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload? = nil, - platform_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload? = nil, - cli: Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload? = nil, - seat_management_setting: Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + assignee: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigneePayload, + organization: Components.Schemas.copilot_hyphen_seat_hyphen_details.organizationPayload? = nil, + assigning_team: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigning_teamPayload? = nil, + pending_cancellation_date: Swift.String? = nil, + last_activity_at: Foundation.Date? = nil, + last_activity_editor: Swift.String? = nil, + created_at: Foundation.Date, + updated_at: Foundation.Date? = nil ) { - self.seat_breakdown = seat_breakdown - self.public_code_suggestions = public_code_suggestions - self.ide_chat = ide_chat - self.platform_chat = platform_chat - self.cli = cli - self.seat_management_setting = seat_management_setting - self.additionalProperties = additionalProperties + self.assignee = assignee + self.organization = organization + self.assigning_team = assigning_team + self.pending_cancellation_date = pending_cancellation_date + self.last_activity_at = last_activity_at + self.last_activity_editor = last_activity_editor + self.created_at = created_at + self.updated_at = updated_at } public enum CodingKeys: String, CodingKey { - case seat_breakdown - case public_code_suggestions - case ide_chat - case platform_chat - case cli - case seat_management_setting + case assignee + case organization + case assigning_team + case pending_cancellation_date + case last_activity_at + case last_activity_editor + case created_at + case updated_at } public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - seat_breakdown = try container.decode( - Components.Schemas.copilot_hyphen_seat_hyphen_breakdown.self, - forKey: .seat_breakdown + assignee = try container.decode( + Components.Schemas.copilot_hyphen_seat_hyphen_details.assigneePayload.self, + forKey: .assignee ) - public_code_suggestions = try container.decode( - Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload.self, - forKey: .public_code_suggestions + organization = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_seat_hyphen_details.organizationPayload.self, + forKey: .organization ) - ide_chat = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload.self, - forKey: .ide_chat + assigning_team = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_seat_hyphen_details.assigning_teamPayload.self, + forKey: .assigning_team ) - platform_chat = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload.self, - forKey: .platform_chat + pending_cancellation_date = try container.decodeIfPresent( + Swift.String.self, + forKey: .pending_cancellation_date ) - cli = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload.self, - forKey: .cli + last_activity_at = try container.decodeIfPresent( + Foundation.Date.self, + forKey: .last_activity_at ) - seat_management_setting = try container.decode( - Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload.self, - forKey: .seat_management_setting + last_activity_editor = try container.decodeIfPresent( + Swift.String.self, + forKey: .last_activity_editor ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "seat_breakdown", - "public_code_suggestions", - "ide_chat", - "platform_chat", - "cli", - "seat_management_setting" - ]) - } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode( - seat_breakdown, - forKey: .seat_breakdown - ) - try container.encode( - public_code_suggestions, - forKey: .public_code_suggestions - ) - try container.encodeIfPresent( - ide_chat, - forKey: .ide_chat - ) - try container.encodeIfPresent( - platform_chat, - forKey: .platform_chat - ) - try container.encodeIfPresent( - cli, - forKey: .cli + created_at = try container.decode( + Foundation.Date.self, + forKey: .created_at ) - try container.encode( - seat_management_setting, - forKey: .seat_management_setting + updated_at = try container.decodeIfPresent( + Foundation.Date.self, + forKey: .updated_at ) - try encoder.encodeAdditionalProperties(additionalProperties) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "assignee", + "organization", + "assigning_team", + "pending_cancellation_date", + "last_activity_at", + "last_activity_editor", + "created_at", + "updated_at" + ]) } } - /// Groups of organization members that gives permissions on specified repositories. + /// Summary of Copilot usage. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics`. + public struct copilot_hyphen_usage_hyphen_metrics: Codable, Hashable, Sendable { + /// The date for which the usage metrics are reported, in `YYYY-MM-DD` format. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var node_id: Swift.String - /// URL for the team + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/day`. + public var day: Swift.String + /// The total number of Copilot code completion suggestions shown to users. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_suggestions_count`. + public var total_suggestions_count: Swift.Int? + /// The total number of Copilot code completion suggestions accepted by users. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. - public var name: Swift.String - /// Description of the team + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_acceptances_count`. + public var total_acceptances_count: Swift.Int? + /// The total number of lines of code completions suggested by Copilot. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. - public var description: Swift.String? - /// Permission that the team will have for its repositories + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_lines_suggested`. + public var total_lines_suggested: Swift.Int? + /// The total number of lines of code completions accepted by users. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_lines_accepted`. + public var total_lines_accepted: Swift.Int? + /// The total number of users who were shown Copilot code completion suggestions during the day specified. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_active_users`. + public var total_active_users: Swift.Int? + /// The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_chat_acceptances`. + public var total_chat_acceptances: Swift.Int? + /// The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_chat_turns`. + public var total_chat_turns: Swift.Int? + /// The total number of users who interacted with Copilot Chat in the IDE during the day specified. /// - /// - Parameters: - /// - id: Unique identifier of the team - /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set - /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment - public init( - id: Swift.Int, - node_id: Swift.String, - url: Swift.String, - members_url: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil - ) { - self.id = id - self.node_id = node_id - self.url = url - self.members_url = members_url - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting - self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case url - case members_url - case name - case description - case permission - case privacy - case notification_setting - case html_url - case repositories_url - case slug - case ldap_dn - } - } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_active_chat_users`. + public var total_active_chat_users: Swift.Int? + /// Breakdown of Copilot usage by editor for this language + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload`. + public struct breakdownPayloadPayload: Codable, Hashable, Sendable { + /// The language in which Copilot suggestions were shown to users in the specified editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/language`. + public var language: Swift.String? + /// The editor in which Copilot suggestions were shown to users for the specified language. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/editor`. + public var editor: Swift.String? + /// The number of Copilot suggestions shown to users in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/suggestions_count`. + public var suggestions_count: Swift.Int? + /// The number of Copilot suggestions accepted by users in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/acceptances_count`. + public var acceptances_count: Swift.Int? + /// The number of lines of code suggested by Copilot in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/lines_suggested`. + public var lines_suggested: Swift.Int? + /// The number of lines of code accepted by users in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/lines_accepted`. + public var lines_accepted: Swift.Int? + /// The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/active_users`. + public var active_users: Swift.Int? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `breakdownPayloadPayload`. /// /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: + /// - language: The language in which Copilot suggestions were shown to users in the specified editor. + /// - editor: The editor in which Copilot suggestions were shown to users for the specified language. + /// - suggestions_count: The number of Copilot suggestions shown to users in the editor specified during the day specified. + /// - acceptances_count: The number of Copilot suggestions accepted by users in the editor specified during the day specified. + /// - lines_suggested: The number of lines of code suggested by Copilot in the editor specified during the day specified. + /// - lines_accepted: The number of lines of code accepted by users in the editor specified during the day specified. + /// - active_users: The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. + /// - additionalProperties: A container of undocumented properties. public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool + language: Swift.String? = nil, + editor: Swift.String? = nil, + suggestions_count: Swift.Int? = nil, + acceptances_count: Swift.Int? = nil, + lines_suggested: Swift.Int? = nil, + lines_accepted: Swift.Int? = nil, + active_users: Swift.Int? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin + self.language = language + self.editor = editor + self.suggestions_count = suggestions_count + self.acceptances_count = acceptances_count + self.lines_suggested = lines_suggested + self.lines_accepted = lines_accepted + self.active_users = active_users + self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin + case language + case editor + case suggestions_count + case acceptances_count + case lines_suggested + case lines_accepted + case active_users } - } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil - ) { - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent - } - } - /// GitHub account for managing multiple users, teams, and repositories - /// - /// - Remark: Generated from `#/components/schemas/organization`. - public struct organization: Codable, Hashable, Sendable { - /// Unique login name of the organization - /// - /// - Remark: Generated from `#/components/schemas/organization/login`. - public var login: Swift.String - /// URL for the organization - /// - /// - Remark: Generated from `#/components/schemas/organization/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/organization/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization/hooks_url`. - public var hooks_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization/issues_url`. - public var issues_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization/public_members_url`. - public var public_members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization/avatar_url`. - public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization/description`. - public var description: Swift.String? - /// Display blog url for the organization - /// - /// - Remark: Generated from `#/components/schemas/organization/blog`. - public var blog: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization/html_url`. - public var html_url: Swift.String - /// Display name for the organization - /// - /// - Remark: Generated from `#/components/schemas/organization/name`. - public var name: Swift.String? - /// Display company name for the organization - /// - /// - Remark: Generated from `#/components/schemas/organization/company`. - public var company: Swift.String? - /// Display location for the organization - /// - /// - Remark: Generated from `#/components/schemas/organization/location`. - public var location: Swift.String? - /// Display email for the organization - /// - /// - Remark: Generated from `#/components/schemas/organization/email`. - public var email: Swift.String? - /// Specifies if organization projects are enabled for this org - /// - /// - Remark: Generated from `#/components/schemas/organization/has_organization_projects`. - public var has_organization_projects: Swift.Bool - /// Specifies if repository projects are enabled for repositories that belong to this org - /// - /// - Remark: Generated from `#/components/schemas/organization/has_repository_projects`. - public var has_repository_projects: Swift.Bool - /// - Remark: Generated from `#/components/schemas/organization/is_verified`. - public var is_verified: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/organization/public_repos`. - public var public_repos: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization/public_gists`. - public var public_gists: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization/followers`. - public var followers: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization/following`. - public var following: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/organization/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/organization/updated_at`. - public var updated_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/organization/plan`. - public struct planPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/organization/plan/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization/plan/space`. - public var space: Swift.Int? - /// - Remark: Generated from `#/components/schemas/organization/plan/private_repos`. - public var private_repos: Swift.Int? - /// - Remark: Generated from `#/components/schemas/organization/plan/filled_seats`. - public var filled_seats: Swift.Int? - /// - Remark: Generated from `#/components/schemas/organization/plan/seats`. - public var seats: Swift.Int? - /// Creates a new `planPayload`. - /// - /// - Parameters: - /// - name: - /// - space: - /// - private_repos: - /// - filled_seats: - /// - seats: - public init( - name: Swift.String? = nil, - space: Swift.Int? = nil, - private_repos: Swift.Int? = nil, - filled_seats: Swift.Int? = nil, - seats: Swift.Int? = nil - ) { - self.name = name - self.space = space - self.private_repos = private_repos - self.filled_seats = filled_seats - self.seats = seats + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + language = try container.decodeIfPresent( + Swift.String.self, + forKey: .language + ) + editor = try container.decodeIfPresent( + Swift.String.self, + forKey: .editor + ) + suggestions_count = try container.decodeIfPresent( + Swift.Int.self, + forKey: .suggestions_count + ) + acceptances_count = try container.decodeIfPresent( + Swift.Int.self, + forKey: .acceptances_count + ) + lines_suggested = try container.decodeIfPresent( + Swift.Int.self, + forKey: .lines_suggested + ) + lines_accepted = try container.decodeIfPresent( + Swift.Int.self, + forKey: .lines_accepted + ) + active_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .active_users + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "language", + "editor", + "suggestions_count", + "acceptances_count", + "lines_suggested", + "lines_accepted", + "active_users" + ]) } - public enum CodingKeys: String, CodingKey { - case name - case space - case private_repos - case filled_seats - case seats + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + language, + forKey: .language + ) + try container.encodeIfPresent( + editor, + forKey: .editor + ) + try container.encodeIfPresent( + suggestions_count, + forKey: .suggestions_count + ) + try container.encodeIfPresent( + acceptances_count, + forKey: .acceptances_count + ) + try container.encodeIfPresent( + lines_suggested, + forKey: .lines_suggested + ) + try container.encodeIfPresent( + lines_accepted, + forKey: .lines_accepted + ) + try container.encodeIfPresent( + active_users, + forKey: .active_users + ) + try encoder.encodeAdditionalProperties(additionalProperties) } } - /// - Remark: Generated from `#/components/schemas/organization/plan`. - public var plan: Components.Schemas.organization.planPayload? - /// Creates a new `organization`. + /// Breakdown of Copilot code completions usage by language and editor + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdown`. + public typealias breakdownPayload = [Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayloadPayload] + /// Breakdown of Copilot code completions usage by language and editor + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdown`. + public var breakdown: Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload? + /// Creates a new `copilot_hyphen_usage_hyphen_metrics`. /// /// - Parameters: - /// - login: Unique login name of the organization - /// - url: URL for the organization - /// - id: - /// - node_id: - /// - repos_url: - /// - events_url: - /// - hooks_url: - /// - issues_url: - /// - members_url: - /// - public_members_url: - /// - avatar_url: - /// - description: - /// - blog: Display blog url for the organization - /// - html_url: - /// - name: Display name for the organization - /// - company: Display company name for the organization - /// - location: Display location for the organization - /// - email: Display email for the organization - /// - has_organization_projects: Specifies if organization projects are enabled for this org - /// - has_repository_projects: Specifies if repository projects are enabled for repositories that belong to this org - /// - is_verified: - /// - public_repos: - /// - public_gists: - /// - followers: - /// - following: - /// - _type: - /// - created_at: - /// - updated_at: - /// - plan: + /// - day: The date for which the usage metrics are reported, in `YYYY-MM-DD` format. + /// - total_suggestions_count: The total number of Copilot code completion suggestions shown to users. + /// - total_acceptances_count: The total number of Copilot code completion suggestions accepted by users. + /// - total_lines_suggested: The total number of lines of code completions suggested by Copilot. + /// - total_lines_accepted: The total number of lines of code completions accepted by users. + /// - total_active_users: The total number of users who were shown Copilot code completion suggestions during the day specified. + /// - total_chat_acceptances: The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). + /// - total_chat_turns: The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. + /// - total_active_chat_users: The total number of users who interacted with Copilot Chat in the IDE during the day specified. + /// - breakdown: Breakdown of Copilot code completions usage by language and editor public init( - login: Swift.String, - url: Swift.String, - id: Swift.Int, - node_id: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - hooks_url: Swift.String, - issues_url: Swift.String, - members_url: Swift.String, - public_members_url: Swift.String, - avatar_url: Swift.String, - description: Swift.String? = nil, - blog: Swift.String? = nil, - html_url: Swift.String, - name: Swift.String? = nil, - company: Swift.String? = nil, - location: Swift.String? = nil, - email: Swift.String? = nil, - has_organization_projects: Swift.Bool, - has_repository_projects: Swift.Bool, - is_verified: Swift.Bool? = nil, - public_repos: Swift.Int, - public_gists: Swift.Int, - followers: Swift.Int, - following: Swift.Int, - _type: Swift.String, - created_at: Foundation.Date, - updated_at: Foundation.Date, - plan: Components.Schemas.organization.planPayload? = nil + day: Swift.String, + total_suggestions_count: Swift.Int? = nil, + total_acceptances_count: Swift.Int? = nil, + total_lines_suggested: Swift.Int? = nil, + total_lines_accepted: Swift.Int? = nil, + total_active_users: Swift.Int? = nil, + total_chat_acceptances: Swift.Int? = nil, + total_chat_turns: Swift.Int? = nil, + total_active_chat_users: Swift.Int? = nil, + breakdown: Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload? = nil ) { - self.login = login - self.url = url - self.id = id - self.node_id = node_id - self.repos_url = repos_url - self.events_url = events_url - self.hooks_url = hooks_url - self.issues_url = issues_url - self.members_url = members_url - self.public_members_url = public_members_url - self.avatar_url = avatar_url - self.description = description - self.blog = blog - self.html_url = html_url - self.name = name - self.company = company - self.location = location - self.email = email - self.has_organization_projects = has_organization_projects - self.has_repository_projects = has_repository_projects - self.is_verified = is_verified - self.public_repos = public_repos - self.public_gists = public_gists - self.followers = followers - self.following = following - self._type = _type - self.created_at = created_at - self.updated_at = updated_at - self.plan = plan + self.day = day + self.total_suggestions_count = total_suggestions_count + self.total_acceptances_count = total_acceptances_count + self.total_lines_suggested = total_lines_suggested + self.total_lines_accepted = total_lines_accepted + self.total_active_users = total_active_users + self.total_chat_acceptances = total_chat_acceptances + self.total_chat_turns = total_chat_turns + self.total_active_chat_users = total_active_chat_users + self.breakdown = breakdown } public enum CodingKeys: String, CodingKey { - case login - case url - case id - case node_id - case repos_url - case events_url - case hooks_url - case issues_url - case members_url - case public_members_url - case avatar_url - case description - case blog - case html_url - case name - case company - case location - case email - case has_organization_projects - case has_repository_projects - case is_verified - case public_repos - case public_gists - case followers - case following - case _type = "type" - case created_at - case updated_at - case plan + case day + case total_suggestions_count + case total_acceptances_count + case total_lines_suggested + case total_lines_accepted + case total_active_users + case total_chat_acceptances + case total_chat_turns + case total_active_chat_users + case breakdown + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + day = try container.decode( + Swift.String.self, + forKey: .day + ) + total_suggestions_count = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_suggestions_count + ) + total_acceptances_count = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_acceptances_count + ) + total_lines_suggested = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_lines_suggested + ) + total_lines_accepted = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_lines_accepted + ) + total_active_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_active_users + ) + total_chat_acceptances = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_chat_acceptances + ) + total_chat_turns = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_chat_turns + ) + total_active_chat_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_active_chat_users + ) + breakdown = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload.self, + forKey: .breakdown + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "day", + "total_suggestions_count", + "total_acceptances_count", + "total_lines_suggested", + "total_lines_accepted", + "total_active_users", + "total_chat_acceptances", + "total_chat_turns", + "total_active_chat_users", + "breakdown" + ]) } } - /// Group of enterprise owners and/or members + /// The breakdown of Copilot Business seats for the organization. /// - /// - Remark: Generated from `#/components/schemas/enterprise-team`. - public struct enterprise_hyphen_team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. - public var sync_to_organizations: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. - public var group_id: Swift.Int? - /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. - public var updated_at: Foundation.Date - /// Creates a new `enterprise_hyphen_team`. + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown`. + public struct copilot_hyphen_seat_hyphen_breakdown: Codable, Hashable, Sendable { + /// The total number of seats being billed for the organization as of the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/total`. + public var total: Swift.Int? + /// Seats added during the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/added_this_cycle`. + public var added_this_cycle: Swift.Int? + /// The number of seats that are pending cancellation at the end of the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/pending_cancellation`. + public var pending_cancellation: Swift.Int? + /// The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/pending_invitation`. + public var pending_invitation: Swift.Int? + /// The number of seats that have used Copilot during the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/active_this_cycle`. + public var active_this_cycle: Swift.Int? + /// The number of seats that have not used Copilot during the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/inactive_this_cycle`. + public var inactive_this_cycle: Swift.Int? + /// Creates a new `copilot_hyphen_seat_hyphen_breakdown`. /// /// - Parameters: - /// - id: - /// - name: - /// - slug: - /// - url: - /// - sync_to_organizations: - /// - group_id: - /// - html_url: - /// - members_url: - /// - created_at: - /// - updated_at: + /// - total: The total number of seats being billed for the organization as of the current billing cycle. + /// - added_this_cycle: Seats added during the current billing cycle. + /// - pending_cancellation: The number of seats that are pending cancellation at the end of the current billing cycle. + /// - pending_invitation: The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. + /// - active_this_cycle: The number of seats that have used Copilot during the current billing cycle. + /// - inactive_this_cycle: The number of seats that have not used Copilot during the current billing cycle. public init( - id: Swift.Int, - name: Swift.String, - slug: Swift.String, - url: Swift.String, - sync_to_organizations: Swift.String, - group_id: Swift.Int? = nil, - html_url: Swift.String, - members_url: Swift.String, - created_at: Foundation.Date, - updated_at: Foundation.Date + total: Swift.Int? = nil, + added_this_cycle: Swift.Int? = nil, + pending_cancellation: Swift.Int? = nil, + pending_invitation: Swift.Int? = nil, + active_this_cycle: Swift.Int? = nil, + inactive_this_cycle: Swift.Int? = nil ) { - self.id = id - self.name = name - self.slug = slug - self.url = url - self.sync_to_organizations = sync_to_organizations - self.group_id = group_id - self.html_url = html_url - self.members_url = members_url - self.created_at = created_at - self.updated_at = updated_at + self.total = total + self.added_this_cycle = added_this_cycle + self.pending_cancellation = pending_cancellation + self.pending_invitation = pending_invitation + self.active_this_cycle = active_this_cycle + self.inactive_this_cycle = inactive_this_cycle } public enum CodingKeys: String, CodingKey { - case id - case name - case slug - case url - case sync_to_organizations - case group_id - case html_url - case members_url - case created_at - case updated_at + case total + case added_this_cycle + case pending_cancellation + case pending_invitation + case active_this_cycle + case inactive_this_cycle } } - /// Information about a Copilot Business seat assignment for a user, team, or organization. + /// Information about the seat breakdown and policies set for an organization with a Copilot Business subscription. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details`. - public struct copilot_hyphen_seat_hyphen_details: Codable, Hashable, Sendable { - /// The assignee that has been granted access to GitHub Copilot. + /// - Remark: Generated from `#/components/schemas/copilot-organization-details`. + public struct copilot_hyphen_organization_hyphen_details: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_breakdown`. + public var seat_breakdown: Components.Schemas.copilot_hyphen_seat_hyphen_breakdown + /// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee`. - @frozen public enum assigneePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee/case1`. - case simple_hyphen_user(Components.Schemas.simple_hyphen_user) - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee/case2`. - case team(Components.Schemas.team) - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee/case3`. - case organization(Components.Schemas.organization) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .simple_hyphen_user(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .team(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .organization(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .simple_hyphen_user(value): - try value.encode(to: encoder) - case let .team(value): - try value.encode(to: encoder) - case let .organization(value): - try value.encode(to: encoder) - } - } + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. + @frozen public enum public_code_suggestionsPayload: String, Codable, Hashable, Sendable { + case allow = "allow" + case block = "block" + case unconfigured = "unconfigured" + case unknown = "unknown" } - /// The assignee that has been granted access to GitHub Copilot. + /// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee`. - public var assignee: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigneePayload - /// The organization to which this seat belongs. + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. + public var public_code_suggestions: Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload + /// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization`. - @frozen public enum organizationPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization/case1`. - case organization_hyphen_simple(Components.Schemas.organization_hyphen_simple) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .organization_hyphen_simple(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .organization_hyphen_simple(value): - try value.encode(to: encoder) - } - } + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. + @frozen public enum ide_chatPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case unconfigured = "unconfigured" } - /// The organization to which this seat belongs. + /// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization`. - public var organization: Components.Schemas.copilot_hyphen_seat_hyphen_details.organizationPayload? - /// The team through which the assignee is granted access to GitHub Copilot, if applicable. + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. + public var ide_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload? + /// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. - @frozen public enum assigning_teamPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team/case1`. - case team(Components.Schemas.team) - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team/case2`. - case enterprise_hyphen_team(Components.Schemas.enterprise_hyphen_team) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .team(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .enterprise_hyphen_team(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .team(value): - try value.encode(to: encoder) - case let .enterprise_hyphen_team(value): - try value.encode(to: encoder) - } - } + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. + @frozen public enum platform_chatPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case unconfigured = "unconfigured" } - /// The team through which the assignee is granted access to GitHub Copilot, if applicable. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. - public var assigning_team: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigning_teamPayload? - /// The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. + /// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/pending_cancellation_date`. - public var pending_cancellation_date: Swift.String? - /// Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. + public var platform_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload? + /// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_at`. - public var last_activity_at: Foundation.Date? - /// Last editor that was used by the user for a GitHub Copilot completion. + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. + @frozen public enum cliPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_editor`. - public var last_activity_editor: Swift.String? - /// Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. + public var cli: Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload? + /// The mode of assigning new seats. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/created_at`. - public var created_at: Foundation.Date - /// Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. + @frozen public enum seat_management_settingPayload: String, Codable, Hashable, Sendable { + case assign_all = "assign_all" + case assign_selected = "assign_selected" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The mode of assigning new seats. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/updated_at`. - public var updated_at: Foundation.Date? - /// Creates a new `copilot_hyphen_seat_hyphen_details`. + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. + public var seat_management_setting: Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `copilot_hyphen_organization_hyphen_details`. /// /// - Parameters: - /// - assignee: The assignee that has been granted access to GitHub Copilot. - /// - organization: The organization to which this seat belongs. - /// - assigning_team: The team through which the assignee is granted access to GitHub Copilot, if applicable. - /// - pending_cancellation_date: The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. - /// - last_activity_at: Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. - /// - last_activity_editor: Last editor that was used by the user for a GitHub Copilot completion. - /// - created_at: Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. - /// - updated_at: Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. + /// - seat_breakdown: + /// - public_code_suggestions: The organization policy for allowing or disallowing Copilot to make suggestions that match public code. + /// - ide_chat: The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. + /// - platform_chat: The organization policy for allowing or disallowing organization members to use Copilot features within github.com. + /// - cli: The organization policy for allowing or disallowing organization members to use Copilot within their CLI. + /// - seat_management_setting: The mode of assigning new seats. + /// - additionalProperties: A container of undocumented properties. public init( - assignee: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigneePayload, - organization: Components.Schemas.copilot_hyphen_seat_hyphen_details.organizationPayload? = nil, - assigning_team: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigning_teamPayload? = nil, - pending_cancellation_date: Swift.String? = nil, - last_activity_at: Foundation.Date? = nil, - last_activity_editor: Swift.String? = nil, - created_at: Foundation.Date, - updated_at: Foundation.Date? = nil + seat_breakdown: Components.Schemas.copilot_hyphen_seat_hyphen_breakdown, + public_code_suggestions: Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload, + ide_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload? = nil, + platform_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload? = nil, + cli: Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload? = nil, + seat_management_setting: Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { - self.assignee = assignee - self.organization = organization - self.assigning_team = assigning_team - self.pending_cancellation_date = pending_cancellation_date - self.last_activity_at = last_activity_at - self.last_activity_editor = last_activity_editor - self.created_at = created_at - self.updated_at = updated_at + self.seat_breakdown = seat_breakdown + self.public_code_suggestions = public_code_suggestions + self.ide_chat = ide_chat + self.platform_chat = platform_chat + self.cli = cli + self.seat_management_setting = seat_management_setting + self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case assignee - case organization - case assigning_team - case pending_cancellation_date - case last_activity_at - case last_activity_editor - case created_at - case updated_at + case seat_breakdown + case public_code_suggestions + case ide_chat + case platform_chat + case cli + case seat_management_setting } public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - assignee = try container.decode( - Components.Schemas.copilot_hyphen_seat_hyphen_details.assigneePayload.self, - forKey: .assignee + seat_breakdown = try container.decode( + Components.Schemas.copilot_hyphen_seat_hyphen_breakdown.self, + forKey: .seat_breakdown ) - organization = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_seat_hyphen_details.organizationPayload.self, - forKey: .organization + public_code_suggestions = try container.decode( + Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload.self, + forKey: .public_code_suggestions ) - assigning_team = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_seat_hyphen_details.assigning_teamPayload.self, - forKey: .assigning_team + ide_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload.self, + forKey: .ide_chat ) - pending_cancellation_date = try container.decodeIfPresent( - Swift.String.self, - forKey: .pending_cancellation_date + platform_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload.self, + forKey: .platform_chat ) - last_activity_at = try container.decodeIfPresent( - Foundation.Date.self, - forKey: .last_activity_at + cli = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload.self, + forKey: .cli ) - last_activity_editor = try container.decodeIfPresent( - Swift.String.self, - forKey: .last_activity_editor + seat_management_setting = try container.decode( + Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload.self, + forKey: .seat_management_setting ) - created_at = try container.decode( - Foundation.Date.self, - forKey: .created_at + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "seat_breakdown", + "public_code_suggestions", + "ide_chat", + "platform_chat", + "cli", + "seat_management_setting" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + seat_breakdown, + forKey: .seat_breakdown ) - updated_at = try container.decodeIfPresent( - Foundation.Date.self, - forKey: .updated_at + try container.encode( + public_code_suggestions, + forKey: .public_code_suggestions ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "assignee", - "organization", - "assigning_team", - "pending_cancellation_date", - "last_activity_at", - "last_activity_editor", - "created_at", - "updated_at" - ]) + try container.encodeIfPresent( + ide_chat, + forKey: .ide_chat + ) + try container.encodeIfPresent( + platform_chat, + forKey: .platform_chat + ) + try container.encodeIfPresent( + cli, + forKey: .cli + ) + try container.encode( + seat_management_setting, + forKey: .seat_management_setting + ) + try encoder.encodeAdditionalProperties(additionalProperties) } } } @@ -2045,110 +2089,415 @@ public enum Components { } } } - /// Received HTTP response body - public var body: Components.Responses.not_found.Body - /// Creates a new `not_found`. + /// Received HTTP response body + public var body: Components.Responses.not_found.Body + /// Creates a new `not_found`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.not_found.Body) { + self.body = body + } + } + public struct requires_authentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// 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.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.requires_authentication.Body + /// Creates a new `requires_authentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.requires_authentication.Body) { + self.body = body + } + } + public struct forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// 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.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.forbidden.Body + /// Creates a new `forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.forbidden.Body) { + self.body = body + } + } + public struct internal_error: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// 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.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.internal_error.Body + /// Creates a new `internal_error`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.internal_error.Body) { + self.body = body + } + } + } + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers { + /// - Remark: Generated from `#/components/headers/link`. + public typealias link = Swift.String + } +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// List all Copilot seat assignments for an enterprise + /// + /// **Note**: This endpoint is in beta and is subject to change. + /// + /// Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. + /// + /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. + /// + /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// + /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. + /// + /// Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/billing/seats`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)`. + public enum copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "copilot/list-copilot-seats-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/path/enterprise`. + public var enterprise: Components.Parameters.enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + public init(enterprise: Components.Parameters.enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query/per_page`. + public var per_page: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + page: Components.Parameters.page? = nil, + per_page: Swift.Int? = nil + ) { + self.page = page + self.per_page = per_page + } + } + public var query: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/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_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Path, + query: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Query = .init(), + headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.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/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/headers/Link`. + public var Link: Components.Headers.link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - Link: + public init(Link: Components.Headers.link? = nil) { + self.Link = Link + } + } + /// Received HTTP response headers + public var headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json/total_seats`. + public var total_seats: Swift.Int? + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json/seats`. + public var seats: [Components.Schemas.copilot_hyphen_seat_hyphen_details]? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_seats: The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. + /// - seats: + public init( + total_seats: Swift.Int? = nil, + seats: [Components.Schemas.copilot_hyphen_seat_hyphen_details]? = nil + ) { + self.total_seats = total_seats + self.seats = seats + } + public enum CodingKeys: String, CodingKey { + case total_seats + case seats + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/application\/json`. + case json(Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Headers = .init(), + body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.not_found.Body) { - self.body = body - } - } - public struct requires_authentication: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. - case json(Components.Schemas.basic_hyphen_error) - /// 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.basic_hyphen_error { - get throws { - switch self { - case let .json(body): - return body - } + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.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_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.requires_authentication.Body - /// Creates a new `requires_authentication`. + /// Internal Error /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.requires_authentication.Body) { - self.body = body + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/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 + ) + } + } } - } - public struct forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. - case json(Components.Schemas.basic_hyphen_error) - /// 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.basic_hyphen_error { - get throws { - switch self { - case let .json(body): - return body - } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/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 + ) } } } - /// Received HTTP response body - public var body: Components.Responses.forbidden.Body - /// Creates a new `forbidden`. + /// Forbidden /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.forbidden.Body) { - self.body = body + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/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 + ) + } + } } - } - public struct internal_error: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. - case json(Components.Schemas.basic_hyphen_error) - /// 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.basic_hyphen_error { - get throws { - switch self { - case let .json(body): - return body - } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/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 + ) } } } - /// Received HTTP response body - public var body: Components.Responses.internal_error.Body - /// Creates a new `internal_error`. + /// Undocumented response. /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.internal_error.Body) { - self.body = body + /// 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 + ] } } } - /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers { - /// - Remark: Generated from `#/components/headers/link`. - public typealias link = Swift.String - } -} - -/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { /// Get a summary of Copilot usage for enterprise members /// /// **Note**: This endpoint is in beta and is subject to change. diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 2db3458272a..4a32a2a76db 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -2732,6 +2732,251 @@ public enum Components { case anonymous_access_enabled } } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var node_id: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// + /// - Parameters: + /// - id: Unique identifier of the team + /// - node_id: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + public init( + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil + ) { + self.id = id + self.node_id = node_id + self.url = url + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case url + case members_url + case name + case description + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `permissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. + /// + /// - Parameters: + /// - id: + /// - node_id: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: + /// - html_url: + /// - members_url: + /// - repositories_url: + /// - parent: + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case slug + case description + case privacy + case notification_setting + case permission + case permissions + case url + case html_url + case members_url + case repositories_url + case parent + } + } /// A collection of related issues and pull requests. /// /// - Remark: Generated from `#/components/schemas/nullable-milestone`. @@ -3642,251 +3887,6 @@ public enum Components { case reactions } } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var node_id: Swift.String - /// URL for the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. - public var name: Swift.String - /// Description of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. - public var description: Swift.String? - /// Permission that the team will have for its repositories - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. - /// - /// - Parameters: - /// - id: Unique identifier of the team - /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set - /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment - public init( - id: Swift.Int, - node_id: Swift.String, - url: Swift.String, - members_url: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil - ) { - self.id = id - self.node_id = node_id - self.url = url - self.members_url = members_url - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting - self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case url - case members_url - case name - case description - case permission - case privacy - case notification_setting - case html_url - case repositories_url - case slug - case ldap_dn - } - } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. - /// - /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin - } - public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin - } - } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil - ) { - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent - } - } /// Commit Comment /// /// - Remark: Generated from `#/components/schemas/commit-comment`. diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index 80449eaa97a..1acbf63012e 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -481,6 +481,96 @@ public struct Client: APIProtocol { } ) } + /// List attestations + /// + /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /orgs/{org}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)`. + public func orgs_sol_list_hyphen_attestations(_ input: Operations.orgs_sol_list_hyphen_attestations.Input) async throws -> Operations.orgs_sol_list_hyphen_attestations.Output { + try await client.send( + input: input, + forOperation: Operations.orgs_sol_list_hyphen_attestations.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/attestations/{}", + parameters: [ + input.path.org, + input.path.subject_digest + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + 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.orgs_sol_list_hyphen_attestations.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List users blocked by an organization /// /// List the users blocked by an organization. diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 67d7ea777a3..d01c23874f7 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -83,6 +83,17 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /orgs/{org}`. /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)`. func orgs_sol_delete(_ input: Operations.orgs_sol_delete.Input) async throws -> Operations.orgs_sol_delete.Output + /// List attestations + /// + /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /orgs/{org}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)`. + func orgs_sol_list_hyphen_attestations(_ input: Operations.orgs_sol_list_hyphen_attestations.Input) async throws -> Operations.orgs_sol_list_hyphen_attestations.Output /// List users blocked by an organization /// /// List the users blocked by an organization. @@ -916,6 +927,27 @@ extension APIProtocol { headers: headers )) } + /// List attestations + /// + /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /orgs/{org}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)`. + public func orgs_sol_list_hyphen_attestations( + path: Operations.orgs_sol_list_hyphen_attestations.Input.Path, + query: Operations.orgs_sol_list_hyphen_attestations.Input.Query = .init(), + headers: Operations.orgs_sol_list_hyphen_attestations.Input.Headers = .init() + ) async throws -> Operations.orgs_sol_list_hyphen_attestations.Output { + try await orgs_sol_list_hyphen_attestations(Operations.orgs_sol_list_hyphen_attestations.Input( + path: path, + query: query, + headers: headers + )) + } /// List users blocked by an organization /// /// List the users blocked by an organization. @@ -4227,746 +4259,249 @@ public enum Components { case html_url } } - /// - Remark: Generated from `#/components/schemas/security-and-analysis`. - public struct security_hyphen_and_hyphen_analysis: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. - public struct advanced_securityPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. - @frozen public enum statusPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. - public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? - /// Creates a new `advanced_securityPayload`. - /// - /// - Parameters: - /// - status: - public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? = nil) { - self.status = status - } - public enum CodingKeys: String, CodingKey { - case status - } - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. - public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? - /// Enable or disable Dependabot security updates for the repository. + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. - public struct dependabot_security_updatesPayload: Codable, Hashable, Sendable { - /// The enablement status of Dependabot security updates for the repository. - /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. - @frozen public enum statusPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - } - /// The enablement status of Dependabot security updates for the repository. - /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. - public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload.statusPayload? - /// Creates a new `dependabot_security_updatesPayload`. - /// - /// - Parameters: - /// - status: The enablement status of Dependabot security updates for the repository. - public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload.statusPayload? = nil) { - self.status = status - } - public enum CodingKeys: String, CodingKey { - case status - } - } - /// Enable or disable Dependabot security updates for the repository. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var node_id: Swift.String + /// URL for the team /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. - public var dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. - public struct secret_scanningPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. - @frozen public enum statusPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. - public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload.statusPayload? - /// Creates a new `secret_scanningPayload`. - /// - /// - Parameters: - /// - status: - public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload.statusPayload? = nil) { - self.status = status - } - public enum CodingKeys: String, CodingKey { - case status - } - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. - public var secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. - public struct secret_scanning_push_protectionPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. - @frozen public enum statusPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. - public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload.statusPayload? - /// Creates a new `secret_scanning_push_protectionPayload`. - /// - /// - Parameters: - /// - status: - public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload.statusPayload? = nil) { - self.status = status - } - public enum CodingKeys: String, CodingKey { - case status - } - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. - public var secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? - /// Creates a new `security_hyphen_and_hyphen_analysis`. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. /// /// - Parameters: - /// - advanced_security: - /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. - /// - secret_scanning: - /// - secret_scanning_push_protection: + /// - id: Unique identifier of the team + /// - node_id: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment public init( - advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, - dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, - secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, - secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil ) { - self.advanced_security = advanced_security - self.dependabot_security_updates = dependabot_security_updates - self.secret_scanning = secret_scanning - self.secret_scanning_push_protection = secret_scanning_push_protection + self.id = id + self.node_id = node_id + self.url = url + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn } public enum CodingKeys: String, CodingKey { - case advanced_security - case dependabot_security_updates - case secret_scanning - case secret_scanning_push_protection + case id + case node_id + case url + case members_url + case name + case description + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn } } - /// Minimal Repository + /// Groups of organization members that gives permissions on specified repositories. /// - /// - Remark: Generated from `#/components/schemas/minimal-repository`. - public struct minimal_hyphen_repository: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/minimal-repository/id`. + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/minimal-repository/node_id`. + /// - Remark: Generated from `#/components/schemas/team/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/name`. + /// - Remark: Generated from `#/components/schemas/team/name`. public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/full_name`. - public var full_name: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/owner`. - public var owner: Components.Schemas.simple_hyphen_user - /// - Remark: Generated from `#/components/schemas/minimal-repository/private`. - public var _private: Swift.Bool - /// - Remark: Generated from `#/components/schemas/minimal-repository/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/description`. + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/fork`. - public var fork: Swift.Bool - /// - Remark: Generated from `#/components/schemas/minimal-repository/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/archive_url`. - public var archive_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/assignees_url`. - public var assignees_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/blobs_url`. - public var blobs_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/branches_url`. - public var branches_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/collaborators_url`. - public var collaborators_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/comments_url`. - public var comments_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/commits_url`. - public var commits_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/compare_url`. - public var compare_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/contents_url`. - public var contents_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/contributors_url`. - public var contributors_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/deployments_url`. - public var deployments_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/downloads_url`. - public var downloads_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/forks_url`. - public var forks_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/git_commits_url`. - public var git_commits_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/git_refs_url`. - public var git_refs_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/git_tags_url`. - public var git_tags_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/git_url`. - public var git_url: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/issue_comment_url`. - public var issue_comment_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/issue_events_url`. - public var issue_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/issues_url`. - public var issues_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/keys_url`. - public var keys_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/labels_url`. - public var labels_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/languages_url`. - public var languages_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/merges_url`. - public var merges_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/milestones_url`. - public var milestones_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/notifications_url`. - public var notifications_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/pulls_url`. - public var pulls_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/releases_url`. - public var releases_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/ssh_url`. - public var ssh_url: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/stargazers_url`. - public var stargazers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/statuses_url`. - public var statuses_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/subscribers_url`. - public var subscribers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/subscription_url`. - public var subscription_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/tags_url`. - public var tags_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/teams_url`. - public var teams_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/trees_url`. - public var trees_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/clone_url`. - public var clone_url: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/mirror_url`. - public var mirror_url: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/hooks_url`. - public var hooks_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/svn_url`. - public var svn_url: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/homepage`. - public var homepage: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/language`. - public var language: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/forks_count`. - public var forks_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/minimal-repository/stargazers_count`. - public var stargazers_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/minimal-repository/watchers_count`. - public var watchers_count: Swift.Int? - /// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. - /// - /// - Remark: Generated from `#/components/schemas/minimal-repository/size`. - public var size: Swift.Int? - /// - Remark: Generated from `#/components/schemas/minimal-repository/default_branch`. - public var default_branch: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/open_issues_count`. - public var open_issues_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/minimal-repository/is_template`. - public var is_template: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/topics`. - public var topics: [Swift.String]? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_issues`. - public var has_issues: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_projects`. - public var has_projects: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_wiki`. - public var has_wiki: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pages`. - public var has_pages: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_downloads`. - public var has_downloads: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. - public var has_discussions: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. - public var archived: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. - public var disabled: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/visibility`. - public var visibility: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/pushed_at`. - public var pushed_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/minimal-repository/created_at`. - public var created_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/minimal-repository/updated_at`. - public var updated_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions`. + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/admin`. - public var admin: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/maintain`. - public var maintain: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/push`. - public var push: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/triage`. - public var triage: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/pull`. - public var pull: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool /// Creates a new `permissionsPayload`. /// /// - Parameters: - /// - admin: - /// - maintain: - /// - push: - /// - triage: /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: public init( - admin: Swift.Bool? = nil, - maintain: Swift.Bool? = nil, - push: Swift.Bool? = nil, - triage: Swift.Bool? = nil, - pull: Swift.Bool? = nil + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool ) { - self.admin = admin - self.maintain = maintain - self.push = push - self.triage = triage self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin } public enum CodingKeys: String, CodingKey { - case admin - case maintain - case push - case triage case pull + case triage + case push + case maintain + case admin } } - /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions`. - public var permissions: Components.Schemas.minimal_hyphen_repository.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/role_name`. - public var role_name: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/temp_clone_token`. - public var temp_clone_token: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/delete_branch_on_merge`. - public var delete_branch_on_merge: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/subscribers_count`. - public var subscribers_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/minimal-repository/network_count`. - public var network_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/minimal-repository/code_of_conduct`. - public var code_of_conduct: Components.Schemas.code_hyphen_of_hyphen_conduct? - /// - Remark: Generated from `#/components/schemas/minimal-repository/license`. - public struct licensePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/minimal-repository/license/key`. - public var key: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/license/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/license/spdx_id`. - public var spdx_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/license/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/license/node_id`. - public var node_id: Swift.String? - /// Creates a new `licensePayload`. - /// - /// - Parameters: - /// - key: - /// - name: - /// - spdx_id: - /// - url: - /// - node_id: - public init( - key: Swift.String? = nil, - name: Swift.String? = nil, - spdx_id: Swift.String? = nil, - url: Swift.String? = nil, - node_id: Swift.String? = nil - ) { - self.key = key - self.name = name - self.spdx_id = spdx_id - self.url = url - self.node_id = node_id - } - public enum CodingKeys: String, CodingKey { - case key - case name - case spdx_id - case url - case node_id - } - } - /// - Remark: Generated from `#/components/schemas/minimal-repository/license`. - public var license: Components.Schemas.minimal_hyphen_repository.licensePayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/forks`. - public var forks: Swift.Int? - /// - Remark: Generated from `#/components/schemas/minimal-repository/open_issues`. - public var open_issues: Swift.Int? - /// - Remark: Generated from `#/components/schemas/minimal-repository/watchers`. - public var watchers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/minimal-repository/allow_forking`. - public var allow_forking: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/web_commit_signoff_required`. - public var web_commit_signoff_required: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. - public var security_and_analysis: Components.Schemas.security_hyphen_and_hyphen_analysis? - /// Creates a new `minimal_hyphen_repository`. - /// + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. + /// /// - Parameters: /// - id: /// - node_id: /// - name: - /// - full_name: - /// - owner: - /// - _private: - /// - html_url: + /// - slug: /// - description: - /// - fork: - /// - url: - /// - archive_url: - /// - assignees_url: - /// - blobs_url: - /// - branches_url: - /// - collaborators_url: - /// - comments_url: - /// - commits_url: - /// - compare_url: - /// - contents_url: - /// - contributors_url: - /// - deployments_url: - /// - downloads_url: - /// - events_url: - /// - forks_url: - /// - git_commits_url: - /// - git_refs_url: - /// - git_tags_url: - /// - git_url: - /// - issue_comment_url: - /// - issue_events_url: - /// - issues_url: - /// - keys_url: - /// - labels_url: - /// - languages_url: - /// - merges_url: - /// - milestones_url: - /// - notifications_url: - /// - pulls_url: - /// - releases_url: - /// - ssh_url: - /// - stargazers_url: - /// - statuses_url: - /// - subscribers_url: - /// - subscription_url: - /// - tags_url: - /// - teams_url: - /// - trees_url: - /// - clone_url: - /// - mirror_url: - /// - hooks_url: - /// - svn_url: - /// - homepage: - /// - language: - /// - forks_count: - /// - stargazers_count: - /// - watchers_count: - /// - size: The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. - /// - default_branch: - /// - open_issues_count: - /// - is_template: - /// - topics: - /// - has_issues: - /// - has_projects: - /// - has_wiki: - /// - has_pages: - /// - has_downloads: - /// - has_discussions: - /// - archived: - /// - disabled: - /// - visibility: - /// - pushed_at: - /// - created_at: - /// - updated_at: + /// - privacy: + /// - notification_setting: + /// - permission: /// - permissions: - /// - role_name: - /// - temp_clone_token: - /// - delete_branch_on_merge: - /// - subscribers_count: - /// - network_count: - /// - code_of_conduct: - /// - license: - /// - forks: - /// - open_issues: - /// - watchers: - /// - allow_forking: - /// - web_commit_signoff_required: - /// - security_and_analysis: + /// - url: + /// - html_url: + /// - members_url: + /// - repositories_url: + /// - parent: public init( id: Swift.Int, node_id: Swift.String, name: Swift.String, - full_name: Swift.String, - owner: Components.Schemas.simple_hyphen_user, - _private: Swift.Bool, - html_url: Swift.String, + slug: Swift.String, description: Swift.String? = nil, - fork: Swift.Bool, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, url: Swift.String, - archive_url: Swift.String, - assignees_url: Swift.String, - blobs_url: Swift.String, - branches_url: Swift.String, - collaborators_url: Swift.String, - comments_url: Swift.String, - commits_url: Swift.String, - compare_url: Swift.String, - contents_url: Swift.String, - contributors_url: Swift.String, - deployments_url: Swift.String, - downloads_url: Swift.String, - events_url: Swift.String, - forks_url: Swift.String, - git_commits_url: Swift.String, - git_refs_url: Swift.String, - git_tags_url: Swift.String, - git_url: Swift.String? = nil, - issue_comment_url: Swift.String, - issue_events_url: Swift.String, - issues_url: Swift.String, - keys_url: Swift.String, - labels_url: Swift.String, - languages_url: Swift.String, - merges_url: Swift.String, - milestones_url: Swift.String, - notifications_url: Swift.String, - pulls_url: Swift.String, - releases_url: Swift.String, - ssh_url: Swift.String? = nil, - stargazers_url: Swift.String, - statuses_url: Swift.String, - subscribers_url: Swift.String, - subscription_url: Swift.String, - tags_url: Swift.String, - teams_url: Swift.String, - trees_url: Swift.String, - clone_url: Swift.String? = nil, - mirror_url: Swift.String? = nil, - hooks_url: Swift.String, - svn_url: Swift.String? = nil, - homepage: Swift.String? = nil, - language: Swift.String? = nil, - forks_count: Swift.Int? = nil, - stargazers_count: Swift.Int? = nil, - watchers_count: Swift.Int? = nil, - size: Swift.Int? = nil, - default_branch: Swift.String? = nil, - open_issues_count: Swift.Int? = nil, - is_template: Swift.Bool? = nil, - topics: [Swift.String]? = nil, - has_issues: Swift.Bool? = nil, - has_projects: Swift.Bool? = nil, - has_wiki: Swift.Bool? = nil, - has_pages: Swift.Bool? = nil, - has_downloads: Swift.Bool? = nil, - has_discussions: Swift.Bool? = nil, - archived: Swift.Bool? = nil, - disabled: Swift.Bool? = nil, - visibility: Swift.String? = nil, - pushed_at: Foundation.Date? = nil, - created_at: Foundation.Date? = nil, - updated_at: Foundation.Date? = nil, - permissions: Components.Schemas.minimal_hyphen_repository.permissionsPayload? = nil, - role_name: Swift.String? = nil, - temp_clone_token: Swift.String? = nil, - delete_branch_on_merge: Swift.Bool? = nil, - subscribers_count: Swift.Int? = nil, - network_count: Swift.Int? = nil, - code_of_conduct: Components.Schemas.code_hyphen_of_hyphen_conduct? = nil, - license: Components.Schemas.minimal_hyphen_repository.licensePayload? = nil, - forks: Swift.Int? = nil, - open_issues: Swift.Int? = nil, - watchers: Swift.Int? = nil, - allow_forking: Swift.Bool? = nil, - web_commit_signoff_required: Swift.Bool? = nil, - security_and_analysis: Components.Schemas.security_hyphen_and_hyphen_analysis? = nil + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil ) { self.id = id self.node_id = node_id self.name = name - self.full_name = full_name - self.owner = owner - self._private = _private - self.html_url = html_url + self.slug = slug self.description = description - self.fork = fork + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions self.url = url - self.archive_url = archive_url - self.assignees_url = assignees_url - self.blobs_url = blobs_url - self.branches_url = branches_url - self.collaborators_url = collaborators_url - self.comments_url = comments_url - self.commits_url = commits_url - self.compare_url = compare_url - self.contents_url = contents_url - self.contributors_url = contributors_url - self.deployments_url = deployments_url - self.downloads_url = downloads_url - self.events_url = events_url - self.forks_url = forks_url - self.git_commits_url = git_commits_url - self.git_refs_url = git_refs_url - self.git_tags_url = git_tags_url - self.git_url = git_url - self.issue_comment_url = issue_comment_url - self.issue_events_url = issue_events_url - self.issues_url = issues_url - self.keys_url = keys_url - self.labels_url = labels_url - self.languages_url = languages_url - self.merges_url = merges_url - self.milestones_url = milestones_url - self.notifications_url = notifications_url - self.pulls_url = pulls_url - self.releases_url = releases_url - self.ssh_url = ssh_url - self.stargazers_url = stargazers_url - self.statuses_url = statuses_url - self.subscribers_url = subscribers_url - self.subscription_url = subscription_url - self.tags_url = tags_url - self.teams_url = teams_url - self.trees_url = trees_url - self.clone_url = clone_url - self.mirror_url = mirror_url - self.hooks_url = hooks_url - self.svn_url = svn_url - self.homepage = homepage - self.language = language - self.forks_count = forks_count - self.stargazers_count = stargazers_count - self.watchers_count = watchers_count - self.size = size - self.default_branch = default_branch - self.open_issues_count = open_issues_count - self.is_template = is_template - self.topics = topics - self.has_issues = has_issues - self.has_projects = has_projects - self.has_wiki = has_wiki - self.has_pages = has_pages - self.has_downloads = has_downloads - self.has_discussions = has_discussions - self.archived = archived - self.disabled = disabled - self.visibility = visibility - self.pushed_at = pushed_at - self.created_at = created_at - self.updated_at = updated_at - self.permissions = permissions - self.role_name = role_name - self.temp_clone_token = temp_clone_token - self.delete_branch_on_merge = delete_branch_on_merge - self.subscribers_count = subscribers_count - self.network_count = network_count - self.code_of_conduct = code_of_conduct - self.license = license - self.forks = forks - self.open_issues = open_issues - self.watchers = watchers - self.allow_forking = allow_forking - self.web_commit_signoff_required = web_commit_signoff_required - self.security_and_analysis = security_and_analysis + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent } public enum CodingKeys: String, CodingKey { case id case node_id case name - case full_name - case owner - case _private = "private" - case html_url + case slug case description - case fork - case url - case archive_url - case assignees_url - case blobs_url - case branches_url - case collaborators_url - case comments_url - case commits_url - case compare_url - case contents_url - case contributors_url - case deployments_url - case downloads_url - case events_url - case forks_url - case git_commits_url - case git_refs_url - case git_tags_url - case git_url - case issue_comment_url - case issue_events_url - case issues_url - case keys_url - case labels_url - case languages_url - case merges_url - case milestones_url - case notifications_url - case pulls_url - case releases_url - case ssh_url - case stargazers_url - case statuses_url - case subscribers_url - case subscription_url - case tags_url - case teams_url - case trees_url - case clone_url - case mirror_url - case hooks_url - case svn_url - case homepage - case language - case forks_count - case stargazers_count - case watchers_count - case size - case default_branch - case open_issues_count - case is_template - case topics - case has_issues - case has_projects - case has_wiki - case has_pages - case has_downloads - case has_discussions - case archived - case disabled - case visibility - case pushed_at - case created_at - case updated_at + case privacy + case notification_setting + case permission case permissions - case role_name - case temp_clone_token - case delete_branch_on_merge - case subscribers_count - case network_count - case code_of_conduct - case license - case forks - case open_issues - case watchers - case allow_forking - case web_commit_signoff_required - case security_and_analysis + case url + case html_url + case members_url + case repositories_url + case parent } } /// A GitHub organization. @@ -5054,678 +4589,1175 @@ public enum Components { case description } } - /// Organization Full - /// - /// - Remark: Generated from `#/components/schemas/organization-full`. - public struct organization_hyphen_full: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/organization-full/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization-full/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/hooks_url`. - public var hooks_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/issues_url`. - public var issues_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/public_members_url`. - public var public_members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/avatar_url`. - public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-full/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-full/company`. - public var company: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-full/blog`. - public var blog: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-full/location`. - public var location: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-full/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-full/twitter_username`. - public var twitter_username: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-full/is_verified`. - public var is_verified: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/organization-full/has_organization_projects`. - public var has_organization_projects: Swift.Bool - /// - Remark: Generated from `#/components/schemas/organization-full/has_repository_projects`. - public var has_repository_projects: Swift.Bool - /// - Remark: Generated from `#/components/schemas/organization-full/public_repos`. - public var public_repos: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization-full/public_gists`. - public var public_gists: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization-full/followers`. - public var followers: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization-full/following`. - public var following: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization-full/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/total_private_repos`. - public var total_private_repos: Swift.Int? - /// - Remark: Generated from `#/components/schemas/organization-full/owned_private_repos`. - public var owned_private_repos: Swift.Int? - /// - Remark: Generated from `#/components/schemas/organization-full/private_gists`. - public var private_gists: Swift.Int? - /// - Remark: Generated from `#/components/schemas/organization-full/disk_usage`. - public var disk_usage: Swift.Int? - /// - Remark: Generated from `#/components/schemas/organization-full/collaborators`. - public var collaborators: Swift.Int? - /// - Remark: Generated from `#/components/schemas/organization-full/billing_email`. - public var billing_email: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-full/plan`. - public struct planPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/organization-full/plan/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-full/plan/space`. - public var space: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization-full/plan/private_repos`. - public var private_repos: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization-full/plan/filled_seats`. - public var filled_seats: Swift.Int? - /// - Remark: Generated from `#/components/schemas/organization-full/plan/seats`. - public var seats: Swift.Int? - /// Creates a new `planPayload`. + /// - Remark: Generated from `#/components/schemas/security-and-analysis`. + public struct security_hyphen_and_hyphen_analysis: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. + public struct advanced_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? + /// Creates a new `advanced_securityPayload`. /// /// - Parameters: - /// - name: - /// - space: - /// - private_repos: - /// - filled_seats: - /// - seats: - public init( - name: Swift.String, - space: Swift.Int, - private_repos: Swift.Int, - filled_seats: Swift.Int? = nil, - seats: Swift.Int? = nil - ) { - self.name = name - self.space = space - self.private_repos = private_repos - self.filled_seats = filled_seats - self.seats = seats + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? = nil) { + self.status = status } public enum CodingKeys: String, CodingKey { - case name - case space - case private_repos - case filled_seats - case seats + case status } } - /// - Remark: Generated from `#/components/schemas/organization-full/plan`. - public var plan: Components.Schemas.organization_hyphen_full.planPayload? - /// - Remark: Generated from `#/components/schemas/organization-full/default_repository_permission`. - public var default_repository_permission: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_repositories`. - public var members_can_create_repositories: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/organization-full/two_factor_requirement_enabled`. - public var two_factor_requirement_enabled: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/organization-full/members_allowed_repository_creation_type`. - public var members_allowed_repository_creation_type: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_public_repositories`. - public var members_can_create_public_repositories: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_private_repositories`. - public var members_can_create_private_repositories: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_internal_repositories`. - public var members_can_create_internal_repositories: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_pages`. - public var members_can_create_pages: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_public_pages`. - public var members_can_create_public_pages: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_private_pages`. - public var members_can_create_private_pages: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/organization-full/members_can_fork_private_repositories`. - public var members_can_fork_private_repositories: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/organization-full/web_commit_signoff_required`. - public var web_commit_signoff_required: Swift.Bool? - /// Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization. - /// - /// This field is only visible to organization owners or members of a team with the security manager role. - /// - /// - Remark: Generated from `#/components/schemas/organization-full/advanced_security_enabled_for_new_repositories`. - public var advanced_security_enabled_for_new_repositories: Swift.Bool? - /// Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to - /// this organization. - /// - /// This field is only visible to organization owners or members of a team with the security manager role. - /// - /// - Remark: Generated from `#/components/schemas/organization-full/dependabot_alerts_enabled_for_new_repositories`. - public var dependabot_alerts_enabled_for_new_repositories: Swift.Bool? - /// Whether dependabot security updates are automatically enabled for new repositories and repositories transferred - /// to this organization. - /// - /// This field is only visible to organization owners or members of a team with the security manager role. - /// - /// - Remark: Generated from `#/components/schemas/organization-full/dependabot_security_updates_enabled_for_new_repositories`. - public var dependabot_security_updates_enabled_for_new_repositories: Swift.Bool? - /// Whether dependency graph is automatically enabled for new repositories and repositories transferred to this - /// organization. - /// - /// This field is only visible to organization owners or members of a team with the security manager role. - /// - /// - Remark: Generated from `#/components/schemas/organization-full/dependency_graph_enabled_for_new_repositories`. - public var dependency_graph_enabled_for_new_repositories: Swift.Bool? - /// Whether secret scanning is automatically enabled for new repositories and repositories transferred to this - /// organization. - /// - /// This field is only visible to organization owners or members of a team with the security manager role. - /// - /// - Remark: Generated from `#/components/schemas/organization-full/secret_scanning_enabled_for_new_repositories`. - public var secret_scanning_enabled_for_new_repositories: Swift.Bool? - /// Whether secret scanning push protection is automatically enabled for new repositories and repositories - /// transferred to this organization. - /// - /// This field is only visible to organization owners or members of a team with the security manager role. - /// - /// - Remark: Generated from `#/components/schemas/organization-full/secret_scanning_push_protection_enabled_for_new_repositories`. - public var secret_scanning_push_protection_enabled_for_new_repositories: Swift.Bool? - /// Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. + public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// Enable or disable Dependabot security updates for the repository. /// - /// - Remark: Generated from `#/components/schemas/organization-full/secret_scanning_push_protection_custom_link_enabled`. - public var secret_scanning_push_protection_custom_link_enabled: Swift.Bool? - /// An optional URL string to display to contributors who are blocked from pushing a secret. + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. + public struct dependabot_security_updatesPayload: Codable, Hashable, Sendable { + /// The enablement status of Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// The enablement status of Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload.statusPayload? + /// Creates a new `dependabot_security_updatesPayload`. + /// + /// - Parameters: + /// - status: The enablement status of Dependabot security updates for the repository. + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// Enable or disable Dependabot security updates for the repository. /// - /// - Remark: Generated from `#/components/schemas/organization-full/secret_scanning_push_protection_custom_link`. - public var secret_scanning_push_protection_custom_link: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-full/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/organization-full/updated_at`. - public var updated_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/organization-full/archived_at`. - public var archived_at: Foundation.Date? - /// Creates a new `organization_hyphen_full`. + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. + public var dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. + public struct secret_scanningPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload.statusPayload? + /// Creates a new `secret_scanningPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. + public var secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. + public struct secret_scanning_push_protectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload.statusPayload? + /// Creates a new `secret_scanning_push_protectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. + public var secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? + /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: - /// - login: - /// - id: - /// - node_id: - /// - url: - /// - repos_url: - /// - events_url: - /// - hooks_url: - /// - issues_url: - /// - members_url: - /// - public_members_url: - /// - avatar_url: - /// - description: - /// - name: - /// - company: - /// - blog: - /// - location: - /// - email: - /// - twitter_username: - /// - is_verified: - /// - has_organization_projects: - /// - has_repository_projects: - /// - public_repos: - /// - public_gists: - /// - followers: - /// - following: - /// - html_url: - /// - _type: - /// - total_private_repos: - /// - owned_private_repos: - /// - private_gists: - /// - disk_usage: - /// - collaborators: - /// - billing_email: - /// - plan: - /// - default_repository_permission: - /// - members_can_create_repositories: - /// - two_factor_requirement_enabled: - /// - members_allowed_repository_creation_type: - /// - members_can_create_public_repositories: - /// - members_can_create_private_repositories: - /// - members_can_create_internal_repositories: - /// - members_can_create_pages: - /// - members_can_create_public_pages: - /// - members_can_create_private_pages: - /// - members_can_fork_private_repositories: - /// - web_commit_signoff_required: - /// - advanced_security_enabled_for_new_repositories: Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization. - /// - dependabot_alerts_enabled_for_new_repositories: Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to - /// - dependabot_security_updates_enabled_for_new_repositories: Whether dependabot security updates are automatically enabled for new repositories and repositories transferred - /// - dependency_graph_enabled_for_new_repositories: Whether dependency graph is automatically enabled for new repositories and repositories transferred to this - /// - secret_scanning_enabled_for_new_repositories: Whether secret scanning is automatically enabled for new repositories and repositories transferred to this - /// - secret_scanning_push_protection_enabled_for_new_repositories: Whether secret scanning push protection is automatically enabled for new repositories and repositories - /// - secret_scanning_push_protection_custom_link_enabled: Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. - /// - secret_scanning_push_protection_custom_link: An optional URL string to display to contributors who are blocked from pushing a secret. - /// - created_at: - /// - updated_at: - /// - archived_at: + /// - advanced_security: + /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. + /// - secret_scanning: + /// - secret_scanning_push_protection: public init( - login: Swift.String, - id: Swift.Int, - node_id: Swift.String, - url: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - hooks_url: Swift.String, - issues_url: Swift.String, - members_url: Swift.String, - public_members_url: Swift.String, - avatar_url: Swift.String, - description: Swift.String? = nil, - name: Swift.String? = nil, - company: Swift.String? = nil, - blog: Swift.String? = nil, - location: Swift.String? = nil, - email: Swift.String? = nil, - twitter_username: Swift.String? = nil, - is_verified: Swift.Bool? = nil, - has_organization_projects: Swift.Bool, - has_repository_projects: Swift.Bool, - public_repos: Swift.Int, - public_gists: Swift.Int, - followers: Swift.Int, - following: Swift.Int, - html_url: Swift.String, - _type: Swift.String, - total_private_repos: Swift.Int? = nil, - owned_private_repos: Swift.Int? = nil, - private_gists: Swift.Int? = nil, - disk_usage: Swift.Int? = nil, - collaborators: Swift.Int? = nil, - billing_email: Swift.String? = nil, - plan: Components.Schemas.organization_hyphen_full.planPayload? = nil, - default_repository_permission: Swift.String? = nil, - members_can_create_repositories: Swift.Bool? = nil, - two_factor_requirement_enabled: Swift.Bool? = nil, - members_allowed_repository_creation_type: Swift.String? = nil, - members_can_create_public_repositories: Swift.Bool? = nil, - members_can_create_private_repositories: Swift.Bool? = nil, - members_can_create_internal_repositories: Swift.Bool? = nil, - members_can_create_pages: Swift.Bool? = nil, - members_can_create_public_pages: Swift.Bool? = nil, - members_can_create_private_pages: Swift.Bool? = nil, - members_can_fork_private_repositories: Swift.Bool? = nil, - web_commit_signoff_required: Swift.Bool? = nil, - advanced_security_enabled_for_new_repositories: Swift.Bool? = nil, - dependabot_alerts_enabled_for_new_repositories: Swift.Bool? = nil, - dependabot_security_updates_enabled_for_new_repositories: Swift.Bool? = nil, - dependency_graph_enabled_for_new_repositories: Swift.Bool? = nil, - secret_scanning_enabled_for_new_repositories: Swift.Bool? = nil, - secret_scanning_push_protection_enabled_for_new_repositories: Swift.Bool? = nil, - secret_scanning_push_protection_custom_link_enabled: Swift.Bool? = nil, - secret_scanning_push_protection_custom_link: Swift.String? = nil, - created_at: Foundation.Date, - updated_at: Foundation.Date, - archived_at: Foundation.Date? = nil + advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, + secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, + secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil ) { - self.login = login - self.id = id - self.node_id = node_id - self.url = url - self.repos_url = repos_url - self.events_url = events_url - self.hooks_url = hooks_url - self.issues_url = issues_url - self.members_url = members_url - self.public_members_url = public_members_url - self.avatar_url = avatar_url - self.description = description - self.name = name - self.company = company - self.blog = blog - self.location = location - self.email = email - self.twitter_username = twitter_username - self.is_verified = is_verified - self.has_organization_projects = has_organization_projects - self.has_repository_projects = has_repository_projects - self.public_repos = public_repos - self.public_gists = public_gists - self.followers = followers - self.following = following - self.html_url = html_url - self._type = _type - self.total_private_repos = total_private_repos - self.owned_private_repos = owned_private_repos - self.private_gists = private_gists - self.disk_usage = disk_usage - self.collaborators = collaborators - self.billing_email = billing_email - self.plan = plan - self.default_repository_permission = default_repository_permission - self.members_can_create_repositories = members_can_create_repositories - self.two_factor_requirement_enabled = two_factor_requirement_enabled - self.members_allowed_repository_creation_type = members_allowed_repository_creation_type - self.members_can_create_public_repositories = members_can_create_public_repositories - self.members_can_create_private_repositories = members_can_create_private_repositories - self.members_can_create_internal_repositories = members_can_create_internal_repositories - self.members_can_create_pages = members_can_create_pages - self.members_can_create_public_pages = members_can_create_public_pages - self.members_can_create_private_pages = members_can_create_private_pages - self.members_can_fork_private_repositories = members_can_fork_private_repositories - self.web_commit_signoff_required = web_commit_signoff_required - self.advanced_security_enabled_for_new_repositories = advanced_security_enabled_for_new_repositories - self.dependabot_alerts_enabled_for_new_repositories = dependabot_alerts_enabled_for_new_repositories - self.dependabot_security_updates_enabled_for_new_repositories = dependabot_security_updates_enabled_for_new_repositories - self.dependency_graph_enabled_for_new_repositories = dependency_graph_enabled_for_new_repositories - self.secret_scanning_enabled_for_new_repositories = secret_scanning_enabled_for_new_repositories - self.secret_scanning_push_protection_enabled_for_new_repositories = secret_scanning_push_protection_enabled_for_new_repositories - self.secret_scanning_push_protection_custom_link_enabled = secret_scanning_push_protection_custom_link_enabled - self.secret_scanning_push_protection_custom_link = secret_scanning_push_protection_custom_link - self.created_at = created_at - self.updated_at = updated_at - self.archived_at = archived_at + self.advanced_security = advanced_security + self.dependabot_security_updates = dependabot_security_updates + self.secret_scanning = secret_scanning + self.secret_scanning_push_protection = secret_scanning_push_protection } public enum CodingKeys: String, CodingKey { - case login - case id - case node_id - case url - case repos_url - case events_url - case hooks_url - case issues_url - case members_url - case public_members_url - case avatar_url - case description - case name - case company - case blog - case location - case email - case twitter_username - case is_verified - case has_organization_projects - case has_repository_projects - case public_repos - case public_gists - case followers - case following - case html_url - case _type = "type" - case total_private_repos - case owned_private_repos - case private_gists - case disk_usage - case collaborators - case billing_email - case plan - case default_repository_permission - case members_can_create_repositories - case two_factor_requirement_enabled - case members_allowed_repository_creation_type - case members_can_create_public_repositories - case members_can_create_private_repositories - case members_can_create_internal_repositories - case members_can_create_pages - case members_can_create_public_pages - case members_can_create_private_pages - case members_can_fork_private_repositories - case web_commit_signoff_required - case advanced_security_enabled_for_new_repositories - case dependabot_alerts_enabled_for_new_repositories - case dependabot_security_updates_enabled_for_new_repositories - case dependency_graph_enabled_for_new_repositories - case secret_scanning_enabled_for_new_repositories - case secret_scanning_push_protection_enabled_for_new_repositories - case secret_scanning_push_protection_custom_link_enabled - case secret_scanning_push_protection_custom_link - case created_at - case updated_at - case archived_at + case advanced_security + case dependabot_security_updates + case secret_scanning + case secret_scanning_push_protection } } - /// Groups of organization members that gives permissions on specified repositories. + /// Minimal Repository /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + /// - Remark: Generated from `#/components/schemas/minimal-repository`. + public struct minimal_hyphen_repository: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/minimal-repository/id`. public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + /// - Remark: Generated from `#/components/schemas/minimal-repository/node_id`. public var node_id: Swift.String - /// URL for the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + /// - Remark: Generated from `#/components/schemas/minimal-repository/name`. public var name: Swift.String - /// Description of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. - public var description: Swift.String? - /// Permission that the team will have for its repositories - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + /// - Remark: Generated from `#/components/schemas/minimal-repository/full_name`. + public var full_name: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/owner`. + public var owner: Components.Schemas.simple_hyphen_user + /// - Remark: Generated from `#/components/schemas/minimal-repository/private`. + public var _private: Swift.Bool + /// - Remark: Generated from `#/components/schemas/minimal-repository/html_url`. public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment + /// - Remark: Generated from `#/components/schemas/minimal-repository/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/fork`. + public var fork: Swift.Bool + /// - Remark: Generated from `#/components/schemas/minimal-repository/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/archive_url`. + public var archive_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/assignees_url`. + public var assignees_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/blobs_url`. + public var blobs_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/branches_url`. + public var branches_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/collaborators_url`. + public var collaborators_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/comments_url`. + public var comments_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/commits_url`. + public var commits_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/compare_url`. + public var compare_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/contents_url`. + public var contents_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/contributors_url`. + public var contributors_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/deployments_url`. + public var deployments_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/downloads_url`. + public var downloads_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/forks_url`. + public var forks_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/git_commits_url`. + public var git_commits_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/git_refs_url`. + public var git_refs_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/git_tags_url`. + public var git_tags_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/git_url`. + public var git_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/issue_comment_url`. + public var issue_comment_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/issue_events_url`. + public var issue_events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/issues_url`. + public var issues_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/keys_url`. + public var keys_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/labels_url`. + public var labels_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/languages_url`. + public var languages_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/merges_url`. + public var merges_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/milestones_url`. + public var milestones_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/notifications_url`. + public var notifications_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/pulls_url`. + public var pulls_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/releases_url`. + public var releases_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/ssh_url`. + public var ssh_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/stargazers_url`. + public var stargazers_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/statuses_url`. + public var statuses_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/subscribers_url`. + public var subscribers_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/subscription_url`. + public var subscription_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/tags_url`. + public var tags_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/teams_url`. + public var teams_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/trees_url`. + public var trees_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/clone_url`. + public var clone_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/mirror_url`. + public var mirror_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/hooks_url`. + public var hooks_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/svn_url`. + public var svn_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/homepage`. + public var homepage: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/language`. + public var language: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/forks_count`. + public var forks_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/stargazers_count`. + public var stargazers_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/watchers_count`. + public var watchers_count: Swift.Int? + /// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// - Remark: Generated from `#/components/schemas/minimal-repository/size`. + public var size: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/default_branch`. + public var default_branch: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/open_issues_count`. + public var open_issues_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/is_template`. + public var is_template: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/topics`. + public var topics: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_issues`. + public var has_issues: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_projects`. + public var has_projects: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_wiki`. + public var has_wiki: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pages`. + public var has_pages: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_downloads`. + public var has_downloads: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. + public var has_discussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. + public var archived: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. + public var disabled: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/visibility`. + public var visibility: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/pushed_at`. + public var pushed_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/minimal-repository/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/minimal-repository/updated_at`. + public var updated_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/admin`. + public var admin: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/maintain`. + public var maintain: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/push`. + public var push: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/triage`. + public var triage: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/pull`. + public var pull: Swift.Bool? + /// Creates a new `permissionsPayload`. + /// + /// - Parameters: + /// - admin: + /// - maintain: + /// - push: + /// - triage: + /// - pull: + public init( + admin: Swift.Bool? = nil, + maintain: Swift.Bool? = nil, + push: Swift.Bool? = nil, + triage: Swift.Bool? = nil, + pull: Swift.Bool? = nil + ) { + self.admin = admin + self.maintain = maintain + self.push = push + self.triage = triage + self.pull = pull + } + public enum CodingKeys: String, CodingKey { + case admin + case maintain + case push + case triage + case pull + } + } + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions`. + public var permissions: Components.Schemas.minimal_hyphen_repository.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/role_name`. + public var role_name: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/temp_clone_token`. + public var temp_clone_token: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/delete_branch_on_merge`. + public var delete_branch_on_merge: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/subscribers_count`. + public var subscribers_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/network_count`. + public var network_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/code_of_conduct`. + public var code_of_conduct: Components.Schemas.code_hyphen_of_hyphen_conduct? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license`. + public struct licensePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/key`. + public var key: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/spdx_id`. + public var spdx_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/node_id`. + public var node_id: Swift.String? + /// Creates a new `licensePayload`. + /// + /// - Parameters: + /// - key: + /// - name: + /// - spdx_id: + /// - url: + /// - node_id: + public init( + key: Swift.String? = nil, + name: Swift.String? = nil, + spdx_id: Swift.String? = nil, + url: Swift.String? = nil, + node_id: Swift.String? = nil + ) { + self.key = key + self.name = name + self.spdx_id = spdx_id + self.url = url + self.node_id = node_id + } + public enum CodingKeys: String, CodingKey { + case key + case name + case spdx_id + case url + case node_id + } + } + /// - Remark: Generated from `#/components/schemas/minimal-repository/license`. + public var license: Components.Schemas.minimal_hyphen_repository.licensePayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/forks`. + public var forks: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/open_issues`. + public var open_issues: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/watchers`. + public var watchers: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/allow_forking`. + public var allow_forking: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/web_commit_signoff_required`. + public var web_commit_signoff_required: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. + public var security_and_analysis: Components.Schemas.security_hyphen_and_hyphen_analysis? + /// Creates a new `minimal_hyphen_repository`. /// /// - Parameters: - /// - id: Unique identifier of the team + /// - id: /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set + /// - name: + /// - full_name: + /// - owner: + /// - _private: /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + /// - description: + /// - fork: + /// - url: + /// - archive_url: + /// - assignees_url: + /// - blobs_url: + /// - branches_url: + /// - collaborators_url: + /// - comments_url: + /// - commits_url: + /// - compare_url: + /// - contents_url: + /// - contributors_url: + /// - deployments_url: + /// - downloads_url: + /// - events_url: + /// - forks_url: + /// - git_commits_url: + /// - git_refs_url: + /// - git_tags_url: + /// - git_url: + /// - issue_comment_url: + /// - issue_events_url: + /// - issues_url: + /// - keys_url: + /// - labels_url: + /// - languages_url: + /// - merges_url: + /// - milestones_url: + /// - notifications_url: + /// - pulls_url: + /// - releases_url: + /// - ssh_url: + /// - stargazers_url: + /// - statuses_url: + /// - subscribers_url: + /// - subscription_url: + /// - tags_url: + /// - teams_url: + /// - trees_url: + /// - clone_url: + /// - mirror_url: + /// - hooks_url: + /// - svn_url: + /// - homepage: + /// - language: + /// - forks_count: + /// - stargazers_count: + /// - watchers_count: + /// - size: The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + /// - default_branch: + /// - open_issues_count: + /// - is_template: + /// - topics: + /// - has_issues: + /// - has_projects: + /// - has_wiki: + /// - has_pages: + /// - has_downloads: + /// - has_discussions: + /// - archived: + /// - disabled: + /// - visibility: + /// - pushed_at: + /// - created_at: + /// - updated_at: + /// - permissions: + /// - role_name: + /// - temp_clone_token: + /// - delete_branch_on_merge: + /// - subscribers_count: + /// - network_count: + /// - code_of_conduct: + /// - license: + /// - forks: + /// - open_issues: + /// - watchers: + /// - allow_forking: + /// - web_commit_signoff_required: + /// - security_and_analysis: public init( id: Swift.Int, node_id: Swift.String, - url: Swift.String, - members_url: Swift.String, name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, + full_name: Swift.String, + owner: Components.Schemas.simple_hyphen_user, + _private: Swift.Bool, html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil + description: Swift.String? = nil, + fork: Swift.Bool, + url: Swift.String, + archive_url: Swift.String, + assignees_url: Swift.String, + blobs_url: Swift.String, + branches_url: Swift.String, + collaborators_url: Swift.String, + comments_url: Swift.String, + commits_url: Swift.String, + compare_url: Swift.String, + contents_url: Swift.String, + contributors_url: Swift.String, + deployments_url: Swift.String, + downloads_url: Swift.String, + events_url: Swift.String, + forks_url: Swift.String, + git_commits_url: Swift.String, + git_refs_url: Swift.String, + git_tags_url: Swift.String, + git_url: Swift.String? = nil, + issue_comment_url: Swift.String, + issue_events_url: Swift.String, + issues_url: Swift.String, + keys_url: Swift.String, + labels_url: Swift.String, + languages_url: Swift.String, + merges_url: Swift.String, + milestones_url: Swift.String, + notifications_url: Swift.String, + pulls_url: Swift.String, + releases_url: Swift.String, + ssh_url: Swift.String? = nil, + stargazers_url: Swift.String, + statuses_url: Swift.String, + subscribers_url: Swift.String, + subscription_url: Swift.String, + tags_url: Swift.String, + teams_url: Swift.String, + trees_url: Swift.String, + clone_url: Swift.String? = nil, + mirror_url: Swift.String? = nil, + hooks_url: Swift.String, + svn_url: Swift.String? = nil, + homepage: Swift.String? = nil, + language: Swift.String? = nil, + forks_count: Swift.Int? = nil, + stargazers_count: Swift.Int? = nil, + watchers_count: Swift.Int? = nil, + size: Swift.Int? = nil, + default_branch: Swift.String? = nil, + open_issues_count: Swift.Int? = nil, + is_template: Swift.Bool? = nil, + topics: [Swift.String]? = nil, + has_issues: Swift.Bool? = nil, + has_projects: Swift.Bool? = nil, + has_wiki: Swift.Bool? = nil, + has_pages: Swift.Bool? = nil, + has_downloads: Swift.Bool? = nil, + has_discussions: Swift.Bool? = nil, + archived: Swift.Bool? = nil, + disabled: Swift.Bool? = nil, + visibility: Swift.String? = nil, + pushed_at: Foundation.Date? = nil, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + permissions: Components.Schemas.minimal_hyphen_repository.permissionsPayload? = nil, + role_name: Swift.String? = nil, + temp_clone_token: Swift.String? = nil, + delete_branch_on_merge: Swift.Bool? = nil, + subscribers_count: Swift.Int? = nil, + network_count: Swift.Int? = nil, + code_of_conduct: Components.Schemas.code_hyphen_of_hyphen_conduct? = nil, + license: Components.Schemas.minimal_hyphen_repository.licensePayload? = nil, + forks: Swift.Int? = nil, + open_issues: Swift.Int? = nil, + watchers: Swift.Int? = nil, + allow_forking: Swift.Bool? = nil, + web_commit_signoff_required: Swift.Bool? = nil, + security_and_analysis: Components.Schemas.security_hyphen_and_hyphen_analysis? = nil ) { self.id = id self.node_id = node_id - self.url = url - self.members_url = members_url self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting + self.full_name = full_name + self.owner = owner + self._private = _private self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn + self.description = description + self.fork = fork + self.url = url + self.archive_url = archive_url + self.assignees_url = assignees_url + self.blobs_url = blobs_url + self.branches_url = branches_url + self.collaborators_url = collaborators_url + self.comments_url = comments_url + self.commits_url = commits_url + self.compare_url = compare_url + self.contents_url = contents_url + self.contributors_url = contributors_url + self.deployments_url = deployments_url + self.downloads_url = downloads_url + self.events_url = events_url + self.forks_url = forks_url + self.git_commits_url = git_commits_url + self.git_refs_url = git_refs_url + self.git_tags_url = git_tags_url + self.git_url = git_url + self.issue_comment_url = issue_comment_url + self.issue_events_url = issue_events_url + self.issues_url = issues_url + self.keys_url = keys_url + self.labels_url = labels_url + self.languages_url = languages_url + self.merges_url = merges_url + self.milestones_url = milestones_url + self.notifications_url = notifications_url + self.pulls_url = pulls_url + self.releases_url = releases_url + self.ssh_url = ssh_url + self.stargazers_url = stargazers_url + self.statuses_url = statuses_url + self.subscribers_url = subscribers_url + self.subscription_url = subscription_url + self.tags_url = tags_url + self.teams_url = teams_url + self.trees_url = trees_url + self.clone_url = clone_url + self.mirror_url = mirror_url + self.hooks_url = hooks_url + self.svn_url = svn_url + self.homepage = homepage + self.language = language + self.forks_count = forks_count + self.stargazers_count = stargazers_count + self.watchers_count = watchers_count + self.size = size + self.default_branch = default_branch + self.open_issues_count = open_issues_count + self.is_template = is_template + self.topics = topics + self.has_issues = has_issues + self.has_projects = has_projects + self.has_wiki = has_wiki + self.has_pages = has_pages + self.has_downloads = has_downloads + self.has_discussions = has_discussions + self.archived = archived + self.disabled = disabled + self.visibility = visibility + self.pushed_at = pushed_at + self.created_at = created_at + self.updated_at = updated_at + self.permissions = permissions + self.role_name = role_name + self.temp_clone_token = temp_clone_token + self.delete_branch_on_merge = delete_branch_on_merge + self.subscribers_count = subscribers_count + self.network_count = network_count + self.code_of_conduct = code_of_conduct + self.license = license + self.forks = forks + self.open_issues = open_issues + self.watchers = watchers + self.allow_forking = allow_forking + self.web_commit_signoff_required = web_commit_signoff_required + self.security_and_analysis = security_and_analysis } public enum CodingKeys: String, CodingKey { case id case node_id - case url - case members_url case name - case description - case permission - case privacy - case notification_setting + case full_name + case owner + case _private = "private" case html_url - case repositories_url - case slug - case ldap_dn + case description + case fork + case url + case archive_url + case assignees_url + case blobs_url + case branches_url + case collaborators_url + case comments_url + case commits_url + case compare_url + case contents_url + case contributors_url + case deployments_url + case downloads_url + case events_url + case forks_url + case git_commits_url + case git_refs_url + case git_tags_url + case git_url + case issue_comment_url + case issue_events_url + case issues_url + case keys_url + case labels_url + case languages_url + case merges_url + case milestones_url + case notifications_url + case pulls_url + case releases_url + case ssh_url + case stargazers_url + case statuses_url + case subscribers_url + case subscription_url + case tags_url + case teams_url + case trees_url + case clone_url + case mirror_url + case hooks_url + case svn_url + case homepage + case language + case forks_count + case stargazers_count + case watchers_count + case size + case default_branch + case open_issues_count + case is_template + case topics + case has_issues + case has_projects + case has_wiki + case has_pages + case has_downloads + case has_discussions + case archived + case disabled + case visibility + case pushed_at + case created_at + case updated_at + case permissions + case role_name + case temp_clone_token + case delete_branch_on_merge + case subscribers_count + case network_count + case code_of_conduct + case license + case forks + case open_issues + case watchers + case allow_forking + case web_commit_signoff_required + case security_and_analysis } } - /// Groups of organization members that gives permissions on specified repositories. + /// Organization Full /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. + /// - Remark: Generated from `#/components/schemas/organization-full`. + public struct organization_hyphen_full: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/organization-full/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-full/id`. public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. + /// - Remark: Generated from `#/components/schemas/organization-full/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. + /// - Remark: Generated from `#/components/schemas/organization-full/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-full/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-full/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-full/hooks_url`. + public var hooks_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-full/issues_url`. + public var issues_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-full/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-full/public_members_url`. + public var public_members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-full/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-full/description`. public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. + /// - Remark: Generated from `#/components/schemas/organization-full/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-full/company`. + public var company: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-full/blog`. + public var blog: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-full/location`. + public var location: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-full/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-full/twitter_username`. + public var twitter_username: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-full/is_verified`. + public var is_verified: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/has_organization_projects`. + public var has_organization_projects: Swift.Bool + /// - Remark: Generated from `#/components/schemas/organization-full/has_repository_projects`. + public var has_repository_projects: Swift.Bool + /// - Remark: Generated from `#/components/schemas/organization-full/public_repos`. + public var public_repos: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization-full/public_gists`. + public var public_gists: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization-full/followers`. + public var followers: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization-full/following`. + public var following: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization-full/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-full/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-full/total_private_repos`. + public var total_private_repos: Swift.Int? + /// - Remark: Generated from `#/components/schemas/organization-full/owned_private_repos`. + public var owned_private_repos: Swift.Int? + /// - Remark: Generated from `#/components/schemas/organization-full/private_gists`. + public var private_gists: Swift.Int? + /// - Remark: Generated from `#/components/schemas/organization-full/disk_usage`. + public var disk_usage: Swift.Int? + /// - Remark: Generated from `#/components/schemas/organization-full/collaborators`. + public var collaborators: Swift.Int? + /// - Remark: Generated from `#/components/schemas/organization-full/billing_email`. + public var billing_email: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-full/plan`. + public struct planPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/organization-full/plan/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-full/plan/space`. + public var space: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization-full/plan/private_repos`. + public var private_repos: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization-full/plan/filled_seats`. + public var filled_seats: Swift.Int? + /// - Remark: Generated from `#/components/schemas/organization-full/plan/seats`. + public var seats: Swift.Int? + /// Creates a new `planPayload`. /// /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: + /// - name: + /// - space: + /// - private_repos: + /// - filled_seats: + /// - seats: public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool + name: Swift.String, + space: Swift.Int, + private_repos: Swift.Int, + filled_seats: Swift.Int? = nil, + seats: Swift.Int? = nil ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin + self.name = name + self.space = space + self.private_repos = private_repos + self.filled_seats = filled_seats + self.seats = seats } public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin + case name + case space + case private_repos + case filled_seats + case seats } } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. + /// - Remark: Generated from `#/components/schemas/organization-full/plan`. + public var plan: Components.Schemas.organization_hyphen_full.planPayload? + /// - Remark: Generated from `#/components/schemas/organization-full/default_repository_permission`. + public var default_repository_permission: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_repositories`. + public var members_can_create_repositories: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/two_factor_requirement_enabled`. + public var two_factor_requirement_enabled: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_allowed_repository_creation_type`. + public var members_allowed_repository_creation_type: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_public_repositories`. + public var members_can_create_public_repositories: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_private_repositories`. + public var members_can_create_private_repositories: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_internal_repositories`. + public var members_can_create_internal_repositories: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_pages`. + public var members_can_create_pages: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_public_pages`. + public var members_can_create_public_pages: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_private_pages`. + public var members_can_create_private_pages: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_fork_private_repositories`. + public var members_can_fork_private_repositories: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/web_commit_signoff_required`. + public var web_commit_signoff_required: Swift.Bool? + /// Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization. + /// + /// This field is only visible to organization owners or members of a team with the security manager role. + /// + /// - Remark: Generated from `#/components/schemas/organization-full/advanced_security_enabled_for_new_repositories`. + public var advanced_security_enabled_for_new_repositories: Swift.Bool? + /// Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to + /// this organization. + /// + /// This field is only visible to organization owners or members of a team with the security manager role. + /// + /// - Remark: Generated from `#/components/schemas/organization-full/dependabot_alerts_enabled_for_new_repositories`. + public var dependabot_alerts_enabled_for_new_repositories: Swift.Bool? + /// Whether dependabot security updates are automatically enabled for new repositories and repositories transferred + /// to this organization. + /// + /// This field is only visible to organization owners or members of a team with the security manager role. + /// + /// - Remark: Generated from `#/components/schemas/organization-full/dependabot_security_updates_enabled_for_new_repositories`. + public var dependabot_security_updates_enabled_for_new_repositories: Swift.Bool? + /// Whether dependency graph is automatically enabled for new repositories and repositories transferred to this + /// organization. + /// + /// This field is only visible to organization owners or members of a team with the security manager role. + /// + /// - Remark: Generated from `#/components/schemas/organization-full/dependency_graph_enabled_for_new_repositories`. + public var dependency_graph_enabled_for_new_repositories: Swift.Bool? + /// Whether secret scanning is automatically enabled for new repositories and repositories transferred to this + /// organization. + /// + /// This field is only visible to organization owners or members of a team with the security manager role. + /// + /// - Remark: Generated from `#/components/schemas/organization-full/secret_scanning_enabled_for_new_repositories`. + public var secret_scanning_enabled_for_new_repositories: Swift.Bool? + /// Whether secret scanning push protection is automatically enabled for new repositories and repositories + /// transferred to this organization. + /// + /// This field is only visible to organization owners or members of a team with the security manager role. + /// + /// - Remark: Generated from `#/components/schemas/organization-full/secret_scanning_push_protection_enabled_for_new_repositories`. + public var secret_scanning_push_protection_enabled_for_new_repositories: Swift.Bool? + /// Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. + /// + /// - Remark: Generated from `#/components/schemas/organization-full/secret_scanning_push_protection_custom_link_enabled`. + public var secret_scanning_push_protection_custom_link_enabled: Swift.Bool? + /// An optional URL string to display to contributors who are blocked from pushing a secret. + /// + /// - Remark: Generated from `#/components/schemas/organization-full/secret_scanning_push_protection_custom_link`. + public var secret_scanning_push_protection_custom_link: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-full/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/organization-full/updated_at`. + public var updated_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/organization-full/archived_at`. + public var archived_at: Foundation.Date? + /// Creates a new `organization_hyphen_full`. /// /// - Parameters: + /// - login: /// - id: /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: /// - url: - /// - html_url: + /// - repos_url: + /// - events_url: + /// - hooks_url: + /// - issues_url: /// - members_url: - /// - repositories_url: - /// - parent: + /// - public_members_url: + /// - avatar_url: + /// - description: + /// - name: + /// - company: + /// - blog: + /// - location: + /// - email: + /// - twitter_username: + /// - is_verified: + /// - has_organization_projects: + /// - has_repository_projects: + /// - public_repos: + /// - public_gists: + /// - followers: + /// - following: + /// - html_url: + /// - _type: + /// - total_private_repos: + /// - owned_private_repos: + /// - private_gists: + /// - disk_usage: + /// - collaborators: + /// - billing_email: + /// - plan: + /// - default_repository_permission: + /// - members_can_create_repositories: + /// - two_factor_requirement_enabled: + /// - members_allowed_repository_creation_type: + /// - members_can_create_public_repositories: + /// - members_can_create_private_repositories: + /// - members_can_create_internal_repositories: + /// - members_can_create_pages: + /// - members_can_create_public_pages: + /// - members_can_create_private_pages: + /// - members_can_fork_private_repositories: + /// - web_commit_signoff_required: + /// - advanced_security_enabled_for_new_repositories: Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization. + /// - dependabot_alerts_enabled_for_new_repositories: Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to + /// - dependabot_security_updates_enabled_for_new_repositories: Whether dependabot security updates are automatically enabled for new repositories and repositories transferred + /// - dependency_graph_enabled_for_new_repositories: Whether dependency graph is automatically enabled for new repositories and repositories transferred to this + /// - secret_scanning_enabled_for_new_repositories: Whether secret scanning is automatically enabled for new repositories and repositories transferred to this + /// - secret_scanning_push_protection_enabled_for_new_repositories: Whether secret scanning push protection is automatically enabled for new repositories and repositories + /// - secret_scanning_push_protection_custom_link_enabled: Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. + /// - secret_scanning_push_protection_custom_link: An optional URL string to display to contributors who are blocked from pushing a secret. + /// - created_at: + /// - updated_at: + /// - archived_at: public init( + login: Swift.String, id: Swift.Int, node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, url: Swift.String, - html_url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + hooks_url: Swift.String, + issues_url: Swift.String, members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + public_members_url: Swift.String, + avatar_url: Swift.String, + description: Swift.String? = nil, + name: Swift.String? = nil, + company: Swift.String? = nil, + blog: Swift.String? = nil, + location: Swift.String? = nil, + email: Swift.String? = nil, + twitter_username: Swift.String? = nil, + is_verified: Swift.Bool? = nil, + has_organization_projects: Swift.Bool, + has_repository_projects: Swift.Bool, + public_repos: Swift.Int, + public_gists: Swift.Int, + followers: Swift.Int, + following: Swift.Int, + html_url: Swift.String, + _type: Swift.String, + total_private_repos: Swift.Int? = nil, + owned_private_repos: Swift.Int? = nil, + private_gists: Swift.Int? = nil, + disk_usage: Swift.Int? = nil, + collaborators: Swift.Int? = nil, + billing_email: Swift.String? = nil, + plan: Components.Schemas.organization_hyphen_full.planPayload? = nil, + default_repository_permission: Swift.String? = nil, + members_can_create_repositories: Swift.Bool? = nil, + two_factor_requirement_enabled: Swift.Bool? = nil, + members_allowed_repository_creation_type: Swift.String? = nil, + members_can_create_public_repositories: Swift.Bool? = nil, + members_can_create_private_repositories: Swift.Bool? = nil, + members_can_create_internal_repositories: Swift.Bool? = nil, + members_can_create_pages: Swift.Bool? = nil, + members_can_create_public_pages: Swift.Bool? = nil, + members_can_create_private_pages: Swift.Bool? = nil, + members_can_fork_private_repositories: Swift.Bool? = nil, + web_commit_signoff_required: Swift.Bool? = nil, + advanced_security_enabled_for_new_repositories: Swift.Bool? = nil, + dependabot_alerts_enabled_for_new_repositories: Swift.Bool? = nil, + dependabot_security_updates_enabled_for_new_repositories: Swift.Bool? = nil, + dependency_graph_enabled_for_new_repositories: Swift.Bool? = nil, + secret_scanning_enabled_for_new_repositories: Swift.Bool? = nil, + secret_scanning_push_protection_enabled_for_new_repositories: Swift.Bool? = nil, + secret_scanning_push_protection_custom_link_enabled: Swift.Bool? = nil, + secret_scanning_push_protection_custom_link: Swift.String? = nil, + created_at: Foundation.Date, + updated_at: Foundation.Date, + archived_at: Foundation.Date? = nil ) { + self.login = login self.id = id self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions self.url = url + self.repos_url = repos_url + self.events_url = events_url + self.hooks_url = hooks_url + self.issues_url = issues_url + self.members_url = members_url + self.public_members_url = public_members_url + self.avatar_url = avatar_url + self.description = description + self.name = name + self.company = company + self.blog = blog + self.location = location + self.email = email + self.twitter_username = twitter_username + self.is_verified = is_verified + self.has_organization_projects = has_organization_projects + self.has_repository_projects = has_repository_projects + self.public_repos = public_repos + self.public_gists = public_gists + self.followers = followers + self.following = following self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent + self._type = _type + self.total_private_repos = total_private_repos + self.owned_private_repos = owned_private_repos + self.private_gists = private_gists + self.disk_usage = disk_usage + self.collaborators = collaborators + self.billing_email = billing_email + self.plan = plan + self.default_repository_permission = default_repository_permission + self.members_can_create_repositories = members_can_create_repositories + self.two_factor_requirement_enabled = two_factor_requirement_enabled + self.members_allowed_repository_creation_type = members_allowed_repository_creation_type + self.members_can_create_public_repositories = members_can_create_public_repositories + self.members_can_create_private_repositories = members_can_create_private_repositories + self.members_can_create_internal_repositories = members_can_create_internal_repositories + self.members_can_create_pages = members_can_create_pages + self.members_can_create_public_pages = members_can_create_public_pages + self.members_can_create_private_pages = members_can_create_private_pages + self.members_can_fork_private_repositories = members_can_fork_private_repositories + self.web_commit_signoff_required = web_commit_signoff_required + self.advanced_security_enabled_for_new_repositories = advanced_security_enabled_for_new_repositories + self.dependabot_alerts_enabled_for_new_repositories = dependabot_alerts_enabled_for_new_repositories + self.dependabot_security_updates_enabled_for_new_repositories = dependabot_security_updates_enabled_for_new_repositories + self.dependency_graph_enabled_for_new_repositories = dependency_graph_enabled_for_new_repositories + self.secret_scanning_enabled_for_new_repositories = secret_scanning_enabled_for_new_repositories + self.secret_scanning_push_protection_enabled_for_new_repositories = secret_scanning_push_protection_enabled_for_new_repositories + self.secret_scanning_push_protection_custom_link_enabled = secret_scanning_push_protection_custom_link_enabled + self.secret_scanning_push_protection_custom_link = secret_scanning_push_protection_custom_link + self.created_at = created_at + self.updated_at = updated_at + self.archived_at = archived_at } public enum CodingKeys: String, CodingKey { + case login case id case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions case url - case html_url + case repos_url + case events_url + case hooks_url + case issues_url case members_url - case repositories_url - case parent + case public_members_url + case avatar_url + case description + case name + case company + case blog + case location + case email + case twitter_username + case is_verified + case has_organization_projects + case has_repository_projects + case public_repos + case public_gists + case followers + case following + case html_url + case _type = "type" + case total_private_repos + case owned_private_repos + case private_gists + case disk_usage + case collaborators + case billing_email + case plan + case default_repository_permission + case members_can_create_repositories + case two_factor_requirement_enabled + case members_allowed_repository_creation_type + case members_can_create_public_repositories + case members_can_create_private_repositories + case members_can_create_internal_repositories + case members_can_create_pages + case members_can_create_public_pages + case members_can_create_private_pages + case members_can_fork_private_repositories + case web_commit_signoff_required + case advanced_security_enabled_for_new_repositories + case dependabot_alerts_enabled_for_new_repositories + case dependabot_security_updates_enabled_for_new_repositories + case dependency_graph_enabled_for_new_repositories + case secret_scanning_enabled_for_new_repositories + case secret_scanning_push_protection_enabled_for_new_repositories + case secret_scanning_push_protection_custom_link_enabled + case secret_scanning_push_protection_custom_link + case created_at + case updated_at + case archived_at } } /// Organization Invitation @@ -7083,6 +7115,14 @@ public enum Components { } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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 `#/components/parameters/pagination-before`. + public typealias pagination_hyphen_before = Swift.String + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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 `#/components/parameters/pagination-after`. + public typealias pagination_hyphen_after = Swift.String /// The direction to sort the results by. /// /// - Remark: Generated from `#/components/parameters/direction`. @@ -8525,6 +8565,296 @@ public enum Operations { } } } + /// List attestations + /// + /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /orgs/{org}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)`. + public enum orgs_sol_list_hyphen_attestations { + public static let id: Swift.String = "orgs/list-attestations" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path/org`. + public var org: Components.Parameters.org + /// The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path/subject_digest`. + public var subject_digest: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - subject_digest: The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + public init( + org: Components.Parameters.org, + subject_digest: Swift.String + ) { + self.org = org + self.subject_digest = subject_digest + } + } + public var path: Operations.orgs_sol_list_hyphen_attestations.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_page? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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}/attestations/{subject_digest}/GET/query/before`. + public var before: Components.Parameters.pagination_hyphen_before? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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}/attestations/{subject_digest}/GET/query/after`. + public var after: Components.Parameters.pagination_hyphen_after? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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( + per_page: Components.Parameters.per_hyphen_page? = nil, + before: Components.Parameters.pagination_hyphen_before? = nil, + after: Components.Parameters.pagination_hyphen_after? = nil + ) { + self.per_page = per_page + self.before = before + self.after = after + } + } + public var query: Operations.orgs_sol_list_hyphen_attestations.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/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.orgs_sol_list_hyphen_attestations.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.orgs_sol_list_hyphen_attestations.Input.Path, + query: Operations.orgs_sol_list_hyphen_attestations.Input.Query = .init(), + headers: Operations.orgs_sol_list_hyphen_attestations.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}/attestations/{subject_digest}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload`. + public struct attestationsPayloadPayload: Codable, Hashable, Sendable { + /// The attestation's Sigstore Bundle. + /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle`. + public struct bundlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/mediaType`. + public var mediaType: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/verificationMaterial`. + public struct verificationMaterialPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `verificationMaterialPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/verificationMaterial`. + public var verificationMaterial: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload.verificationMaterialPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/dsseEnvelope`. + public struct dsseEnvelopePayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `dsseEnvelopePayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/dsseEnvelope`. + public var dsseEnvelope: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload.dsseEnvelopePayload? + /// Creates a new `bundlePayload`. + /// + /// - Parameters: + /// - mediaType: + /// - verificationMaterial: + /// - dsseEnvelope: + public init( + mediaType: Swift.String? = nil, + verificationMaterial: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload.verificationMaterialPayload? = nil, + dsseEnvelope: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload.dsseEnvelopePayload? = nil + ) { + self.mediaType = mediaType + self.verificationMaterial = verificationMaterial + self.dsseEnvelope = dsseEnvelope + } + public enum CodingKeys: String, CodingKey { + case mediaType + case verificationMaterial + case dsseEnvelope + } + } + /// The attestation's Sigstore Bundle. + /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle`. + public var bundle: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/repository_id`. + public var repository_id: Swift.Int? + /// Creates a new `attestationsPayloadPayload`. + /// + /// - Parameters: + /// - bundle: The attestation's Sigstore Bundle. + /// - repository_id: + public init( + bundle: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload? = nil, + repository_id: Swift.Int? = nil + ) { + self.bundle = bundle + self.repository_id = repository_id + } + public enum CodingKeys: String, CodingKey { + case bundle + case repository_id + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. + public typealias attestationsPayload = [Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload] + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. + public var attestations: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayload? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - attestations: + public init(attestations: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayload? = nil) { + self.attestations = attestations + } + public enum CodingKeys: String, CodingKey { + case attestations + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/application\/json`. + case json(Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.orgs_sol_list_hyphen_attestations.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.orgs_sol_list_hyphen_attestations.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// List users blocked by an organization /// /// List the users blocked by an organization. diff --git a/Sources/pulls/Types.swift b/Sources/pulls/Types.swift index dd8454dbb2d..0da3033a1f3 100644 --- a/Sources/pulls/Types.swift +++ b/Sources/pulls/Types.swift @@ -2315,212 +2315,6 @@ public enum Components { case anonymous_access_enabled } } - /// A collection of related issues and pull requests. - /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone`. - public struct nullable_hyphen_milestone: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-milestone/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-milestone/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-milestone/labels_url`. - public var labels_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-milestone/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-milestone/node_id`. - public var node_id: Swift.String - /// The number of the milestone. - /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone/number`. - public var number: Swift.Int - /// The state of the milestone. - /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. - @frozen public enum statePayload: String, Codable, Hashable, Sendable { - case open = "open" - case closed = "closed" - } - /// The state of the milestone. - /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. - public var state: Components.Schemas.nullable_hyphen_milestone.statePayload - /// The title of the milestone. - /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone/title`. - public var title: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-milestone/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-milestone/creator`. - public var creator: Components.Schemas.nullable_hyphen_simple_hyphen_user? - /// - Remark: Generated from `#/components/schemas/nullable-milestone/open_issues`. - public var open_issues: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_issues`. - public var closed_issues: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-milestone/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/nullable-milestone/updated_at`. - public var updated_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_at`. - public var closed_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/nullable-milestone/due_on`. - public var due_on: Foundation.Date? - /// Creates a new `nullable_hyphen_milestone`. - /// - /// - Parameters: - /// - url: - /// - html_url: - /// - labels_url: - /// - id: - /// - node_id: - /// - number: The number of the milestone. - /// - state: The state of the milestone. - /// - title: The title of the milestone. - /// - description: - /// - creator: - /// - open_issues: - /// - closed_issues: - /// - created_at: - /// - updated_at: - /// - closed_at: - /// - due_on: - public init( - url: Swift.String, - html_url: Swift.String, - labels_url: Swift.String, - id: Swift.Int, - node_id: Swift.String, - number: Swift.Int, - state: Components.Schemas.nullable_hyphen_milestone.statePayload, - title: Swift.String, - description: Swift.String? = nil, - creator: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, - open_issues: Swift.Int, - closed_issues: Swift.Int, - created_at: Foundation.Date, - updated_at: Foundation.Date, - closed_at: Foundation.Date? = nil, - due_on: Foundation.Date? = nil - ) { - self.url = url - self.html_url = html_url - self.labels_url = labels_url - self.id = id - self.node_id = node_id - self.number = number - self.state = state - self.title = title - self.description = description - self.creator = creator - self.open_issues = open_issues - self.closed_issues = closed_issues - self.created_at = created_at - self.updated_at = updated_at - self.closed_at = closed_at - self.due_on = due_on - } - public enum CodingKeys: String, CodingKey { - case url - case html_url - case labels_url - case id - case node_id - case number - case state - case title - case description - case creator - case open_issues - case closed_issues - case created_at - case updated_at - case closed_at - case due_on - } - } - /// How the author is associated with the repository. - /// - /// - Remark: Generated from `#/components/schemas/author-association`. - @frozen public enum author_hyphen_association: String, Codable, Hashable, Sendable { - case COLLABORATOR = "COLLABORATOR" - case CONTRIBUTOR = "CONTRIBUTOR" - case FIRST_TIMER = "FIRST_TIMER" - case FIRST_TIME_CONTRIBUTOR = "FIRST_TIME_CONTRIBUTOR" - case MANNEQUIN = "MANNEQUIN" - case MEMBER = "MEMBER" - case NONE = "NONE" - case OWNER = "OWNER" - } - /// - Remark: Generated from `#/components/schemas/reaction-rollup`. - public struct reaction_hyphen_rollup: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/reaction-rollup/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/reaction-rollup/total_count`. - public var total_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/+1`. - public var _plus_1: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/-1`. - public var _hyphen_1: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/laugh`. - public var laugh: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/confused`. - public var confused: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/heart`. - public var heart: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/hooray`. - public var hooray: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/eyes`. - public var eyes: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/rocket`. - public var rocket: Swift.Int - /// Creates a new `reaction_hyphen_rollup`. - /// - /// - Parameters: - /// - url: - /// - total_count: - /// - _plus_1: - /// - _hyphen_1: - /// - laugh: - /// - confused: - /// - heart: - /// - hooray: - /// - eyes: - /// - rocket: - public init( - url: Swift.String, - total_count: Swift.Int, - _plus_1: Swift.Int, - _hyphen_1: Swift.Int, - laugh: Swift.Int, - confused: Swift.Int, - heart: Swift.Int, - hooray: Swift.Int, - eyes: Swift.Int, - rocket: Swift.Int - ) { - self.url = url - self.total_count = total_count - self._plus_1 = _plus_1 - self._hyphen_1 = _hyphen_1 - self.laugh = laugh - self.confused = confused - self.heart = heart - self.hooray = hooray - self.eyes = eyes - self.rocket = rocket - } - public enum CodingKeys: String, CodingKey { - case url - case total_count - case _plus_1 = "+1" - case _hyphen_1 = "-1" - case laugh - case confused - case heart - case hooray - case eyes - case rocket - } - } /// Groups of organization members that gives permissions on specified repositories. /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. @@ -2766,6 +2560,212 @@ public enum Components { case parent } } + /// A collection of related issues and pull requests. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone`. + public struct nullable_hyphen_milestone: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-milestone/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/labels_url`. + public var labels_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/node_id`. + public var node_id: Swift.String + /// The number of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/number`. + public var number: Swift.Int + /// The state of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. + @frozen public enum statePayload: String, Codable, Hashable, Sendable { + case open = "open" + case closed = "closed" + } + /// The state of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. + public var state: Components.Schemas.nullable_hyphen_milestone.statePayload + /// The title of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/creator`. + public var creator: Components.Schemas.nullable_hyphen_simple_hyphen_user? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/open_issues`. + public var open_issues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_issues`. + public var closed_issues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-milestone/updated_at`. + public var updated_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_at`. + public var closed_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/due_on`. + public var due_on: Foundation.Date? + /// Creates a new `nullable_hyphen_milestone`. + /// + /// - Parameters: + /// - url: + /// - html_url: + /// - labels_url: + /// - id: + /// - node_id: + /// - number: The number of the milestone. + /// - state: The state of the milestone. + /// - title: The title of the milestone. + /// - description: + /// - creator: + /// - open_issues: + /// - closed_issues: + /// - created_at: + /// - updated_at: + /// - closed_at: + /// - due_on: + public init( + url: Swift.String, + html_url: Swift.String, + labels_url: Swift.String, + id: Swift.Int, + node_id: Swift.String, + number: Swift.Int, + state: Components.Schemas.nullable_hyphen_milestone.statePayload, + title: Swift.String, + description: Swift.String? = nil, + creator: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + open_issues: Swift.Int, + closed_issues: Swift.Int, + created_at: Foundation.Date, + updated_at: Foundation.Date, + closed_at: Foundation.Date? = nil, + due_on: Foundation.Date? = nil + ) { + self.url = url + self.html_url = html_url + self.labels_url = labels_url + self.id = id + self.node_id = node_id + self.number = number + self.state = state + self.title = title + self.description = description + self.creator = creator + self.open_issues = open_issues + self.closed_issues = closed_issues + self.created_at = created_at + self.updated_at = updated_at + self.closed_at = closed_at + self.due_on = due_on + } + public enum CodingKeys: String, CodingKey { + case url + case html_url + case labels_url + case id + case node_id + case number + case state + case title + case description + case creator + case open_issues + case closed_issues + case created_at + case updated_at + case closed_at + case due_on + } + } + /// How the author is associated with the repository. + /// + /// - Remark: Generated from `#/components/schemas/author-association`. + @frozen public enum author_hyphen_association: String, Codable, Hashable, Sendable { + case COLLABORATOR = "COLLABORATOR" + case CONTRIBUTOR = "CONTRIBUTOR" + case FIRST_TIMER = "FIRST_TIMER" + case FIRST_TIME_CONTRIBUTOR = "FIRST_TIME_CONTRIBUTOR" + case MANNEQUIN = "MANNEQUIN" + case MEMBER = "MEMBER" + case NONE = "NONE" + case OWNER = "OWNER" + } + /// - Remark: Generated from `#/components/schemas/reaction-rollup`. + public struct reaction_hyphen_rollup: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/reaction-rollup/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/reaction-rollup/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/+1`. + public var _plus_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/-1`. + public var _hyphen_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/laugh`. + public var laugh: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/confused`. + public var confused: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/heart`. + public var heart: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/hooray`. + public var hooray: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/eyes`. + public var eyes: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/rocket`. + public var rocket: Swift.Int + /// Creates a new `reaction_hyphen_rollup`. + /// + /// - Parameters: + /// - url: + /// - total_count: + /// - _plus_1: + /// - _hyphen_1: + /// - laugh: + /// - confused: + /// - heart: + /// - hooray: + /// - eyes: + /// - rocket: + public init( + url: Swift.String, + total_count: Swift.Int, + _plus_1: Swift.Int, + _hyphen_1: Swift.Int, + laugh: Swift.Int, + confused: Swift.Int, + heart: Swift.Int, + hooray: Swift.Int, + eyes: Swift.Int, + rocket: Swift.Int + ) { + self.url = url + self.total_count = total_count + self._plus_1 = _plus_1 + self._hyphen_1 = _hyphen_1 + self.laugh = laugh + self.confused = confused + self.heart = heart + self.hooray = hooray + self.eyes = eyes + self.rocket = rocket + } + public enum CodingKeys: String, CodingKey { + case url + case total_count + case _plus_1 = "+1" + case _hyphen_1 = "-1" + case laugh + case confused + case heart + case hooray + case eyes + case rocket + } + } /// Groups of organization members that gives permissions on specified repositories. /// /// - Remark: Generated from `#/components/schemas/team-simple`. diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index 74be912e3db..bb0b59efa4e 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -1659,6 +1659,219 @@ public struct Client: APIProtocol { } ) } + /// Create an attestation + /// + /// Store an artifact attestation and associate it with a repository. + /// + /// The authenticated user must have write permission to the repository and, if using a fine-grained access token the `attestations:write` permission is required. + /// + /// Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For amore information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/attestations`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/post(repos/create-attestation)`. + public func repos_sol_create_hyphen_attestation(_ input: Operations.repos_sol_create_hyphen_attestation.Input) async throws -> Operations.repos_sol_create_hyphen_attestation.Output { + try await client.send( + input: input, + forOperation: Operations.repos_sol_create_hyphen_attestation.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/attestations", + 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 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.repos_sol_create_hyphen_attestation.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.repos_sol_create_hyphen_attestation.Output.Created.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.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 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.validation_failed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.validation_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List attestations + /// + /// List a collection of artifact attestations with a given subject digest that are associated with a repository. + /// + /// The authenticated user making the request must have read access to the repository. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/{subject_digest}/get(repos/list-attestations)`. + public func repos_sol_list_hyphen_attestations(_ input: Operations.repos_sol_list_hyphen_attestations.Input) async throws -> Operations.repos_sol_list_hyphen_attestations.Output { + try await client.send( + input: input, + forOperation: Operations.repos_sol_list_hyphen_attestations.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/attestations/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.subject_digest + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + 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.repos_sol_list_hyphen_attestations.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get all autolinks of a repository /// /// Gets all autolinks that are configured for a repository. diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 79064437729..7a346ea909a 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -118,6 +118,28 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /repos/{owner}/{repo}/activity`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/activity/get(repos/list-activities)`. func repos_sol_list_hyphen_activities(_ input: Operations.repos_sol_list_hyphen_activities.Input) async throws -> Operations.repos_sol_list_hyphen_activities.Output + /// Create an attestation + /// + /// Store an artifact attestation and associate it with a repository. + /// + /// The authenticated user must have write permission to the repository and, if using a fine-grained access token the `attestations:write` permission is required. + /// + /// Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For amore information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/attestations`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/post(repos/create-attestation)`. + func repos_sol_create_hyphen_attestation(_ input: Operations.repos_sol_create_hyphen_attestation.Input) async throws -> Operations.repos_sol_create_hyphen_attestation.Output + /// List attestations + /// + /// List a collection of artifact attestations with a given subject digest that are associated with a repository. + /// + /// The authenticated user making the request must have read access to the repository. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/{subject_digest}/get(repos/list-attestations)`. + func repos_sol_list_hyphen_attestations(_ input: Operations.repos_sol_list_hyphen_attestations.Input) async throws -> Operations.repos_sol_list_hyphen_attestations.Output /// Get all autolinks of a repository /// /// Gets all autolinks that are configured for a repository. @@ -2261,6 +2283,48 @@ extension APIProtocol { headers: headers )) } + /// Create an attestation + /// + /// Store an artifact attestation and associate it with a repository. + /// + /// The authenticated user must have write permission to the repository and, if using a fine-grained access token the `attestations:write` permission is required. + /// + /// Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For amore information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/attestations`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/post(repos/create-attestation)`. + public func repos_sol_create_hyphen_attestation( + path: Operations.repos_sol_create_hyphen_attestation.Input.Path, + headers: Operations.repos_sol_create_hyphen_attestation.Input.Headers = .init(), + body: Operations.repos_sol_create_hyphen_attestation.Input.Body + ) async throws -> Operations.repos_sol_create_hyphen_attestation.Output { + try await repos_sol_create_hyphen_attestation(Operations.repos_sol_create_hyphen_attestation.Input( + path: path, + headers: headers, + body: body + )) + } + /// List attestations + /// + /// List a collection of artifact attestations with a given subject digest that are associated with a repository. + /// + /// The authenticated user making the request must have read access to the repository. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/{subject_digest}/get(repos/list-attestations)`. + public func repos_sol_list_hyphen_attestations( + path: Operations.repos_sol_list_hyphen_attestations.Input.Path, + query: Operations.repos_sol_list_hyphen_attestations.Input.Query = .init(), + headers: Operations.repos_sol_list_hyphen_attestations.Input.Headers = .init() + ) async throws -> Operations.repos_sol_list_hyphen_attestations.Output { + try await repos_sol_list_hyphen_attestations(Operations.repos_sol_list_hyphen_attestations.Input( + path: path, + query: query, + headers: headers + )) + } /// Get all autolinks of a repository /// /// Gets all autolinks that are configured for a repository. @@ -7762,589 +7826,834 @@ public enum Components { case html_url } } - /// A collection of related issues and pull requests. + /// Groups of organization members that gives permissions on specified repositories. /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone`. - public struct nullable_hyphen_milestone: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-milestone/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-milestone/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-milestone/labels_url`. - public var labels_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-milestone/id`. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-milestone/node_id`. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. public var node_id: Swift.String - /// The number of the milestone. - /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone/number`. - public var number: Swift.Int - /// The state of the milestone. + /// URL for the team /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. - @frozen public enum statePayload: String, Codable, Hashable, Sendable { - case open = "open" - case closed = "closed" - } - /// The state of the milestone. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. - public var state: Components.Schemas.nullable_hyphen_milestone.statePayload - /// The title of the milestone. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone/title`. - public var title: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-milestone/description`. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-milestone/creator`. - public var creator: Components.Schemas.nullable_hyphen_simple_hyphen_user? - /// - Remark: Generated from `#/components/schemas/nullable-milestone/open_issues`. - public var open_issues: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_issues`. - public var closed_issues: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-milestone/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/nullable-milestone/updated_at`. - public var updated_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_at`. - public var closed_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/nullable-milestone/due_on`. - public var due_on: Foundation.Date? - /// Creates a new `nullable_hyphen_milestone`. + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. /// /// - Parameters: - /// - url: - /// - html_url: - /// - labels_url: - /// - id: + /// - id: Unique identifier of the team /// - node_id: - /// - number: The number of the milestone. - /// - state: The state of the milestone. - /// - title: The title of the milestone. - /// - description: - /// - creator: - /// - open_issues: - /// - closed_issues: - /// - created_at: - /// - updated_at: - /// - closed_at: - /// - due_on: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment public init( - url: Swift.String, - html_url: Swift.String, - labels_url: Swift.String, id: Swift.Int, node_id: Swift.String, - number: Swift.Int, - state: Components.Schemas.nullable_hyphen_milestone.statePayload, - title: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, description: Swift.String? = nil, - creator: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, - open_issues: Swift.Int, - closed_issues: Swift.Int, - created_at: Foundation.Date, - updated_at: Foundation.Date, - closed_at: Foundation.Date? = nil, - due_on: Foundation.Date? = nil + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil ) { - self.url = url - self.html_url = html_url - self.labels_url = labels_url self.id = id self.node_id = node_id - self.number = number - self.state = state - self.title = title + self.url = url + self.members_url = members_url + self.name = name self.description = description - self.creator = creator - self.open_issues = open_issues - self.closed_issues = closed_issues - self.created_at = created_at - self.updated_at = updated_at - self.closed_at = closed_at - self.due_on = due_on + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn } public enum CodingKeys: String, CodingKey { - case url - case html_url - case labels_url case id case node_id - case number - case state - case title + case url + case members_url + case name case description - case creator - case open_issues - case closed_issues - case created_at - case updated_at - case closed_at - case due_on + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn } } - /// GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + /// Groups of organization members that gives permissions on specified repositories. /// - /// - Remark: Generated from `#/components/schemas/nullable-integration`. - public struct nullable_hyphen_integration: Codable, Hashable, Sendable { - /// Unique identifier of the GitHub app - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/id`. + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. public var id: Swift.Int - /// The slug name of the GitHub app - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/slug`. - public var slug: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/node_id`. + /// - Remark: Generated from `#/components/schemas/team/node_id`. public var node_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 - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/name`. + /// - Remark: Generated from `#/components/schemas/team/name`. public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-integration/description`. + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/external_url`. - public var external_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-integration/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-integration/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/nullable-integration/updated_at`. - public var updated_at: Foundation.Date - /// The set of permissions for the GitHub app - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/issues`. - public var issues: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/checks`. - public var checks: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/metadata`. - public var metadata: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/contents`. - public var contents: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/deployments`. - public var deployments: Swift.String? - /// A container of undocumented properties. - public var additionalProperties: [String: Swift.String] + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool /// Creates a new `permissionsPayload`. /// /// - Parameters: - /// - issues: - /// - checks: - /// - metadata: - /// - contents: - /// - deployments: - /// - additionalProperties: A container of undocumented properties. + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: public init( - issues: Swift.String? = nil, - checks: Swift.String? = nil, - metadata: Swift.String? = nil, - contents: Swift.String? = nil, - deployments: Swift.String? = nil, - additionalProperties: [String: Swift.String] = .init() + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool ) { - self.issues = issues - self.checks = checks - self.metadata = metadata - self.contents = contents - self.deployments = deployments - self.additionalProperties = additionalProperties + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin } public enum CodingKeys: String, CodingKey { - case issues - case checks - case metadata - case contents - case deployments - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - issues = try container.decodeIfPresent( - Swift.String.self, - forKey: .issues - ) - checks = try container.decodeIfPresent( - Swift.String.self, - forKey: .checks - ) - metadata = try container.decodeIfPresent( - Swift.String.self, - forKey: .metadata - ) - contents = try container.decodeIfPresent( - Swift.String.self, - forKey: .contents - ) - deployments = try container.decodeIfPresent( - Swift.String.self, - forKey: .deployments - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "issues", - "checks", - "metadata", - "contents", - "deployments" - ]) - } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - issues, - forKey: .issues - ) - try container.encodeIfPresent( - checks, - forKey: .checks - ) - try container.encodeIfPresent( - metadata, - forKey: .metadata - ) - try container.encodeIfPresent( - contents, - forKey: .contents - ) - try container.encodeIfPresent( - deployments, - forKey: .deployments - ) - try encoder.encodeAdditionalProperties(additionalProperties) + case pull + case triage + case push + case maintain + case admin } } - /// The set of permissions for the GitHub app - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. - public var permissions: Components.Schemas.nullable_hyphen_integration.permissionsPayload - /// The list of events for the GitHub app - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/events`. - public var events: [Swift.String] - /// The number of installations associated with the GitHub app - /// - /// - 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`. - public var webhook_secret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/pem`. - public var pem: Swift.String? - /// Creates a new `nullable_hyphen_integration`. + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. /// /// - Parameters: - /// - id: Unique identifier of the GitHub app - /// - slug: The slug name of the GitHub app + /// - id: /// - node_id: - /// - owner: - /// - name: The name of the GitHub app + /// - name: + /// - slug: /// - description: - /// - external_url: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: /// - html_url: - /// - created_at: - /// - updated_at: - /// - 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: + /// - members_url: + /// - repositories_url: + /// - parent: public init( id: Swift.Int, - slug: Swift.String? = nil, node_id: Swift.String, - owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, name: Swift.String, + slug: Swift.String, description: Swift.String? = nil, - external_url: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, html_url: Swift.String, - created_at: Foundation.Date, - updated_at: Foundation.Date, - 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 + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil ) { self.id = id - self.slug = slug self.node_id = node_id - self.owner = owner self.name = name + self.slug = slug self.description = description - self.external_url = external_url - self.html_url = html_url - self.created_at = created_at - self.updated_at = updated_at + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission 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 + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent } public enum CodingKeys: String, CodingKey { case id - case slug case node_id - case owner case name + case slug case description - case external_url - case html_url - case created_at - case updated_at + case privacy + case notification_setting + case permission case permissions - case events - case installations_count - case client_id - case client_secret - case webhook_secret - case pem + case url + case html_url + case members_url + case repositories_url + case parent } } - /// How the author is associated with the repository. + /// A collection of related issues and pull requests. /// - /// - Remark: Generated from `#/components/schemas/author-association`. - @frozen public enum author_hyphen_association: String, Codable, Hashable, Sendable { - case COLLABORATOR = "COLLABORATOR" - case CONTRIBUTOR = "CONTRIBUTOR" - case FIRST_TIMER = "FIRST_TIMER" - case FIRST_TIME_CONTRIBUTOR = "FIRST_TIME_CONTRIBUTOR" - case MANNEQUIN = "MANNEQUIN" - case MEMBER = "MEMBER" - case NONE = "NONE" - case OWNER = "OWNER" - } - /// - Remark: Generated from `#/components/schemas/reaction-rollup`. - public struct reaction_hyphen_rollup: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/reaction-rollup/url`. + /// - Remark: Generated from `#/components/schemas/nullable-milestone`. + public struct nullable_hyphen_milestone: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-milestone/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/reaction-rollup/total_count`. - public var total_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/+1`. - public var _plus_1: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/-1`. - public var _hyphen_1: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/laugh`. - public var laugh: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/confused`. - public var confused: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/heart`. - public var heart: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/hooray`. - public var hooray: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/eyes`. - public var eyes: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/rocket`. - public var rocket: Swift.Int - /// Creates a new `reaction_hyphen_rollup`. + /// - Remark: Generated from `#/components/schemas/nullable-milestone/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/labels_url`. + public var labels_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/node_id`. + public var node_id: Swift.String + /// The number of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/number`. + public var number: Swift.Int + /// The state of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. + @frozen public enum statePayload: String, Codable, Hashable, Sendable { + case open = "open" + case closed = "closed" + } + /// The state of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. + public var state: Components.Schemas.nullable_hyphen_milestone.statePayload + /// The title of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/creator`. + public var creator: Components.Schemas.nullable_hyphen_simple_hyphen_user? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/open_issues`. + public var open_issues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_issues`. + public var closed_issues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-milestone/updated_at`. + public var updated_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_at`. + public var closed_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/due_on`. + public var due_on: Foundation.Date? + /// Creates a new `nullable_hyphen_milestone`. /// /// - Parameters: /// - url: - /// - total_count: - /// - _plus_1: - /// - _hyphen_1: - /// - laugh: - /// - confused: - /// - heart: - /// - hooray: - /// - eyes: - /// - rocket: + /// - html_url: + /// - labels_url: + /// - id: + /// - node_id: + /// - number: The number of the milestone. + /// - state: The state of the milestone. + /// - title: The title of the milestone. + /// - description: + /// - creator: + /// - open_issues: + /// - closed_issues: + /// - created_at: + /// - updated_at: + /// - closed_at: + /// - due_on: public init( url: Swift.String, - total_count: Swift.Int, - _plus_1: Swift.Int, - _hyphen_1: Swift.Int, - laugh: Swift.Int, - confused: Swift.Int, - heart: Swift.Int, - hooray: Swift.Int, - eyes: Swift.Int, - rocket: Swift.Int + html_url: Swift.String, + labels_url: Swift.String, + id: Swift.Int, + node_id: Swift.String, + number: Swift.Int, + state: Components.Schemas.nullable_hyphen_milestone.statePayload, + title: Swift.String, + description: Swift.String? = nil, + creator: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + open_issues: Swift.Int, + closed_issues: Swift.Int, + created_at: Foundation.Date, + updated_at: Foundation.Date, + closed_at: Foundation.Date? = nil, + due_on: Foundation.Date? = nil ) { self.url = url - self.total_count = total_count - self._plus_1 = _plus_1 - self._hyphen_1 = _hyphen_1 - self.laugh = laugh - self.confused = confused - self.heart = heart - self.hooray = hooray - self.eyes = eyes - self.rocket = rocket + self.html_url = html_url + self.labels_url = labels_url + self.id = id + self.node_id = node_id + self.number = number + self.state = state + self.title = title + self.description = description + self.creator = creator + self.open_issues = open_issues + self.closed_issues = closed_issues + self.created_at = created_at + self.updated_at = updated_at + self.closed_at = closed_at + self.due_on = due_on } public enum CodingKeys: String, CodingKey { case url - case total_count - case _plus_1 = "+1" - case _hyphen_1 = "-1" - case laugh - case confused - case heart - case hooray - case eyes - case rocket + case html_url + case labels_url + case id + case node_id + case number + case state + case title + case description + case creator + case open_issues + case closed_issues + case created_at + case updated_at + case closed_at + case due_on } } - /// - Remark: Generated from `#/components/schemas/security-and-analysis`. - public struct security_hyphen_and_hyphen_analysis: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. - public struct advanced_securityPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. - @frozen public enum statusPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. - public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? - /// Creates a new `advanced_securityPayload`. + /// GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration`. + public struct nullable_hyphen_integration: Codable, Hashable, Sendable { + /// Unique identifier of the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/id`. + public var id: Swift.Int + /// The slug name of the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/slug`. + 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/owner`. + public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? + /// The name of the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/external_url`. + public var external_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-integration/updated_at`. + public var updated_at: Foundation.Date + /// The set of permissions for the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/issues`. + public var issues: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/checks`. + public var checks: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/metadata`. + public var metadata: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/contents`. + public var contents: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/deployments`. + public var deployments: Swift.String? + /// A container of undocumented properties. + public var additionalProperties: [String: Swift.String] + /// Creates a new `permissionsPayload`. /// /// - Parameters: - /// - status: - public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? = nil) { - self.status = status + /// - issues: + /// - checks: + /// - metadata: + /// - contents: + /// - deployments: + /// - additionalProperties: A container of undocumented properties. + public init( + issues: Swift.String? = nil, + checks: Swift.String? = nil, + metadata: Swift.String? = nil, + contents: Swift.String? = nil, + deployments: Swift.String? = nil, + additionalProperties: [String: Swift.String] = .init() + ) { + self.issues = issues + self.checks = checks + self.metadata = metadata + self.contents = contents + self.deployments = deployments + self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case status + case issues + case checks + case metadata + case contents + case deployments } - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. - public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? - /// Enable or disable Dependabot security updates for the repository. - /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. - public struct dependabot_security_updatesPayload: Codable, Hashable, Sendable { - /// The enablement status of Dependabot security updates for the repository. - /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. - @frozen public enum statusPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - } - /// The enablement status of Dependabot security updates for the repository. - /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. - public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload.statusPayload? - /// Creates a new `dependabot_security_updatesPayload`. - /// - /// - Parameters: - /// - status: The enablement status of Dependabot security updates for the repository. - public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload.statusPayload? = nil) { - self.status = status + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + issues = try container.decodeIfPresent( + Swift.String.self, + forKey: .issues + ) + checks = try container.decodeIfPresent( + Swift.String.self, + forKey: .checks + ) + metadata = try container.decodeIfPresent( + Swift.String.self, + forKey: .metadata + ) + contents = try container.decodeIfPresent( + Swift.String.self, + forKey: .contents + ) + deployments = try container.decodeIfPresent( + Swift.String.self, + forKey: .deployments + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "issues", + "checks", + "metadata", + "contents", + "deployments" + ]) } - public enum CodingKeys: String, CodingKey { - case status + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + issues, + forKey: .issues + ) + try container.encodeIfPresent( + checks, + forKey: .checks + ) + try container.encodeIfPresent( + metadata, + forKey: .metadata + ) + try container.encodeIfPresent( + contents, + forKey: .contents + ) + try container.encodeIfPresent( + deployments, + forKey: .deployments + ) + try encoder.encodeAdditionalProperties(additionalProperties) } } - /// Enable or disable Dependabot security updates for the repository. + /// The set of permissions for the GitHub app /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. - public var dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. - public struct secret_scanningPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. - @frozen public enum statusPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. - public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload.statusPayload? - /// Creates a new `secret_scanningPayload`. - /// - /// - Parameters: - /// - status: - public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload.statusPayload? = nil) { - self.status = status - } - public enum CodingKeys: String, CodingKey { - case status - } - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. - public var secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. - public struct secret_scanning_push_protectionPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. - @frozen public enum statusPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. - public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload.statusPayload? - /// Creates a new `secret_scanning_push_protectionPayload`. - /// - /// - Parameters: - /// - status: - public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload.statusPayload? = nil) { - self.status = status - } - public enum CodingKeys: String, CodingKey { - case status - } - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. - public var secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? - /// Creates a new `security_hyphen_and_hyphen_analysis`. + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. + public var permissions: Components.Schemas.nullable_hyphen_integration.permissionsPayload + /// The list of events for the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/events`. + public var events: [Swift.String] + /// The number of installations associated with the GitHub app + /// + /// - 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`. + public var webhook_secret: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/pem`. + public var pem: Swift.String? + /// Creates a new `nullable_hyphen_integration`. /// /// - Parameters: - /// - advanced_security: - /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. - /// - secret_scanning: - /// - secret_scanning_push_protection: + /// - id: Unique identifier of the GitHub app + /// - slug: The slug name of the GitHub app + /// - node_id: + /// - owner: + /// - name: The name of the GitHub app + /// - description: + /// - external_url: + /// - html_url: + /// - created_at: + /// - updated_at: + /// - 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: public init( - advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, - dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, - secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, - secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil + id: Swift.Int, + slug: Swift.String? = nil, + node_id: Swift.String, + owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + name: Swift.String, + description: Swift.String? = nil, + external_url: Swift.String, + html_url: Swift.String, + created_at: Foundation.Date, + updated_at: Foundation.Date, + 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 ) { - self.advanced_security = advanced_security - self.dependabot_security_updates = dependabot_security_updates - self.secret_scanning = secret_scanning - self.secret_scanning_push_protection = secret_scanning_push_protection + self.id = id + self.slug = slug + self.node_id = node_id + self.owner = owner + self.name = name + self.description = description + self.external_url = external_url + self.html_url = html_url + self.created_at = created_at + self.updated_at = updated_at + 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 } public enum CodingKeys: String, CodingKey { - case advanced_security - case dependabot_security_updates - case secret_scanning - case secret_scanning_push_protection + case id + case slug + case node_id + case owner + case name + case description + case external_url + case html_url + case created_at + case updated_at + case permissions + case events + case installations_count + case client_id + case client_secret + case webhook_secret + case pem } } - /// Minimal Repository + /// How the author is associated with the repository. /// - /// - Remark: Generated from `#/components/schemas/minimal-repository`. - public struct minimal_hyphen_repository: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/minimal-repository/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/minimal-repository/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/full_name`. - public var full_name: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/owner`. - public var owner: Components.Schemas.simple_hyphen_user - /// - Remark: Generated from `#/components/schemas/minimal-repository/private`. - public var _private: Swift.Bool - /// - Remark: Generated from `#/components/schemas/minimal-repository/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/minimal-repository/fork`. - public var fork: Swift.Bool - /// - Remark: Generated from `#/components/schemas/minimal-repository/url`. + /// - Remark: Generated from `#/components/schemas/author-association`. + @frozen public enum author_hyphen_association: String, Codable, Hashable, Sendable { + case COLLABORATOR = "COLLABORATOR" + case CONTRIBUTOR = "CONTRIBUTOR" + case FIRST_TIMER = "FIRST_TIMER" + case FIRST_TIME_CONTRIBUTOR = "FIRST_TIME_CONTRIBUTOR" + case MANNEQUIN = "MANNEQUIN" + case MEMBER = "MEMBER" + case NONE = "NONE" + case OWNER = "OWNER" + } + /// - Remark: Generated from `#/components/schemas/reaction-rollup`. + public struct reaction_hyphen_rollup: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/reaction-rollup/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/archive_url`. + /// - Remark: Generated from `#/components/schemas/reaction-rollup/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/+1`. + public var _plus_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/-1`. + public var _hyphen_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/laugh`. + public var laugh: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/confused`. + public var confused: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/heart`. + public var heart: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/hooray`. + public var hooray: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/eyes`. + public var eyes: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/rocket`. + public var rocket: Swift.Int + /// Creates a new `reaction_hyphen_rollup`. + /// + /// - Parameters: + /// - url: + /// - total_count: + /// - _plus_1: + /// - _hyphen_1: + /// - laugh: + /// - confused: + /// - heart: + /// - hooray: + /// - eyes: + /// - rocket: + public init( + url: Swift.String, + total_count: Swift.Int, + _plus_1: Swift.Int, + _hyphen_1: Swift.Int, + laugh: Swift.Int, + confused: Swift.Int, + heart: Swift.Int, + hooray: Swift.Int, + eyes: Swift.Int, + rocket: Swift.Int + ) { + self.url = url + self.total_count = total_count + self._plus_1 = _plus_1 + self._hyphen_1 = _hyphen_1 + self.laugh = laugh + self.confused = confused + self.heart = heart + self.hooray = hooray + self.eyes = eyes + self.rocket = rocket + } + public enum CodingKeys: String, CodingKey { + case url + case total_count + case _plus_1 = "+1" + case _hyphen_1 = "-1" + case laugh + case confused + case heart + case hooray + case eyes + case rocket + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis`. + public struct security_hyphen_and_hyphen_analysis: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. + public struct advanced_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? + /// Creates a new `advanced_securityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. + public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// Enable or disable Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. + public struct dependabot_security_updatesPayload: Codable, Hashable, Sendable { + /// The enablement status of Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// The enablement status of Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload.statusPayload? + /// Creates a new `dependabot_security_updatesPayload`. + /// + /// - Parameters: + /// - status: The enablement status of Dependabot security updates for the repository. + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// Enable or disable Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. + public var dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. + public struct secret_scanningPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload.statusPayload? + /// Creates a new `secret_scanningPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. + public var secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. + public struct secret_scanning_push_protectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload.statusPayload? + /// Creates a new `secret_scanning_push_protectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. + public var secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? + /// Creates a new `security_hyphen_and_hyphen_analysis`. + /// + /// - Parameters: + /// - advanced_security: + /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. + /// - secret_scanning: + /// - secret_scanning_push_protection: + public init( + advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, + secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, + secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil + ) { + self.advanced_security = advanced_security + self.dependabot_security_updates = dependabot_security_updates + self.secret_scanning = secret_scanning + self.secret_scanning_push_protection = secret_scanning_push_protection + } + public enum CodingKeys: String, CodingKey { + case advanced_security + case dependabot_security_updates + case secret_scanning + case secret_scanning_push_protection + } + } + /// Minimal Repository + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository`. + public struct minimal_hyphen_repository: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/minimal-repository/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/minimal-repository/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/full_name`. + public var full_name: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/owner`. + public var owner: Components.Schemas.simple_hyphen_user + /// - Remark: Generated from `#/components/schemas/minimal-repository/private`. + public var _private: Swift.Bool + /// - Remark: Generated from `#/components/schemas/minimal-repository/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/fork`. + public var fork: Swift.Bool + /// - Remark: Generated from `#/components/schemas/minimal-repository/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/archive_url`. public var archive_url: Swift.String /// - Remark: Generated from `#/components/schemas/minimal-repository/assignees_url`. public var assignees_url: Swift.String @@ -8949,260 +9258,15 @@ public enum Components { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } - /// Groups of organization members that gives permissions on specified repositories. + /// Custom property name and associated value /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var node_id: Swift.String - /// URL for the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. - public var name: Swift.String - /// Description of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. - public var description: Swift.String? - /// Permission that the team will have for its repositories - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have + /// - Remark: Generated from `#/components/schemas/custom-property-value`. + public struct custom_hyphen_property_hyphen_value: Codable, Hashable, Sendable { + /// The name of the property /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. - /// - /// - Parameters: - /// - id: Unique identifier of the team - /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set - /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment - public init( - id: Swift.Int, - node_id: Swift.String, - url: Swift.String, - members_url: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil - ) { - self.id = id - self.node_id = node_id - self.url = url - self.members_url = members_url - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting - self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case url - case members_url - case name - case description - case permission - case privacy - case notification_setting - case html_url - case repositories_url - case slug - case ldap_dn - } - } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. - /// - /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin - } - public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin - } - } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil - ) { - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent - } - } - /// Custom property name and associated value - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value`. - public struct custom_hyphen_property_hyphen_value: Codable, Hashable, Sendable { - /// The name of the property - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/property_name`. - public var property_name: Swift.String - /// The value assigned to the property + /// - Remark: Generated from `#/components/schemas/custom-property-value/property_name`. + public var property_name: Swift.String + /// The value assigned to the property /// /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. @frozen public enum valuePayload: Codable, Hashable, Sendable { @@ -25072,37 +25136,626 @@ public enum Operations { case web_commit_signoff_required } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/content/application\/json`. - case json(Operations.repos_sol_update.Input.Body.jsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/content/application\/json`. + case json(Operations.repos_sol_update.Input.Body.jsonPayload) + } + public var body: Operations.repos_sol_update.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.repos_sol_update.Input.Path, + headers: Operations.repos_sol_update.Input.Headers = .init(), + body: Operations.repos_sol_update.Input.Body? = nil + ) { + 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}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.full_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.full_hyphen_repository { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.repos_sol_update.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.repos_sol_update.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/patch(repos/update)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.repos_sol_update.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.repos_sol_update.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Temporary Redirect + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/patch(repos/update)/responses/307`. + /// + /// HTTP response code: `307 temporaryRedirect`. + case temporaryRedirect(Components.Responses.temporary_redirect) + /// The associated value of the enum case if `self` is `.temporaryRedirect`. + /// + /// - Throws: An error if `self` is not `.temporaryRedirect`. + /// - SeeAlso: `.temporaryRedirect`. + public var temporaryRedirect: Components.Responses.temporary_redirect { + get throws { + switch self { + case let .temporaryRedirect(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "temporaryRedirect", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/patch(repos/update)/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 + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/patch(repos/update)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.validation_failed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.validation_failed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/patch(repos/update)/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 + ] + } + } + } + /// Delete a repository + /// + /// Deleting a repository requires admin access. + /// + /// If an organization owner has configured the organization to prevent members from deleting organization-owned + /// repositories, you will get a `403 Forbidden` response. + /// + /// OAuth app tokens and personal access tokens (classic) need the `delete_repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/delete(repos/delete)`. + public enum repos_sol_delete { + public static let id: Swift.String = "repos/delete" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/path/owner`. + public var owner: Components.Parameters.owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/path/repo`. + public var repo: Components.Parameters.repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.repos_sol_delete.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.repos_sol_delete.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.repos_sol_delete.Input.Path, + headers: Operations.repos_sol_delete.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/delete(repos/delete)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.repos_sol_delete.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.repos_sol_delete.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/responses/403/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/responses/403/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/responses/403/content/json/documentation_url`. + public var documentation_url: Swift.String? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + public init( + message: Swift.String? = nil, + documentation_url: Swift.String? = nil + ) { + self.message = message + self.documentation_url = documentation_url + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/responses/403/content/application\/json`. + case json(Operations.repos_sol_delete.Output.Forbidden.Body.jsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.repos_sol_delete.Output.Forbidden.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.repos_sol_delete.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.repos_sol_delete.Output.Forbidden.Body) { + self.body = body + } + } + /// If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, a member will get this response: + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/delete(repos/delete)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.repos_sol_delete.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.repos_sol_delete.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Temporary Redirect + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/delete(repos/delete)/responses/307`. + /// + /// HTTP response code: `307 temporaryRedirect`. + case temporaryRedirect(Components.Responses.temporary_redirect) + /// The associated value of the enum case if `self` is `.temporaryRedirect`. + /// + /// - Throws: An error if `self` is not `.temporaryRedirect`. + /// - SeeAlso: `.temporaryRedirect`. + public var temporaryRedirect: Components.Responses.temporary_redirect { + get throws { + switch self { + case let .temporaryRedirect(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "temporaryRedirect", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/delete(repos/delete)/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 + ] + } + } + } + /// List repository activities + /// + /// Lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users. + /// + /// For more information about viewing repository activity, + /// see "[Viewing activity and data for your repository](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository)." + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/activity`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/activity/get(repos/list-activities)`. + public enum repos_sol_list_hyphen_activities { + public static let id: Swift.String = "repos/list-activities" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/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}/activity/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}/activity/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.repos_sol_list_hyphen_activities.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum direction: String, Codable, Hashable, Sendable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/direction`. + public var direction: Components.Parameters.direction? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_page? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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/repos/{owner}/{repo}/activity/GET/query/before`. + public var before: Components.Parameters.pagination_hyphen_before? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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/repos/{owner}/{repo}/activity/GET/query/after`. + public var after: Components.Parameters.pagination_hyphen_after? + /// The Git reference for the activities you want to list. + /// + /// The `ref` for a branch can be formatted either as `refs/heads/BRANCH_NAME` or `BRANCH_NAME`, where `BRANCH_NAME` is the name of your branch. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/ref`. + public var ref: Swift.String? + /// The GitHub username to use to filter by the actor who performed the activity. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/actor`. + public var actor: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/time_period`. + @frozen public enum time_periodPayload: String, Codable, Hashable, Sendable { + case day = "day" + case week = "week" + case month = "month" + case quarter = "quarter" + case year = "year" + } + /// The time period to filter by. + /// + /// For example, `day` will filter for activity that occurred in the past 24 hours, and `week` will filter for activity that occurred in the past 7 days (168 hours). + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/time_period`. + public var time_period: Operations.repos_sol_list_hyphen_activities.Input.Query.time_periodPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/activity_type`. + @frozen public enum activity_typePayload: String, Codable, Hashable, Sendable { + case push = "push" + case force_push = "force_push" + case branch_creation = "branch_creation" + case branch_deletion = "branch_deletion" + case pr_merge = "pr_merge" + case merge_queue_merge = "merge_queue_merge" + } + /// The activity type to filter by. + /// + /// For example, you can choose to filter by "force_push", to see all force pushes to the repository. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/activity_type`. + public var activity_type: Operations.repos_sol_list_hyphen_activities.Input.Query.activity_typePayload? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - direction: The direction to sort the results by. + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + /// - ref: The Git reference for the activities you want to list. + /// - actor: The GitHub username to use to filter by the actor who performed the activity. + /// - time_period: The time period to filter by. + /// - activity_type: The activity type to filter by. + public init( + direction: Components.Parameters.direction? = nil, + per_page: Components.Parameters.per_hyphen_page? = nil, + before: Components.Parameters.pagination_hyphen_before? = nil, + after: Components.Parameters.pagination_hyphen_after? = nil, + ref: Swift.String? = nil, + actor: Swift.String? = nil, + time_period: Operations.repos_sol_list_hyphen_activities.Input.Query.time_periodPayload? = nil, + activity_type: Operations.repos_sol_list_hyphen_activities.Input.Query.activity_typePayload? = nil + ) { + self.direction = direction + self.per_page = per_page + self.before = before + self.after = after + self.ref = ref + self.actor = actor + self.time_period = time_period + self.activity_type = activity_type + } } - public var body: Operations.repos_sol_update.Input.Body? + public var query: Operations.repos_sol_list_hyphen_activities.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/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.repos_sol_list_hyphen_activities.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.repos_sol_update.Input.Path, - headers: Operations.repos_sol_update.Input.Headers = .init(), - body: Operations.repos_sol_update.Input.Body? = nil + path: Operations.repos_sol_list_hyphen_activities.Input.Path, + query: Operations.repos_sol_list_hyphen_activities.Input.Query = .init(), + headers: Operations.repos_sol_list_hyphen_activities.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/responses/200/headers/Link`. + public var Link: Components.Headers.link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - Link: + public init(Link: Components.Headers.link? = nil) { + self.Link = Link + } + } + /// Received HTTP response headers + public var headers: Operations.repos_sol_list_hyphen_activities.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.full_hyphen_repository) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/responses/200/content/application\/json`. + case json([Components.Schemas.activity]) /// 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.full_hyphen_repository { + public var json: [Components.Schemas.activity] { get throws { switch self { case let .json(body): @@ -25112,26 +25765,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.repos_sol_update.Output.Ok.Body + public var body: Operations.repos_sol_list_hyphen_activities.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.repos_sol_update.Output.Ok.Body) { + public init( + headers: Operations.repos_sol_list_hyphen_activities.Output.Ok.Headers = .init(), + body: Operations.repos_sol_list_hyphen_activities.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/patch(repos/update)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/activity/get(repos/list-activities)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.repos_sol_update.Output.Ok) + case ok(Operations.repos_sol_list_hyphen_activities.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.repos_sol_update.Output.Ok { + public var ok: Operations.repos_sol_list_hyphen_activities.Output.Ok { get throws { switch self { case let .ok(response): @@ -25144,63 +25802,17 @@ public enum Operations { } } } - /// Temporary Redirect - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/patch(repos/update)/responses/307`. - /// - /// HTTP response code: `307 temporaryRedirect`. - case temporaryRedirect(Components.Responses.temporary_redirect) - /// The associated value of the enum case if `self` is `.temporaryRedirect`. - /// - /// - Throws: An error if `self` is not `.temporaryRedirect`. - /// - SeeAlso: `.temporaryRedirect`. - public var temporaryRedirect: Components.Responses.temporary_redirect { - get throws { - switch self { - case let .temporaryRedirect(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "temporaryRedirect", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/patch(repos/update)/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 - ) - } - } - } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/patch(repos/update)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/activity/get(repos/list-activities)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.validation_failed) + case unprocessableContent(Components.Responses.validation_failed_simple) /// The associated value of the enum case if `self` is `.unprocessableContent`. /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.validation_failed { + public var unprocessableContent: Components.Responses.validation_failed_simple { get throws { switch self { case let .unprocessableContent(response): @@ -25213,29 +25825,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/patch(repos/update)/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. @@ -25267,29 +25856,28 @@ public enum Operations { } } } - /// Delete a repository + /// Create an attestation /// - /// Deleting a repository requires admin access. + /// Store an artifact attestation and associate it with a repository. /// - /// If an organization owner has configured the organization to prevent members from deleting organization-owned - /// repositories, you will get a `403 Forbidden` response. + /// The authenticated user must have write permission to the repository and, if using a fine-grained access token the `attestations:write` permission is required. /// - /// OAuth app tokens and personal access tokens (classic) need the `delete_repo` scope to use this endpoint. + /// Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For amore information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/delete(repos/delete)`. - public enum repos_sol_delete { - public static let id: Swift.String = "repos/delete" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/attestations`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/post(repos/create-attestation)`. + public enum repos_sol_create_hyphen_attestation { + public static let id: Swift.String = "repos/create-attestation" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/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}/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/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}/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/path/repo`. public var repo: Components.Parameters.repo /// Creates a new `Path`. /// @@ -25304,93 +25892,155 @@ public enum Operations { self.repo = repo } } - public var path: Operations.repos_sol_delete.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/header`. + public var path: Operations.repos_sol_create_hyphen_attestation.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.repos_sol_delete.Input.Headers + public var headers: Operations.repos_sol_create_hyphen_attestation.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The attestation's Sigstore Bundle. + /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/requestBody/json/bundle`. + public struct bundlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/requestBody/json/bundle/mediaType`. + public var mediaType: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/requestBody/json/bundle/verificationMaterial`. + public struct verificationMaterialPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `verificationMaterialPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/requestBody/json/bundle/verificationMaterial`. + public var verificationMaterial: Operations.repos_sol_create_hyphen_attestation.Input.Body.jsonPayload.bundlePayload.verificationMaterialPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/requestBody/json/bundle/dsseEnvelope`. + public struct dsseEnvelopePayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `dsseEnvelopePayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/requestBody/json/bundle/dsseEnvelope`. + public var dsseEnvelope: Operations.repos_sol_create_hyphen_attestation.Input.Body.jsonPayload.bundlePayload.dsseEnvelopePayload? + /// Creates a new `bundlePayload`. + /// + /// - Parameters: + /// - mediaType: + /// - verificationMaterial: + /// - dsseEnvelope: + public init( + mediaType: Swift.String? = nil, + verificationMaterial: Operations.repos_sol_create_hyphen_attestation.Input.Body.jsonPayload.bundlePayload.verificationMaterialPayload? = nil, + dsseEnvelope: Operations.repos_sol_create_hyphen_attestation.Input.Body.jsonPayload.bundlePayload.dsseEnvelopePayload? = nil + ) { + self.mediaType = mediaType + self.verificationMaterial = verificationMaterial + self.dsseEnvelope = dsseEnvelope + } + public enum CodingKeys: String, CodingKey { + case mediaType + case verificationMaterial + case dsseEnvelope + } + } + /// The attestation's Sigstore Bundle. + /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/requestBody/json/bundle`. + public var bundle: Operations.repos_sol_create_hyphen_attestation.Input.Body.jsonPayload.bundlePayload + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - bundle: The attestation's Sigstore Bundle. + public init(bundle: Operations.repos_sol_create_hyphen_attestation.Input.Body.jsonPayload.bundlePayload) { + self.bundle = bundle + } + public enum CodingKeys: String, CodingKey { + case bundle + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/requestBody/content/application\/json`. + case json(Operations.repos_sol_create_hyphen_attestation.Input.Body.jsonPayload) + } + public var body: Operations.repos_sol_create_hyphen_attestation.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.repos_sol_delete.Input.Path, - headers: Operations.repos_sol_delete.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/delete(repos/delete)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.repos_sol_delete.Output.NoContent) - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.repos_sol_delete.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } + path: Operations.repos_sol_create_hyphen_attestation.Input.Path, + headers: Operations.repos_sol_create_hyphen_attestation.Input.Headers = .init(), + body: Operations.repos_sol_create_hyphen_attestation.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/responses/403/content`. + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/responses/403/content/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/responses/201/content/json`. public struct jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/responses/403/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/responses/403/content/json/documentation_url`. - public var documentation_url: Swift.String? + /// The ID of the attestation. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/responses/201/content/json/id`. + public var id: Swift.Int? /// Creates a new `jsonPayload`. /// /// - Parameters: - /// - message: - /// - documentation_url: - public init( - message: Swift.String? = nil, - documentation_url: Swift.String? = nil - ) { - self.message = message - self.documentation_url = documentation_url + /// - id: The ID of the attestation. + public init(id: Swift.Int? = nil) { + self.id = id } public enum CodingKeys: String, CodingKey { - case message - case documentation_url + case id } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/DELETE/responses/403/content/application\/json`. - case json(Operations.repos_sol_delete.Output.Forbidden.Body.jsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/POST/responses/201/content/application\/json`. + case json(Operations.repos_sol_create_hyphen_attestation.Output.Created.Body.jsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.repos_sol_delete.Output.Forbidden.Body.jsonPayload { + public var json: Operations.repos_sol_create_hyphen_attestation.Output.Created.Body.jsonPayload { get throws { switch self { case let .json(body): @@ -25400,79 +26050,79 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.repos_sol_delete.Output.Forbidden.Body - /// Creates a new `Forbidden`. + public var body: Operations.repos_sol_create_hyphen_attestation.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.repos_sol_delete.Output.Forbidden.Body) { + public init(body: Operations.repos_sol_create_hyphen_attestation.Output.Created.Body) { self.body = body } } - /// If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, a member will get this response: + /// response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/delete(repos/delete)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/post(repos/create-attestation)/responses/201`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.repos_sol_delete.Output.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `201 created`. + case created(Operations.repos_sol_create_hyphen_attestation.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Operations.repos_sol_delete.Output.Forbidden { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.repos_sol_create_hyphen_attestation.Output.Created { get throws { switch self { - case let .forbidden(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "created", response: self ) } } } - /// Temporary Redirect + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/delete(repos/delete)/responses/307`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/post(repos/create-attestation)/responses/403`. /// - /// HTTP response code: `307 temporaryRedirect`. - case temporaryRedirect(Components.Responses.temporary_redirect) - /// The associated value of the enum case if `self` is `.temporaryRedirect`. + /// 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 `.temporaryRedirect`. - /// - SeeAlso: `.temporaryRedirect`. - public var temporaryRedirect: Components.Responses.temporary_redirect { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.forbidden { get throws { switch self { - case let .temporaryRedirect(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "temporaryRedirect", + expectedStatus: "forbidden", response: self ) } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/delete(repos/delete)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/post(repos/create-attestation)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.not_found) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.validation_failed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.not_found { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.validation_failed { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -25509,148 +26159,93 @@ public enum Operations { } } } - /// List repository activities + /// List attestations /// - /// Lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users. + /// List a collection of artifact attestations with a given subject digest that are associated with a repository. /// - /// For more information about viewing repository activity, - /// see "[Viewing activity and data for your repository](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository)." + /// The authenticated user making the request must have read access to the repository. In addition, when using a fine-grained access token the `attestations:read` permission is required. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/activity`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/activity/get(repos/list-activities)`. - public enum repos_sol_list_hyphen_activities { - public static let id: Swift.String = "repos/list-activities" + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/{subject_digest}/get(repos/list-attestations)`. + public enum repos_sol_list_hyphen_attestations { + public static let id: Swift.String = "repos/list-attestations" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/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}/activity/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/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}/activity/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/path/repo`. public var repo: Components.Parameters.repo + /// The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/path/subject_digest`. + public var subject_digest: Swift.String /// 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. + /// - subject_digest: The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. public init( owner: Components.Parameters.owner, - repo: Components.Parameters.repo + repo: Components.Parameters.repo, + subject_digest: Swift.String ) { self.owner = owner self.repo = repo + self.subject_digest = subject_digest } } - public var path: Operations.repos_sol_list_hyphen_activities.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query`. + public var path: Operations.repos_sol_list_hyphen_attestations.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/query`. public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum direction: String, Codable, Hashable, Sendable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/direction`. - public var direction: Components.Parameters.direction? /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/query/per_page`. public var per_page: Components.Parameters.per_hyphen_page? /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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/repos/{owner}/{repo}/activity/GET/query/before`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/query/before`. public var before: Components.Parameters.pagination_hyphen_before? /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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/repos/{owner}/{repo}/activity/GET/query/after`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/query/after`. public var after: Components.Parameters.pagination_hyphen_after? - /// The Git reference for the activities you want to list. - /// - /// The `ref` for a branch can be formatted either as `refs/heads/BRANCH_NAME` or `BRANCH_NAME`, where `BRANCH_NAME` is the name of your branch. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/ref`. - public var ref: Swift.String? - /// The GitHub username to use to filter by the actor who performed the activity. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/actor`. - public var actor: Swift.String? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/time_period`. - @frozen public enum time_periodPayload: String, Codable, Hashable, Sendable { - case day = "day" - case week = "week" - case month = "month" - case quarter = "quarter" - case year = "year" - } - /// The time period to filter by. - /// - /// For example, `day` will filter for activity that occurred in the past 24 hours, and `week` will filter for activity that occurred in the past 7 days (168 hours). - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/time_period`. - public var time_period: Operations.repos_sol_list_hyphen_activities.Input.Query.time_periodPayload? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/activity_type`. - @frozen public enum activity_typePayload: String, Codable, Hashable, Sendable { - case push = "push" - case force_push = "force_push" - case branch_creation = "branch_creation" - case branch_deletion = "branch_deletion" - case pr_merge = "pr_merge" - case merge_queue_merge = "merge_queue_merge" - } - /// The activity type to filter by. - /// - /// For example, you can choose to filter by "force_push", to see all force pushes to the repository. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/query/activity_type`. - public var activity_type: Operations.repos_sol_list_hyphen_activities.Input.Query.activity_typePayload? /// Creates a new `Query`. /// /// - Parameters: - /// - direction: The direction to sort the results by. /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." - /// - ref: The Git reference for the activities you want to list. - /// - actor: The GitHub username to use to filter by the actor who performed the activity. - /// - time_period: The time period to filter by. - /// - activity_type: The activity type to filter by. public init( - direction: Components.Parameters.direction? = nil, per_page: Components.Parameters.per_hyphen_page? = nil, before: Components.Parameters.pagination_hyphen_before? = nil, - after: Components.Parameters.pagination_hyphen_after? = nil, - ref: Swift.String? = nil, - actor: Swift.String? = nil, - time_period: Operations.repos_sol_list_hyphen_activities.Input.Query.time_periodPayload? = nil, - activity_type: Operations.repos_sol_list_hyphen_activities.Input.Query.activity_typePayload? = nil + after: Components.Parameters.pagination_hyphen_after? = nil ) { - self.direction = direction self.per_page = per_page self.before = before self.after = after - self.ref = ref - self.actor = actor - self.time_period = time_period - self.activity_type = activity_type } } - public var query: Operations.repos_sol_list_hyphen_activities.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/header`. + public var query: Operations.repos_sol_list_hyphen_attestations.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.repos_sol_list_hyphen_activities.Input.Headers + public var headers: Operations.repos_sol_list_hyphen_attestations.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -25658,9 +26253,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.repos_sol_list_hyphen_activities.Input.Path, - query: Operations.repos_sol_list_hyphen_activities.Input.Query = .init(), - headers: Operations.repos_sol_list_hyphen_activities.Input.Headers = .init() + path: Operations.repos_sol_list_hyphen_attestations.Input.Path, + query: Operations.repos_sol_list_hyphen_attestations.Input.Query = .init(), + headers: Operations.repos_sol_list_hyphen_attestations.Input.Headers = .init() ) { self.path = path self.query = query @@ -25669,29 +26264,126 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/responses/200/headers/Link`. - public var Link: Components.Headers.link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Link: - public init(Link: Components.Headers.link? = nil) { - self.Link = Link - } - } - /// Received HTTP response headers - public var headers: Operations.repos_sol_list_hyphen_activities.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/activity/GET/responses/200/content/application\/json`. - case json([Components.Schemas.activity]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload`. + public struct attestationsPayloadPayload: Codable, Hashable, Sendable { + /// The attestation's Sigstore Bundle. + /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle`. + public struct bundlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/mediaType`. + public var mediaType: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/verificationMaterial`. + public struct verificationMaterialPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `verificationMaterialPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/verificationMaterial`. + public var verificationMaterial: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload.verificationMaterialPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/dsseEnvelope`. + public struct dsseEnvelopePayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `dsseEnvelopePayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/dsseEnvelope`. + public var dsseEnvelope: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload.dsseEnvelopePayload? + /// Creates a new `bundlePayload`. + /// + /// - Parameters: + /// - mediaType: + /// - verificationMaterial: + /// - dsseEnvelope: + public init( + mediaType: Swift.String? = nil, + verificationMaterial: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload.verificationMaterialPayload? = nil, + dsseEnvelope: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload.dsseEnvelopePayload? = nil + ) { + self.mediaType = mediaType + self.verificationMaterial = verificationMaterial + self.dsseEnvelope = dsseEnvelope + } + public enum CodingKeys: String, CodingKey { + case mediaType + case verificationMaterial + case dsseEnvelope + } + } + /// The attestation's Sigstore Bundle. + /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle`. + public var bundle: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/repository_id`. + public var repository_id: Swift.Int? + /// Creates a new `attestationsPayloadPayload`. + /// + /// - Parameters: + /// - bundle: The attestation's Sigstore Bundle. + /// - repository_id: + public init( + bundle: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload? = nil, + repository_id: Swift.Int? = nil + ) { + self.bundle = bundle + self.repository_id = repository_id + } + public enum CodingKeys: String, CodingKey { + case bundle + case repository_id + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. + public typealias attestationsPayload = [Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. + public var attestations: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayload? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - attestations: + public init(attestations: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayload? = nil) { + self.attestations = attestations + } + public enum CodingKeys: String, CodingKey { + case attestations + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/application\/json`. + case json(Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.activity] { + public var json: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload { get throws { switch self { case let .json(body): @@ -25701,31 +26393,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.repos_sol_list_hyphen_activities.Output.Ok.Body + public var body: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.repos_sol_list_hyphen_activities.Output.Ok.Headers = .init(), - body: Operations.repos_sol_list_hyphen_activities.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/activity/get(repos/list-activities)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/{subject_digest}/get(repos/list-attestations)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.repos_sol_list_hyphen_activities.Output.Ok) + case ok(Operations.repos_sol_list_hyphen_attestations.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.repos_sol_list_hyphen_activities.Output.Ok { + public var ok: Operations.repos_sol_list_hyphen_attestations.Output.Ok { get throws { switch self { case let .ok(response): @@ -25738,29 +26425,6 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/activity/get(repos/list-activities)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.validation_failed_simple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.validation_failed_simple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. diff --git a/Sources/security-advisories/Types.swift b/Sources/security-advisories/Types.swift index b184dae992f..4c15332217f 100644 --- a/Sources/security-advisories/Types.swift +++ b/Sources/security-advisories/Types.swift @@ -2166,6 +2166,251 @@ public enum Components { case anonymous_access_enabled } } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var node_id: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// + /// - Parameters: + /// - id: Unique identifier of the team + /// - node_id: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + public init( + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil + ) { + self.id = id + self.node_id = node_id + self.url = url + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case url + case members_url + case name + case description + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `permissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. + /// + /// - Parameters: + /// - id: + /// - node_id: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: + /// - html_url: + /// - members_url: + /// - repositories_url: + /// - parent: + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case slug + case description + case privacy + case notification_setting + case permission + case permissions + case url + case html_url + case members_url + case repositories_url + case parent + } + } /// A GitHub repository. /// /// - Remark: Generated from `#/components/schemas/simple-repository`. @@ -2668,251 +2913,6 @@ public enum Components { case secret_scanning_push_protection } } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var node_id: Swift.String - /// URL for the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. - public var name: Swift.String - /// Description of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. - public var description: Swift.String? - /// Permission that the team will have for its repositories - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. - /// - /// - Parameters: - /// - id: Unique identifier of the team - /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set - /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment - public init( - id: Swift.Int, - node_id: Swift.String, - url: Swift.String, - members_url: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil - ) { - self.id = id - self.node_id = node_id - self.url = url - self.members_url = members_url - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting - self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case url - case members_url - case name - case description - case permission - case privacy - case notification_setting - case html_url - case repositories_url - case slug - case ldap_dn - } - } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. - /// - /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin - } - public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin - } - } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil - ) { - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent - } - } /// A repository on GitHub. /// /// - Remark: Generated from `#/components/schemas/nullable-repository`. diff --git a/Sources/teams/Types.swift b/Sources/teams/Types.swift index a02be521678..24013631da4 100644 --- a/Sources/teams/Types.swift +++ b/Sources/teams/Types.swift @@ -2403,6 +2403,251 @@ public enum Components { case html_url } } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var node_id: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// + /// - Parameters: + /// - id: Unique identifier of the team + /// - node_id: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + public init( + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil + ) { + self.id = id + self.node_id = node_id + self.url = url + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case url + case members_url + case name + case description + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `permissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. + /// + /// - Parameters: + /// - id: + /// - node_id: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: + /// - html_url: + /// - members_url: + /// - repositories_url: + /// - parent: + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case slug + case description + case privacy + case notification_setting + case permission + case permissions + case url + case html_url + case members_url + case repositories_url + case parent + } + } /// - Remark: Generated from `#/components/schemas/reaction-rollup`. public struct reaction_hyphen_rollup: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/reaction-rollup/url`. @@ -3216,251 +3461,6 @@ public enum Components { case security_and_analysis } } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var node_id: Swift.String - /// URL for the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. - public var name: Swift.String - /// Description of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. - public var description: Swift.String? - /// Permission that the team will have for its repositories - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. - /// - /// - Parameters: - /// - id: Unique identifier of the team - /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set - /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment - public init( - id: Swift.Int, - node_id: Swift.String, - url: Swift.String, - members_url: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil - ) { - self.id = id - self.node_id = node_id - self.url = url - self.members_url = members_url - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting - self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case url - case members_url - case name - case description - case permission - case privacy - case notification_setting - case html_url - case repositories_url - case slug - case ldap_dn - } - } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. - /// - /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin - } - public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin - } - } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil - ) { - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent - } - } /// Organization Invitation /// /// - Remark: Generated from `#/components/schemas/organization-invitation`. diff --git a/Sources/users/Client.swift b/Sources/users/Client.swift index acf0bec1ead..3694247dba4 100644 --- a/Sources/users/Client.swift +++ b/Sources/users/Client.swift @@ -4540,6 +4540,142 @@ public struct Client: APIProtocol { } ) } + /// List attestations + /// + /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /users/{username}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/{subject_digest}/get(users/list-attestations)`. + public func users_sol_list_hyphen_attestations(_ input: Operations.users_sol_list_hyphen_attestations.Input) async throws -> Operations.users_sol_list_hyphen_attestations.Output { + try await client.send( + input: input, + forOperation: Operations.users_sol_list_hyphen_attestations.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/attestations/{}", + parameters: [ + input.path.username, + input.path.subject_digest + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + 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.users_sol_list_hyphen_attestations.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.users_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.users_sol_list_hyphen_attestations.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.empty_hyphen_object.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 204: + return .noContent(.init()) + 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 + ) + ) + } + } + ) + } /// List followers of a user /// /// Lists the people following the specified user. diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index cd172f78da8..8bb347d335a 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -285,6 +285,17 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /users/{username}`. /// - Remark: Generated from `#/paths//users/{username}/get(users/get-by-username)`. func users_sol_get_hyphen_by_hyphen_username(_ input: Operations.users_sol_get_hyphen_by_hyphen_username.Input) async throws -> Operations.users_sol_get_hyphen_by_hyphen_username.Output + /// List attestations + /// + /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /users/{username}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/{subject_digest}/get(users/list-attestations)`. + func users_sol_list_hyphen_attestations(_ input: Operations.users_sol_list_hyphen_attestations.Input) async throws -> Operations.users_sol_list_hyphen_attestations.Output /// List followers of a user /// /// Lists the people following the specified user. @@ -881,6 +892,27 @@ extension APIProtocol { headers: headers )) } + /// List attestations + /// + /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /users/{username}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/{subject_digest}/get(users/list-attestations)`. + public func users_sol_list_hyphen_attestations( + path: Operations.users_sol_list_hyphen_attestations.Input.Path, + query: Operations.users_sol_list_hyphen_attestations.Input.Query = .init(), + headers: Operations.users_sol_list_hyphen_attestations.Input.Headers = .init() + ) async throws -> Operations.users_sol_list_hyphen_attestations.Output { + try await users_sol_list_hyphen_attestations(Operations.users_sol_list_hyphen_attestations.Input( + path: path, + query: query, + headers: headers + )) + } /// List followers of a user /// /// Lists the people following the specified user. @@ -1823,6 +1855,16 @@ public enum Components { ]) } } + /// An object without any properties. + /// + /// - Remark: Generated from `#/components/schemas/empty-object`. + public struct empty_hyphen_object: Codable, Hashable, Sendable { + /// Creates a new `empty_hyphen_object`. + public init() {} + public init(from decoder: any Decoder) throws { + try decoder.ensureNoAdditionalProperties(knownKeys: []) + } + } /// Private User /// /// - Remark: Generated from `#/components/schemas/private-user`. @@ -2533,6 +2575,260 @@ public enum Components { case created_at } } + /// Sigstore Bundle v0.1 + /// + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0`. + public struct sigstore_hyphen_bundle_hyphen_0: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/mediaType`. + public var mediaType: Swift.String? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial`. + public struct verificationMaterialPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/x509CertificateChain`. + public struct x509CertificateChainPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/x509CertificateChain/certificatesPayload`. + public struct certificatesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/x509CertificateChain/certificatesPayload/rawBytes`. + public var rawBytes: Swift.String? + /// Creates a new `certificatesPayloadPayload`. + /// + /// - Parameters: + /// - rawBytes: + public init(rawBytes: Swift.String? = nil) { + self.rawBytes = rawBytes + } + public enum CodingKeys: String, CodingKey { + case rawBytes + } + } + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/x509CertificateChain/certificates`. + public typealias certificatesPayload = [Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.x509CertificateChainPayload.certificatesPayloadPayload] + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/x509CertificateChain/certificates`. + public var certificates: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.x509CertificateChainPayload.certificatesPayload? + /// Creates a new `x509CertificateChainPayload`. + /// + /// - Parameters: + /// - certificates: + public init(certificates: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.x509CertificateChainPayload.certificatesPayload? = nil) { + self.certificates = certificates + } + public enum CodingKeys: String, CodingKey { + case certificates + } + } + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/x509CertificateChain`. + public var x509CertificateChain: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.x509CertificateChainPayload? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload`. + public struct tlogEntriesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/logIndex`. + public var logIndex: Swift.String? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/logId`. + public struct logIdPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/logId/keyId`. + public var keyId: Swift.String? + /// Creates a new `logIdPayload`. + /// + /// - Parameters: + /// - keyId: + public init(keyId: Swift.String? = nil) { + self.keyId = keyId + } + public enum CodingKeys: String, CodingKey { + case keyId + } + } + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/logId`. + public var logId: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload.logIdPayload? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/kindVersion`. + public struct kindVersionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/kindVersion/kind`. + public var kind: Swift.String? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/kindVersion/version`. + public var version: Swift.String? + /// Creates a new `kindVersionPayload`. + /// + /// - Parameters: + /// - kind: + /// - version: + public init( + kind: Swift.String? = nil, + version: Swift.String? = nil + ) { + self.kind = kind + self.version = version + } + public enum CodingKeys: String, CodingKey { + case kind + case version + } + } + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/kindVersion`. + public var kindVersion: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload.kindVersionPayload? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/integratedTime`. + public var integratedTime: Swift.String? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/inclusionPromise`. + public struct inclusionPromisePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/inclusionPromise/signedEntryTimestamp`. + public var signedEntryTimestamp: Swift.String? + /// Creates a new `inclusionPromisePayload`. + /// + /// - Parameters: + /// - signedEntryTimestamp: + public init(signedEntryTimestamp: Swift.String? = nil) { + self.signedEntryTimestamp = signedEntryTimestamp + } + public enum CodingKeys: String, CodingKey { + case signedEntryTimestamp + } + } + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/inclusionPromise`. + public var inclusionPromise: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload.inclusionPromisePayload? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/inclusionProof`. + public var inclusionProof: Swift.String? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/canonicalizedBody`. + public var canonicalizedBody: Swift.String? + /// Creates a new `tlogEntriesPayloadPayload`. + /// + /// - Parameters: + /// - logIndex: + /// - logId: + /// - kindVersion: + /// - integratedTime: + /// - inclusionPromise: + /// - inclusionProof: + /// - canonicalizedBody: + public init( + logIndex: Swift.String? = nil, + logId: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload.logIdPayload? = nil, + kindVersion: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload.kindVersionPayload? = nil, + integratedTime: Swift.String? = nil, + inclusionPromise: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload.inclusionPromisePayload? = nil, + inclusionProof: Swift.String? = nil, + canonicalizedBody: Swift.String? = nil + ) { + self.logIndex = logIndex + self.logId = logId + self.kindVersion = kindVersion + self.integratedTime = integratedTime + self.inclusionPromise = inclusionPromise + self.inclusionProof = inclusionProof + self.canonicalizedBody = canonicalizedBody + } + public enum CodingKeys: String, CodingKey { + case logIndex + case logId + case kindVersion + case integratedTime + case inclusionPromise + case inclusionProof + case canonicalizedBody + } + } + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntries`. + public typealias tlogEntriesPayload = [Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload] + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntries`. + public var tlogEntries: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayload? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/timestampVerificationData`. + public var timestampVerificationData: Swift.String? + /// Creates a new `verificationMaterialPayload`. + /// + /// - Parameters: + /// - x509CertificateChain: + /// - tlogEntries: + /// - timestampVerificationData: + public init( + x509CertificateChain: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.x509CertificateChainPayload? = nil, + tlogEntries: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayload? = nil, + timestampVerificationData: Swift.String? = nil + ) { + self.x509CertificateChain = x509CertificateChain + self.tlogEntries = tlogEntries + self.timestampVerificationData = timestampVerificationData + } + public enum CodingKeys: String, CodingKey { + case x509CertificateChain + case tlogEntries + case timestampVerificationData + } + } + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial`. + public var verificationMaterial: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope`. + public struct dsseEnvelopePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/payload`. + public var payload: Swift.String? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/payloadType`. + public var payloadType: Swift.String? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/signaturesPayload`. + public struct signaturesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/signaturesPayload/sig`. + public var sig: Swift.String? + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/signaturesPayload/keyid`. + public var keyid: Swift.String? + /// Creates a new `signaturesPayloadPayload`. + /// + /// - Parameters: + /// - sig: + /// - keyid: + public init( + sig: Swift.String? = nil, + keyid: Swift.String? = nil + ) { + self.sig = sig + self.keyid = keyid + } + public enum CodingKeys: String, CodingKey { + case sig + case keyid + } + } + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/signatures`. + public typealias signaturesPayload = [Components.Schemas.sigstore_hyphen_bundle_hyphen_0.dsseEnvelopePayload.signaturesPayloadPayload] + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/signatures`. + public var signatures: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.dsseEnvelopePayload.signaturesPayload? + /// Creates a new `dsseEnvelopePayload`. + /// + /// - Parameters: + /// - payload: + /// - payloadType: + /// - signatures: + public init( + payload: Swift.String? = nil, + payloadType: Swift.String? = nil, + signatures: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.dsseEnvelopePayload.signaturesPayload? = nil + ) { + self.payload = payload + self.payloadType = payloadType + self.signatures = signatures + } + public enum CodingKeys: String, CodingKey { + case payload + case payloadType + case signatures + } + } + /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope`. + public var dsseEnvelope: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.dsseEnvelopePayload? + /// Creates a new `sigstore_hyphen_bundle_hyphen_0`. + /// + /// - Parameters: + /// - mediaType: + /// - verificationMaterial: + /// - dsseEnvelope: + public init( + mediaType: Swift.String? = nil, + verificationMaterial: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload? = nil, + dsseEnvelope: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.dsseEnvelopePayload? = nil + ) { + self.mediaType = mediaType + self.verificationMaterial = verificationMaterial + self.dsseEnvelope = dsseEnvelope + } + public enum CodingKeys: String, CodingKey { + case mediaType + case verificationMaterial + case dsseEnvelope + } + } /// Hovercard /// /// - Remark: Generated from `#/components/schemas/hovercard`. @@ -2603,6 +2899,14 @@ public enum Components { } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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 `#/components/parameters/pagination-before`. + public typealias pagination_hyphen_before = Swift.String + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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 `#/components/parameters/pagination-after`. + public typealias pagination_hyphen_after = Swift.String /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// /// - Remark: Generated from `#/components/parameters/per-page`. @@ -10607,6 +10911,326 @@ public enum Operations { } } } + /// List attestations + /// + /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /users/{username}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/{subject_digest}/get(users/list-attestations)`. + public enum users_sol_list_hyphen_attestations { + public static let id: Swift.String = "users/list-attestations" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/path`. + public struct Path: Sendable, Hashable { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/path/username`. + public var username: Components.Parameters.username + /// Subject Digest + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/path/subject_digest`. + public var subject_digest: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - username: The handle for the GitHub user account. + /// - subject_digest: Subject Digest + public init( + username: Components.Parameters.username, + subject_digest: Swift.String + ) { + self.username = username + self.subject_digest = subject_digest + } + } + public var path: Operations.users_sol_list_hyphen_attestations.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_page? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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/users/{username}/attestations/{subject_digest}/GET/query/before`. + public var before: Components.Parameters.pagination_hyphen_before? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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/users/{username}/attestations/{subject_digest}/GET/query/after`. + public var after: Components.Parameters.pagination_hyphen_after? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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( + per_page: Components.Parameters.per_hyphen_page? = nil, + before: Components.Parameters.pagination_hyphen_before? = nil, + after: Components.Parameters.pagination_hyphen_after? = nil + ) { + self.per_page = per_page + self.before = before + self.after = after + } + } + public var query: Operations.users_sol_list_hyphen_attestations.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/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.users_sol_list_hyphen_attestations.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.users_sol_list_hyphen_attestations.Input.Path, + query: Operations.users_sol_list_hyphen_attestations.Input.Query = .init(), + headers: Operations.users_sol_list_hyphen_attestations.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/users/{username}/attestations/{subject_digest}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload`. + public struct attestationsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle`. + public var bundle: Components.Schemas.sigstore_hyphen_bundle_hyphen_0? + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/repository_id`. + public var repository_id: Swift.Int? + /// Creates a new `attestationsPayloadPayload`. + /// + /// - Parameters: + /// - bundle: + /// - repository_id: + public init( + bundle: Components.Schemas.sigstore_hyphen_bundle_hyphen_0? = nil, + repository_id: Swift.Int? = nil + ) { + self.bundle = bundle + self.repository_id = repository_id + } + public enum CodingKeys: String, CodingKey { + case bundle + case repository_id + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. + public typealias attestationsPayload = [Operations.users_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload] + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. + public var attestations: Operations.users_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayload? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - attestations: + public init(attestations: Operations.users_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayload? = nil) { + self.attestations = attestations + } + public enum CodingKeys: String, CodingKey { + case attestations + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/application\/json`. + case json(Operations.users_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.users_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.users_sol_list_hyphen_attestations.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.users_sol_list_hyphen_attestations.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/{subject_digest}/get(users/list-attestations)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.users_sol_list_hyphen_attestations.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.users_sol_list_hyphen_attestations.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/201/content/application\/json`. + case json(Components.Schemas.empty_hyphen_object) + /// 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.empty_hyphen_object { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.users_sol_list_hyphen_attestations.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.users_sol_list_hyphen_attestations.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/{subject_digest}/get(users/list-attestations)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.users_sol_list_hyphen_attestations.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.users_sol_list_hyphen_attestations.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/{subject_digest}/get(users/list-attestations)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.users_sol_list_hyphen_attestations.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.users_sol_list_hyphen_attestations.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/{subject_digest}/get(users/list-attestations)/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 + ] + } + } + } /// List followers of a user /// /// Lists the people following the specified user. diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 62b23af16ec..d2303fdde41 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 62b23af16ec379af0466b516ccf1f0dd8373f91b +Subproject commit d2303fdde41a01ecb82983c478eba68dd73f8dcf