diff --git a/.spi.yml b/.spi.yml index b079a130499..94f66a66e09 100644 --- a/.spi.yml +++ b/.spi.yml @@ -19,6 +19,7 @@ builder: - GitHubRestAPIDependency_Graph - GitHubRestAPIDesktop - GitHubRestAPIEmojis + - GitHubRestAPIEnterprise_Team_Memberships - GitHubRestAPIEnterprise_Teams - GitHubRestAPIGists - GitHubRestAPIGit diff --git a/Package.swift b/Package.swift index 5366bc18eeb..43ee15cca55 100644 --- a/Package.swift +++ b/Package.swift @@ -28,6 +28,7 @@ let package = Package( .library(name: "GitHubRestAPIDependency_Graph", targets: ["GitHubRestAPIDependency_Graph"]), .library(name: "GitHubRestAPIDesktop", targets: ["GitHubRestAPIDesktop"]), .library(name: "GitHubRestAPIEmojis", targets: ["GitHubRestAPIEmojis"]), + .library(name: "GitHubRestAPIEnterprise_Team_Memberships", targets: ["GitHubRestAPIEnterprise_Team_Memberships"]), .library(name: "GitHubRestAPIEnterprise_Teams", targets: ["GitHubRestAPIEnterprise_Teams"]), .library(name: "GitHubRestAPIGists", targets: ["GitHubRestAPIGists"]), .library(name: "GitHubRestAPIGit", targets: ["GitHubRestAPIGit"]), @@ -197,6 +198,14 @@ let package = Package( ], path: "Sources/emojis" ), + .target( + name: "GitHubRestAPIEnterprise_Team_Memberships", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/enterprise-team-memberships" + ), .target( name: "GitHubRestAPIEnterprise_Teams", dependencies: [ diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index 6db1d3d1813..5ffef2c0cf2 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -8743,6 +8743,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -8759,6 +8778,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -8772,7 +8794,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -8787,6 +8812,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -8802,6 +8830,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -8875,6 +8906,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -8893,6 +8943,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -8908,6 +8961,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -8923,6 +8979,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -8939,6 +8998,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } diff --git a/Sources/activity/Types.swift b/Sources/activity/Types.swift index 1894e760948..490571fb494 100644 --- a/Sources/activity/Types.swift +++ b/Sources/activity/Types.swift @@ -5066,6 +5066,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/since`. public typealias Since = Foundation.Date + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -5094,10 +5098,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/org`. public typealias Org = Swift.String - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String /// The property to sort the results by. `created` means when the repository was starred. `updated` means when the repository was last pushed to. /// /// - Remark: Generated from `#/components/parameters/sort-starred`. diff --git a/Sources/apps/Types.swift b/Sources/apps/Types.swift index 95508faeaae..5e4e6f9ef65 100644 --- a/Sources/apps/Types.swift +++ b/Sources/apps/Types.swift @@ -4790,6 +4790,10 @@ public enum Components { public typealias ClientId = Swift.String /// - Remark: Generated from `#/components/parameters/app-slug`. public typealias AppSlug = Swift.String + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// account_id parameter /// /// - Remark: Generated from `#/components/parameters/account-id`. @@ -4821,10 +4825,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repository-id`. public typealias RepositoryId = Swift.Int - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} diff --git a/Sources/billing/Types.swift b/Sources/billing/Types.swift index 732d2a61fa4..6ee6c143a9a 100644 --- a/Sources/billing/Types.swift +++ b/Sources/billing/Types.swift @@ -831,6 +831,10 @@ public enum Components { } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The organization name. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/org`. @@ -851,10 +855,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/billing-usage-report-hour`. public typealias BillingUsageReportHour = Swift.Int - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} diff --git a/Sources/campaigns/Types.swift b/Sources/campaigns/Types.swift index b8c21295b93..e774197069e 100644 --- a/Sources/campaigns/Types.swift +++ b/Sources/campaigns/Types.swift @@ -437,6 +437,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -453,6 +472,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -466,7 +488,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -481,6 +506,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -496,6 +524,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -569,6 +600,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -587,6 +637,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -602,6 +655,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -617,6 +673,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -633,6 +692,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } diff --git a/Sources/codespaces/Types.swift b/Sources/codespaces/Types.swift index 65a711b53d6..9c27ee78fea 100644 --- a/Sources/codespaces/Types.swift +++ b/Sources/codespaces/Types.swift @@ -6406,6 +6406,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -6422,10 +6426,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/secret-name`. public typealias SecretName = Swift.String - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String /// The name of the codespace. /// /// - Remark: Generated from `#/components/parameters/codespace-name`. diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index e70bb5e6426..03592230716 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -630,6 +630,101 @@ public enum Components { case userViewType = "user_view_type" } } + /// Group of enterprise owners and/or members + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team`. + public struct EnterpriseTeam: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/description`. + public var description: 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 + /// Retired: this field will not be returned with GHEC enterprise teams. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. + public var syncToOrganizations: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/organization_selection_type`. + public var organizationSelectionType: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. + public var groupId: Swift.String? + /// Retired: this field will not be returned with GHEC enterprise teams. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_name`. + public var groupName: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `EnterpriseTeam`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - description: + /// - slug: + /// - url: + /// - syncToOrganizations: Retired: this field will not be returned with GHEC enterprise teams. + /// - organizationSelectionType: + /// - groupId: + /// - groupName: Retired: this field will not be returned with GHEC enterprise teams. + /// - htmlUrl: + /// - membersUrl: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int64, + name: Swift.String, + description: Swift.String? = nil, + slug: Swift.String, + url: Swift.String, + syncToOrganizations: Swift.String? = nil, + organizationSelectionType: Swift.String? = nil, + groupId: Swift.String? = nil, + groupName: Swift.String? = nil, + htmlUrl: Swift.String, + membersUrl: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.id = id + self.name = name + self.description = description + self.slug = slug + self.url = url + self.syncToOrganizations = syncToOrganizations + self.organizationSelectionType = organizationSelectionType + self.groupId = groupId + self.groupName = groupName + self.htmlUrl = htmlUrl + self.membersUrl = membersUrl + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case description + case slug + case url + case syncToOrganizations = "sync_to_organizations" + case organizationSelectionType = "organization_selection_type" + case groupId = "group_id" + case groupName = "group_name" + case htmlUrl = "html_url" + case membersUrl = "members_url" + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } /// Groups of organization members that gives permissions on specified repositories. /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. @@ -676,6 +771,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -692,6 +806,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -705,7 +822,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -720,6 +840,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -735,6 +858,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -808,6 +934,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -826,6 +971,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -841,6 +989,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -856,6 +1007,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -872,6 +1026,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -1213,97 +1370,6 @@ public enum Components { case description } } - /// Group of enterprise owners and/or members - /// - /// - Remark: Generated from `#/components/schemas/enterprise-team`. - public struct EnterpriseTeam: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/description`. - public var description: 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 syncToOrganizations: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/organization_selection_type`. - public var organizationSelectionType: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. - public var groupId: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/group_name`. - public var groupName: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. - public var membersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. - public var updatedAt: Foundation.Date - /// Creates a new `EnterpriseTeam`. - /// - /// - Parameters: - /// - id: - /// - name: - /// - description: - /// - slug: - /// - url: - /// - syncToOrganizations: - /// - organizationSelectionType: - /// - groupId: - /// - groupName: - /// - htmlUrl: - /// - membersUrl: - /// - createdAt: - /// - updatedAt: - public init( - id: Swift.Int64, - name: Swift.String, - description: Swift.String? = nil, - slug: Swift.String, - url: Swift.String, - syncToOrganizations: Swift.String? = nil, - organizationSelectionType: Swift.String? = nil, - groupId: Swift.String? = nil, - groupName: Swift.String? = nil, - htmlUrl: Swift.String, - membersUrl: Swift.String, - createdAt: Foundation.Date, - updatedAt: Foundation.Date - ) { - self.id = id - self.name = name - self.description = description - self.slug = slug - self.url = url - self.syncToOrganizations = syncToOrganizations - self.organizationSelectionType = organizationSelectionType - self.groupId = groupId - self.groupName = groupName - self.htmlUrl = htmlUrl - self.membersUrl = membersUrl - self.createdAt = createdAt - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case id - case name - case description - case slug - case url - case syncToOrganizations = "sync_to_organizations" - case organizationSelectionType = "organization_selection_type" - case groupId = "group_id" - case groupName = "group_name" - case htmlUrl = "html_url" - case membersUrl = "members_url" - case createdAt = "created_at" - case updatedAt = "updated_at" - } - } /// Information about a Copilot Business seat assignment for a user, team, or organization. /// /// - Remark: Generated from `#/components/schemas/copilot-seat-details`. @@ -2388,10 +2454,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. @@ -2400,6 +2462,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/team-slug`. public typealias TeamSlug = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} diff --git a/Sources/enterprise-team-memberships/Client.swift b/Sources/enterprise-team-memberships/Client.swift new file mode 100644 index 00000000000..c84c8635940 --- /dev/null +++ b/Sources/enterprise-team-memberships/Client.swift @@ -0,0 +1,476 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) import OpenAPIRuntime +#if os(Linux) +@preconcurrency import struct Foundation.URL +@preconcurrency import struct Foundation.Data +@preconcurrency import struct Foundation.Date +#else +import struct Foundation.URL +import struct Foundation.Data +import struct Foundation.Date +#endif +import HTTPTypes +/// GitHub's v3 REST API. +public struct Client: APIProtocol { + /// The underlying HTTP client. + private let client: UniversalClient + /// Creates a new client. + /// - Parameters: + /// - serverURL: The server URL that the client connects to. Any server + /// URLs defined in the OpenAPI document are available as static methods + /// on the ``Servers`` type. + /// - configuration: A set of configuration values for the client. + /// - transport: A transport that performs HTTP operations. + /// - middlewares: A list of middlewares to call before the transport. + public init( + serverURL: Foundation.URL, + configuration: Configuration = .init(), + transport: any ClientTransport, + middlewares: [any ClientMiddleware] = [] + ) { + self.client = .init( + serverURL: serverURL, + configuration: configuration, + transport: transport, + middlewares: middlewares + ) + } + private var converter: Converter { + client.converter + } + /// List members in an enterprise team + /// + /// Lists all team members in an enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)`. + public func enterpriseTeamMembershipsList(_ input: Operations.EnterpriseTeamMembershipsList.Input) async throws -> Operations.EnterpriseTeamMembershipsList.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsList.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam + ] + ) + 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.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.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.EnterpriseTeamMembershipsList.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.EnterpriseTeamMembershipsList.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.SimpleUser].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Bulk add team members + /// + /// Add multiple team members to an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)`. + public func enterpriseTeamMembershipsBulkAdd(_ input: Operations.EnterpriseTeamMembershipsBulkAdd.Input) async throws -> Operations.EnterpriseTeamMembershipsBulkAdd.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsBulkAdd.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/add", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamMembershipsBulkAdd.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.SimpleUser].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 + ) + ) + } + } + ) + } + /// Bulk remove team members + /// + /// Remove multiple team members from an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)`. + public func enterpriseTeamMembershipsBulkRemove(_ input: Operations.EnterpriseTeamMembershipsBulkRemove.Input) async throws -> Operations.EnterpriseTeamMembershipsBulkRemove.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsBulkRemove.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/remove", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamMembershipsBulkRemove.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.SimpleUser].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 enterprise team membership + /// + /// Returns whether the user is a member of the enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)`. + public func enterpriseTeamMembershipsGet(_ input: Operations.EnterpriseTeamMembershipsGet.Input) async throws -> Operations.EnterpriseTeamMembershipsGet.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsGet.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/{}", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam, + input.path.username + ] + ) + 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.EnterpriseTeamMembershipsGet.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.SimpleUser.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 + ) + ) + } + } + ) + } + /// Add team member + /// + /// Add a team member to an enterprise team. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)`. + public func enterpriseTeamMembershipsAdd(_ input: Operations.EnterpriseTeamMembershipsAdd.Input) async throws -> Operations.EnterpriseTeamMembershipsAdd.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsAdd.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/{}", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamMembershipsAdd.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.SimpleUser.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 + ) + ) + } + } + ) + } + /// Remove team membership + /// + /// Remove membership of a specific user from a particular team in an enterprise. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)`. + public func enterpriseTeamMembershipsRemove(_ input: Operations.EnterpriseTeamMembershipsRemove.Input) async throws -> Operations.EnterpriseTeamMembershipsRemove.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsRemove.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/{}", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam, + input.path.username + ] + ) + 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 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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } +} diff --git a/Sources/enterprise-team-memberships/Types.swift b/Sources/enterprise-team-memberships/Types.swift new file mode 100644 index 00000000000..12f2f198ba9 --- /dev/null +++ b/Sources/enterprise-team-memberships/Types.swift @@ -0,0 +1,1401 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) import OpenAPIRuntime +#if os(Linux) +@preconcurrency import struct Foundation.URL +@preconcurrency import struct Foundation.Data +@preconcurrency import struct Foundation.Date +#else +import struct Foundation.URL +import struct Foundation.Data +import struct Foundation.Date +#endif +/// A type that performs HTTP operations defined by the OpenAPI document. +public protocol APIProtocol: Sendable { + /// List members in an enterprise team + /// + /// Lists all team members in an enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)`. + func enterpriseTeamMembershipsList(_ input: Operations.EnterpriseTeamMembershipsList.Input) async throws -> Operations.EnterpriseTeamMembershipsList.Output + /// Bulk add team members + /// + /// Add multiple team members to an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)`. + func enterpriseTeamMembershipsBulkAdd(_ input: Operations.EnterpriseTeamMembershipsBulkAdd.Input) async throws -> Operations.EnterpriseTeamMembershipsBulkAdd.Output + /// Bulk remove team members + /// + /// Remove multiple team members from an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)`. + func enterpriseTeamMembershipsBulkRemove(_ input: Operations.EnterpriseTeamMembershipsBulkRemove.Input) async throws -> Operations.EnterpriseTeamMembershipsBulkRemove.Output + /// Get enterprise team membership + /// + /// Returns whether the user is a member of the enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)`. + func enterpriseTeamMembershipsGet(_ input: Operations.EnterpriseTeamMembershipsGet.Input) async throws -> Operations.EnterpriseTeamMembershipsGet.Output + /// Add team member + /// + /// Add a team member to an enterprise team. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)`. + func enterpriseTeamMembershipsAdd(_ input: Operations.EnterpriseTeamMembershipsAdd.Input) async throws -> Operations.EnterpriseTeamMembershipsAdd.Output + /// Remove team membership + /// + /// Remove membership of a specific user from a particular team in an enterprise. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)`. + func enterpriseTeamMembershipsRemove(_ input: Operations.EnterpriseTeamMembershipsRemove.Input) async throws -> Operations.EnterpriseTeamMembershipsRemove.Output +} + +/// Convenience overloads for operation inputs. +extension APIProtocol { + /// List members in an enterprise team + /// + /// Lists all team members in an enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)`. + public func enterpriseTeamMembershipsList( + path: Operations.EnterpriseTeamMembershipsList.Input.Path, + query: Operations.EnterpriseTeamMembershipsList.Input.Query = .init(), + headers: Operations.EnterpriseTeamMembershipsList.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamMembershipsList.Output { + try await enterpriseTeamMembershipsList(Operations.EnterpriseTeamMembershipsList.Input( + path: path, + query: query, + headers: headers + )) + } + /// Bulk add team members + /// + /// Add multiple team members to an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)`. + public func enterpriseTeamMembershipsBulkAdd( + path: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Path, + headers: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Body + ) async throws -> Operations.EnterpriseTeamMembershipsBulkAdd.Output { + try await enterpriseTeamMembershipsBulkAdd(Operations.EnterpriseTeamMembershipsBulkAdd.Input( + path: path, + headers: headers, + body: body + )) + } + /// Bulk remove team members + /// + /// Remove multiple team members from an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)`. + public func enterpriseTeamMembershipsBulkRemove( + path: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Path, + headers: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Body + ) async throws -> Operations.EnterpriseTeamMembershipsBulkRemove.Output { + try await enterpriseTeamMembershipsBulkRemove(Operations.EnterpriseTeamMembershipsBulkRemove.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get enterprise team membership + /// + /// Returns whether the user is a member of the enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)`. + public func enterpriseTeamMembershipsGet( + path: Operations.EnterpriseTeamMembershipsGet.Input.Path, + headers: Operations.EnterpriseTeamMembershipsGet.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamMembershipsGet.Output { + try await enterpriseTeamMembershipsGet(Operations.EnterpriseTeamMembershipsGet.Input( + path: path, + headers: headers + )) + } + /// Add team member + /// + /// Add a team member to an enterprise team. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)`. + public func enterpriseTeamMembershipsAdd( + path: Operations.EnterpriseTeamMembershipsAdd.Input.Path, + headers: Operations.EnterpriseTeamMembershipsAdd.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamMembershipsAdd.Output { + try await enterpriseTeamMembershipsAdd(Operations.EnterpriseTeamMembershipsAdd.Input( + path: path, + headers: headers + )) + } + /// Remove team membership + /// + /// Remove membership of a specific user from a particular team in an enterprise. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)`. + public func enterpriseTeamMembershipsRemove( + path: Operations.EnterpriseTeamMembershipsRemove.Input.Path, + headers: Operations.EnterpriseTeamMembershipsRemove.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamMembershipsRemove.Output { + try await enterpriseTeamMembershipsRemove(Operations.EnterpriseTeamMembershipsRemove.Input( + path: path, + headers: headers + )) + } +} + +/// Server URLs defined in the OpenAPI document. +public enum Servers { + public enum Server1 { + public static func url() throws -> Foundation.URL { + try Foundation.URL( + validatingOpenAPIServerURL: "https://api.github.com", + variables: [] + ) + } + } + @available(*, deprecated, renamed: "Servers.Server1.url") + public static func server1() throws -> Foundation.URL { + try Foundation.URL( + validatingOpenAPIServerURL: "https://api.github.com", + variables: [] + ) + } +} + +/// 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 { + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/simple-user`. + public struct SimpleUser: 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.Int64 + /// - Remark: Generated from `#/components/schemas/simple-user/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gravatar_id`. + public var gravatarId: 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 htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/followers_url`. + public var followersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/following_url`. + public var followingUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gists_url`. + public var gistsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/starred_url`. + public var starredUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/subscriptions_url`. + public var subscriptionsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/organizations_url`. + public var organizationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/received_events_url`. + public var receivedEventsUrl: 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 siteAdmin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. + public var starredAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `SimpleUser`. + /// + /// - Parameters: + /// - name: + /// - email: + /// - login: + /// - id: + /// - nodeId: + /// - avatarUrl: + /// - gravatarId: + /// - url: + /// - htmlUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - reposUrl: + /// - eventsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - starredAt: + /// - userViewType: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + avatarUrl: Swift.String, + gravatarId: Swift.String? = nil, + url: Swift.String, + htmlUrl: Swift.String, + followersUrl: Swift.String, + followingUrl: Swift.String, + gistsUrl: Swift.String, + starredUrl: Swift.String, + subscriptionsUrl: Swift.String, + organizationsUrl: Swift.String, + reposUrl: Swift.String, + eventsUrl: Swift.String, + receivedEventsUrl: Swift.String, + _type: Swift.String, + siteAdmin: Swift.Bool, + starredAt: Swift.String? = nil, + userViewType: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.nodeId = nodeId + self.avatarUrl = avatarUrl + self.gravatarId = gravatarId + self.url = url + self.htmlUrl = htmlUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self.organizationsUrl = organizationsUrl + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.receivedEventsUrl = receivedEventsUrl + self._type = _type + self.siteAdmin = siteAdmin + self.starredAt = starredAt + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case name + case email + case login + case id + case nodeId = "node_id" + case avatarUrl = "avatar_url" + case gravatarId = "gravatar_id" + case url + case htmlUrl = "html_url" + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case organizationsUrl = "organizations_url" + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case receivedEventsUrl = "received_events_url" + case _type = "type" + case siteAdmin = "site_admin" + case starredAt = "starred_at" + case userViewType = "user_view_type" + } + } + /// Basic Error + /// + /// - Remark: Generated from `#/components/schemas/basic-error`. + public struct BasicError: 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 documentationUrl: 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 `BasicError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - url: + /// - status: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + url: Swift.String? = nil, + status: Swift.String? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.url = url + self.status = status + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case url + case status + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// 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`. + public typealias PerPage = Swift.Int + /// 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 `#/components/parameters/page`. + public typealias Page = Swift.Int + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/components/parameters/enterprise-team`. + public typealias EnterpriseTeam = Swift.String + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + } + /// 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 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.BasicError) + /// 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.BasicError { + 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 + } + } + } + /// 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 members in an enterprise team + /// + /// Lists all team members in an enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)`. + public enum EnterpriseTeamMembershipsList { + public static let id: Swift.String = "enterprise-team-memberships/list" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + } + } + public var path: Operations.EnterpriseTeamMembershipsList.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/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/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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}/teams/{enterprise-team}/memberships/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.EnterpriseTeamMembershipsList.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/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.EnterpriseTeamMembershipsList.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.EnterpriseTeamMembershipsList.Input.Path, + query: Operations.EnterpriseTeamMembershipsList.Input.Query = .init(), + headers: Operations.EnterpriseTeamMembershipsList.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}/teams/{enterprise-team}/memberships/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/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.EnterpriseTeamMembershipsList.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) + /// 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.SimpleUser] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamMembershipsList.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.EnterpriseTeamMembershipsList.Output.Ok.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsList.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamMembershipsList.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.EnterpriseTeamMembershipsList.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 + ] + } + } + } + /// Bulk add team members + /// + /// Add multiple team members to an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)`. + public enum EnterpriseTeamMembershipsBulkAdd { + public static let id: Swift.String = "enterprise-team-memberships/bulk-add" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + } + } + public var path: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/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.EnterpriseTeamMembershipsBulkAdd.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The GitHub user handles to add to the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/requestBody/json/usernames`. + public var usernames: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - usernames: The GitHub user handles to add to the team. + public init(usernames: [Swift.String]) { + self.usernames = usernames + } + public enum CodingKeys: String, CodingKey { + case usernames + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamMembershipsBulkAdd.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Path, + headers: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsBulkAdd.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/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) + /// 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.SimpleUser] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamMembershipsBulkAdd.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamMembershipsBulkAdd.Output.Ok.Body) { + self.body = body + } + } + /// Successfully added team members. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamMembershipsBulkAdd.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.EnterpriseTeamMembershipsBulkAdd.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 + ] + } + } + } + /// Bulk remove team members + /// + /// Remove multiple team members from an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)`. + public enum EnterpriseTeamMembershipsBulkRemove { + public static let id: Swift.String = "enterprise-team-memberships/bulk-remove" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + } + } + public var path: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/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.EnterpriseTeamMembershipsBulkRemove.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The GitHub user handles to be removed from the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/requestBody/json/usernames`. + public var usernames: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - usernames: The GitHub user handles to be removed from the team. + public init(usernames: [Swift.String]) { + self.usernames = usernames + } + public enum CodingKeys: String, CodingKey { + case usernames + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamMembershipsBulkRemove.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Path, + headers: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsBulkRemove.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/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) + /// 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.SimpleUser] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamMembershipsBulkRemove.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamMembershipsBulkRemove.Output.Ok.Body) { + self.body = body + } + } + /// Successfully removed team members. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamMembershipsBulkRemove.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.EnterpriseTeamMembershipsBulkRemove.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 + ] + } + } + } + /// Get enterprise team membership + /// + /// Returns whether the user is a member of the enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)`. + public enum EnterpriseTeamMembershipsGet { + public static let id: Swift.String = "enterprise-team-memberships/get" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// - username: The handle for the GitHub user account. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam, + username: Components.Parameters.Username + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + self.username = username + } + } + public var path: Operations.EnterpriseTeamMembershipsGet.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/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.EnterpriseTeamMembershipsGet.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamMembershipsGet.Input.Path, + headers: Operations.EnterpriseTeamMembershipsGet.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.SimpleUser) + /// 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.SimpleUser { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamMembershipsGet.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamMembershipsGet.Output.Ok.Body) { + self.body = body + } + } + /// User is a member of the enterprise team. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamMembershipsGet.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.EnterpriseTeamMembershipsGet.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 + ] + } + } + } + /// Add team member + /// + /// Add a team member to an enterprise team. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)`. + public enum EnterpriseTeamMembershipsAdd { + public static let id: Swift.String = "enterprise-team-memberships/add" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// - username: The handle for the GitHub user account. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam, + username: Components.Parameters.Username + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + self.username = username + } + } + public var path: Operations.EnterpriseTeamMembershipsAdd.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/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.EnterpriseTeamMembershipsAdd.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamMembershipsAdd.Input.Path, + headers: Operations.EnterpriseTeamMembershipsAdd.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/responses/201/content/application\/json`. + case json(Components.Schemas.SimpleUser) + /// 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.SimpleUser { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamMembershipsAdd.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamMembershipsAdd.Output.Created.Body) { + self.body = body + } + } + /// Successfully added team member + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.EnterpriseTeamMembershipsAdd.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.EnterpriseTeamMembershipsAdd.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 + ] + } + } + } + /// Remove team membership + /// + /// Remove membership of a specific user from a particular team in an enterprise. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)`. + public enum EnterpriseTeamMembershipsRemove { + public static let id: Swift.String = "enterprise-team-memberships/remove" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// - username: The handle for the GitHub user account. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam, + username: Components.Parameters.Username + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + self.username = username + } + } + public var path: Operations.EnterpriseTeamMembershipsRemove.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/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.EnterpriseTeamMembershipsRemove.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamMembershipsRemove.Input.Path, + headers: Operations.EnterpriseTeamMembershipsRemove.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//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.EnterpriseTeamMembershipsRemove.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.EnterpriseTeamMembershipsRemove.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)/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 + ) + } + } + } + /// 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/enterprise-teams/Client.swift b/Sources/enterprise-teams/Client.swift index 87202523ac7..ff723ec28ae 100644 --- a/Sources/enterprise-teams/Client.swift +++ b/Sources/enterprise-teams/Client.swift @@ -38,4 +38,453 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// List enterprise teams + /// + /// List all teams in the enterprise for the authenticated user + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)`. + public func enterpriseTeamsList(_ input: Operations.EnterpriseTeamsList.Input) async throws -> Operations.EnterpriseTeamsList.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsList.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams", + 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: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.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.EnterpriseTeamsList.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.EnterpriseTeamsList.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.EnterpriseTeam].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + 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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create an enterprise team + /// + /// To create an enterprise team, the authenticated user must be an owner of the enterprise. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)`. + public func enterpriseTeamsCreate(_ input: Operations.EnterpriseTeamsCreate.Input) async throws -> Operations.EnterpriseTeamsCreate.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsCreate.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams", + parameters: [ + input.path.enterprise + ] + ) + 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.EnterpriseTeamsCreate.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.EnterpriseTeam.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 an enterprise team + /// + /// Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a `-` separator and adds the "ent:" prefix. For example, "My TEam Näme" would become `ent:my-team-name`. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)`. + public func enterpriseTeamsGet(_ input: Operations.EnterpriseTeamsGet.Input) async throws -> Operations.EnterpriseTeamsGet.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsGet.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}", + parameters: [ + input.path.enterprise, + input.path.teamSlug + ] + ) + 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 headers: Operations.EnterpriseTeamsGet.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.EnterpriseTeamsGet.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.EnterpriseTeam.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + 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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update an enterprise team + /// + /// To edit a team, the authenticated user must be an enterprise owner. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)`. + public func enterpriseTeamsUpdate(_ input: Operations.EnterpriseTeamsUpdate.Input) async throws -> Operations.EnterpriseTeamsUpdate.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsUpdate.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}", + parameters: [ + input.path.enterprise, + input.path.teamSlug + ] + ) + 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 headers: Operations.EnterpriseTeamsUpdate.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.EnterpriseTeamsUpdate.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.EnterpriseTeam.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + 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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete an enterprise team + /// + /// To delete an enterprise team, the authenticated user must be an enterprise owner. + /// + /// If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)`. + public func enterpriseTeamsDelete(_ input: Operations.EnterpriseTeamsDelete.Input) async throws -> Operations.EnterpriseTeamsDelete.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsDelete.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}", + parameters: [ + input.path.enterprise, + input.path.teamSlug + ] + ) + 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 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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } } diff --git a/Sources/enterprise-teams/Types.swift b/Sources/enterprise-teams/Types.swift index c3d1209ecf5..239252f73fe 100644 --- a/Sources/enterprise-teams/Types.swift +++ b/Sources/enterprise-teams/Types.swift @@ -10,10 +10,131 @@ 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 { + /// List enterprise teams + /// + /// List all teams in the enterprise for the authenticated user + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)`. + func enterpriseTeamsList(_ input: Operations.EnterpriseTeamsList.Input) async throws -> Operations.EnterpriseTeamsList.Output + /// Create an enterprise team + /// + /// To create an enterprise team, the authenticated user must be an owner of the enterprise. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)`. + func enterpriseTeamsCreate(_ input: Operations.EnterpriseTeamsCreate.Input) async throws -> Operations.EnterpriseTeamsCreate.Output + /// Get an enterprise team + /// + /// Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a `-` separator and adds the "ent:" prefix. For example, "My TEam Näme" would become `ent:my-team-name`. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)`. + func enterpriseTeamsGet(_ input: Operations.EnterpriseTeamsGet.Input) async throws -> Operations.EnterpriseTeamsGet.Output + /// Update an enterprise team + /// + /// To edit a team, the authenticated user must be an enterprise owner. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)`. + func enterpriseTeamsUpdate(_ input: Operations.EnterpriseTeamsUpdate.Input) async throws -> Operations.EnterpriseTeamsUpdate.Output + /// Delete an enterprise team + /// + /// To delete an enterprise team, the authenticated user must be an enterprise owner. + /// + /// If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)`. + func enterpriseTeamsDelete(_ input: Operations.EnterpriseTeamsDelete.Input) async throws -> Operations.EnterpriseTeamsDelete.Output +} /// Convenience overloads for operation inputs. extension APIProtocol { + /// List enterprise teams + /// + /// List all teams in the enterprise for the authenticated user + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)`. + public func enterpriseTeamsList( + path: Operations.EnterpriseTeamsList.Input.Path, + query: Operations.EnterpriseTeamsList.Input.Query = .init(), + headers: Operations.EnterpriseTeamsList.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamsList.Output { + try await enterpriseTeamsList(Operations.EnterpriseTeamsList.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create an enterprise team + /// + /// To create an enterprise team, the authenticated user must be an owner of the enterprise. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)`. + public func enterpriseTeamsCreate( + path: Operations.EnterpriseTeamsCreate.Input.Path, + headers: Operations.EnterpriseTeamsCreate.Input.Headers = .init(), + body: Operations.EnterpriseTeamsCreate.Input.Body + ) async throws -> Operations.EnterpriseTeamsCreate.Output { + try await enterpriseTeamsCreate(Operations.EnterpriseTeamsCreate.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get an enterprise team + /// + /// Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a `-` separator and adds the "ent:" prefix. For example, "My TEam Näme" would become `ent:my-team-name`. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)`. + public func enterpriseTeamsGet( + path: Operations.EnterpriseTeamsGet.Input.Path, + headers: Operations.EnterpriseTeamsGet.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamsGet.Output { + try await enterpriseTeamsGet(Operations.EnterpriseTeamsGet.Input( + path: path, + headers: headers + )) + } + /// Update an enterprise team + /// + /// To edit a team, the authenticated user must be an enterprise owner. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)`. + public func enterpriseTeamsUpdate( + path: Operations.EnterpriseTeamsUpdate.Input.Path, + headers: Operations.EnterpriseTeamsUpdate.Input.Headers = .init(), + body: Operations.EnterpriseTeamsUpdate.Input.Body + ) async throws -> Operations.EnterpriseTeamsUpdate.Output { + try await enterpriseTeamsUpdate(Operations.EnterpriseTeamsUpdate.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete an enterprise team + /// + /// To delete an enterprise team, the authenticated user must be an enterprise owner. + /// + /// If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)`. + public func enterpriseTeamsDelete( + path: Operations.EnterpriseTeamsDelete.Input.Path, + headers: Operations.EnterpriseTeamsDelete.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamsDelete.Output { + try await enterpriseTeamsDelete(Operations.EnterpriseTeamsDelete.Input( + path: path, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -38,16 +159,1178 @@ 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 { + /// Basic Error + /// + /// - Remark: Generated from `#/components/schemas/basic-error`. + public struct BasicError: 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 documentationUrl: 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 `BasicError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - url: + /// - status: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + url: Swift.String? = nil, + status: Swift.String? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.url = url + self.status = status + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case url + case status + } + } + /// Group of enterprise owners and/or members + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team`. + public struct EnterpriseTeam: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/description`. + public var description: 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 + /// Retired: this field will not be returned with GHEC enterprise teams. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. + public var syncToOrganizations: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/organization_selection_type`. + public var organizationSelectionType: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. + public var groupId: Swift.String? + /// Retired: this field will not be returned with GHEC enterprise teams. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_name`. + public var groupName: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `EnterpriseTeam`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - description: + /// - slug: + /// - url: + /// - syncToOrganizations: Retired: this field will not be returned with GHEC enterprise teams. + /// - organizationSelectionType: + /// - groupId: + /// - groupName: Retired: this field will not be returned with GHEC enterprise teams. + /// - htmlUrl: + /// - membersUrl: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int64, + name: Swift.String, + description: Swift.String? = nil, + slug: Swift.String, + url: Swift.String, + syncToOrganizations: Swift.String? = nil, + organizationSelectionType: Swift.String? = nil, + groupId: Swift.String? = nil, + groupName: Swift.String? = nil, + htmlUrl: Swift.String, + membersUrl: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.id = id + self.name = name + self.description = description + self.slug = slug + self.url = url + self.syncToOrganizations = syncToOrganizations + self.organizationSelectionType = organizationSelectionType + self.groupId = groupId + self.groupName = groupName + self.htmlUrl = htmlUrl + self.membersUrl = membersUrl + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case description + case slug + case url + case syncToOrganizations = "sync_to_organizations" + case organizationSelectionType = "organization_selection_type" + case groupId = "group_id" + case groupName = "group_name" + case htmlUrl = "html_url" + case membersUrl = "members_url" + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + } /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters {} + public enum Parameters { + /// 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`. + public typealias PerPage = Swift.Int + /// 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 `#/components/parameters/page`. + public typealias Page = Swift.Int + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias TeamSlug = Swift.String + } /// 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 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.BasicError) + /// 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.BasicError { + 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 + } + } + } /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers {} + 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 {} +public enum Operations { + /// List enterprise teams + /// + /// List all teams in the enterprise for the authenticated user + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)`. + public enum EnterpriseTeamsList { + public static let id: Swift.String = "enterprise-teams/list" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.EnterpriseTeamsList.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/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/enterprises/{enterprise}/teams/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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}/teams/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.EnterpriseTeamsList.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/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.EnterpriseTeamsList.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.EnterpriseTeamsList.Input.Path, + query: Operations.EnterpriseTeamsList.Input.Query = .init(), + headers: Operations.EnterpriseTeamsList.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}/teams/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/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.EnterpriseTeamsList.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/responses/200/content/application\/json`. + case json([Components.Schemas.EnterpriseTeam]) + /// 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.EnterpriseTeam] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamsList.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.EnterpriseTeamsList.Output.Ok.Headers = .init(), + body: Operations.EnterpriseTeamsList.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamsList.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.EnterpriseTeamsList.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)/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 + ) + } + } + } + /// 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 an enterprise team + /// + /// To create an enterprise team, the authenticated user must be an owner of the enterprise. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)`. + public enum EnterpriseTeamsCreate { + public static let id: Swift.String = "enterprise-teams/create" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.EnterpriseTeamsCreate.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/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.EnterpriseTeamsCreate.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/name`. + public var name: Swift.String + /// A description of the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/description`. + public var description: Swift.String? + /// Retired: this field is no longer supported. + /// Whether the enterprise team should be reflected in each organization. + /// This value cannot be set. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/sync_to_organizations`. + @frozen public enum SyncToOrganizationsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case disabled = "disabled" + } + /// Retired: this field is no longer supported. + /// Whether the enterprise team should be reflected in each organization. + /// This value cannot be set. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/sync_to_organizations`. + public var syncToOrganizations: Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload.SyncToOrganizationsPayload? + /// The ID of the IdP group to assign team membership with. You can get this value from the [REST API endpoints for SCIM](https://docs.github.com/rest/scim#list-provisioned-scim-groups-for-an-enterprise). + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/group_id`. + public var groupId: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the team. + /// - description: A description of the team. + /// - syncToOrganizations: Retired: this field is no longer supported. + /// - groupId: The ID of the IdP group to assign team membership with. You can get this value from the [REST API endpoints for SCIM](https://docs.github.com/rest/scim#list-provisioned-scim-groups-for-an-enterprise). + public init( + name: Swift.String, + description: Swift.String? = nil, + syncToOrganizations: Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload.SyncToOrganizationsPayload? = nil, + groupId: Swift.String? = nil + ) { + self.name = name + self.description = description + self.syncToOrganizations = syncToOrganizations + self.groupId = groupId + } + public enum CodingKeys: String, CodingKey { + case name + case description + case syncToOrganizations = "sync_to_organizations" + case groupId = "group_id" + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamsCreate.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamsCreate.Input.Path, + headers: Operations.EnterpriseTeamsCreate.Input.Headers = .init(), + body: Operations.EnterpriseTeamsCreate.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/enterprises/{enterprise}/teams/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/responses/201/content/application\/json`. + case json(Components.Schemas.EnterpriseTeam) + /// 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.EnterpriseTeam { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamsCreate.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamsCreate.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.EnterpriseTeamsCreate.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.EnterpriseTeamsCreate.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 an enterprise team + /// + /// Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a `-` separator and adds the "ent:" prefix. For example, "My TEam Näme" would become `ent:my-team-name`. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)`. + public enum EnterpriseTeamsGet { + public static let id: Swift.String = "enterprise-teams/get" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug of the team name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - teamSlug: The slug of the team name. + public init( + enterprise: Components.Parameters.Enterprise, + teamSlug: Components.Parameters.TeamSlug + ) { + self.enterprise = enterprise + self.teamSlug = teamSlug + } + } + public var path: Operations.EnterpriseTeamsGet.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/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.EnterpriseTeamsGet.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamsGet.Input.Path, + headers: Operations.EnterpriseTeamsGet.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/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.EnterpriseTeamsGet.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.EnterpriseTeam) + /// 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.EnterpriseTeam { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamsGet.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.EnterpriseTeamsGet.Output.Ok.Headers = .init(), + body: Operations.EnterpriseTeamsGet.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamsGet.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.EnterpriseTeamsGet.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)/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 + ) + } + } + } + /// 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 an enterprise team + /// + /// To edit a team, the authenticated user must be an enterprise owner. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)`. + public enum EnterpriseTeamsUpdate { + public static let id: Swift.String = "enterprise-teams/update" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug of the team name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - teamSlug: The slug of the team name. + public init( + enterprise: Components.Parameters.Enterprise, + teamSlug: Components.Parameters.TeamSlug + ) { + self.enterprise = enterprise + self.teamSlug = teamSlug + } + } + public var path: Operations.EnterpriseTeamsUpdate.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/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.EnterpriseTeamsUpdate.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// A new name for the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// A new description for the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/description`. + public var description: Swift.String? + /// Retired: this field is no longer supported. + /// Whether the enterprise team should be reflected in each organization. + /// This value cannot be changed. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/sync_to_organizations`. + @frozen public enum SyncToOrganizationsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case disabled = "disabled" + } + /// Retired: this field is no longer supported. + /// Whether the enterprise team should be reflected in each organization. + /// This value cannot be changed. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/sync_to_organizations`. + public var syncToOrganizations: Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload.SyncToOrganizationsPayload? + /// The ID of the IdP group to assign team membership with. The new IdP group will replace the existing one, or replace existing direct members if the team isn't currently linked to an IdP group. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/group_id`. + public var groupId: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: A new name for the team. + /// - description: A new description for the team. + /// - syncToOrganizations: Retired: this field is no longer supported. + /// - groupId: The ID of the IdP group to assign team membership with. The new IdP group will replace the existing one, or replace existing direct members if the team isn't currently linked to an IdP group. + public init( + name: Swift.String? = nil, + description: Swift.String? = nil, + syncToOrganizations: Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload.SyncToOrganizationsPayload? = nil, + groupId: Swift.String? = nil + ) { + self.name = name + self.description = description + self.syncToOrganizations = syncToOrganizations + self.groupId = groupId + } + public enum CodingKeys: String, CodingKey { + case name + case description + case syncToOrganizations = "sync_to_organizations" + case groupId = "group_id" + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamsUpdate.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamsUpdate.Input.Path, + headers: Operations.EnterpriseTeamsUpdate.Input.Headers = .init(), + body: Operations.EnterpriseTeamsUpdate.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/enterprises/{enterprise}/teams/{team_slug}/PATCH/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/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.EnterpriseTeamsUpdate.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.EnterpriseTeam) + /// 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.EnterpriseTeam { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamsUpdate.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.EnterpriseTeamsUpdate.Output.Ok.Headers = .init(), + body: Operations.EnterpriseTeamsUpdate.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamsUpdate.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.EnterpriseTeamsUpdate.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/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 + ) + } + } + } + /// 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 an enterprise team + /// + /// To delete an enterprise team, the authenticated user must be an enterprise owner. + /// + /// If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)`. + public enum EnterpriseTeamsDelete { + public static let id: Swift.String = "enterprise-teams/delete" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/DELETE/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug of the team name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/DELETE/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - teamSlug: The slug of the team name. + public init( + enterprise: Components.Parameters.Enterprise, + teamSlug: Components.Parameters.TeamSlug + ) { + self.enterprise = enterprise + self.teamSlug = teamSlug + } + } + public var path: Operations.EnterpriseTeamsDelete.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/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.EnterpriseTeamsDelete.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamsDelete.Input.Path, + headers: Operations.EnterpriseTeamsDelete.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//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.EnterpriseTeamsDelete.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.EnterpriseTeamsDelete.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)/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 + ) + } + } + } + /// 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/gists/Types.swift b/Sources/gists/Types.swift index 9165a2da328..1195d3d8244 100644 --- a/Sources/gists/Types.swift +++ b/Sources/gists/Types.swift @@ -2437,6 +2437,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/since`. public typealias Since = Foundation.Date + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The unique identifier of the gist. /// /// - Remark: Generated from `#/components/parameters/gist-id`. @@ -2445,10 +2449,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/comment-id`. public typealias CommentId = Swift.Int64 - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 3062d395043..508959253c4 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -4563,6 +4563,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -4579,6 +4598,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -4592,7 +4614,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -4607,6 +4632,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -4622,6 +4650,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -4695,6 +4726,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -4713,6 +4763,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -4728,6 +4781,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -4743,6 +4799,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -4759,6 +4818,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index b8bd46122c2..21cc862d1b7 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -7275,11 +7275,11 @@ public struct Client: APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)`. - public func orgsGetAllCustomProperties(_ input: Operations.OrgsGetAllCustomProperties.Input) async throws -> Operations.OrgsGetAllCustomProperties.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)`. + public func orgsCustomPropertiesForReposGetOrganizationDefinitions(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetAllCustomProperties.id, + forOperation: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/schema", @@ -7302,7 +7302,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetAllCustomProperties.Output.Ok.Body + let body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7391,11 +7391,11 @@ public struct Client: APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)`. - public func orgsCreateOrUpdateCustomProperties(_ input: Operations.OrgsCreateOrUpdateCustomProperties.Input) async throws -> Operations.OrgsCreateOrUpdateCustomProperties.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateOrUpdateCustomProperties.id, + forOperation: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/schema", @@ -7427,7 +7427,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok.Body + let body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7509,11 +7509,11 @@ public struct Client: APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)`. - public func orgsGetCustomProperty(_ input: Operations.OrgsGetCustomProperty.Input) async throws -> Operations.OrgsGetCustomProperty.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)`. + public func orgsCustomPropertiesForReposGetOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetCustomProperty.id, + forOperation: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/schema/{}", @@ -7537,7 +7537,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetCustomProperty.Output.Ok.Body + let body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7622,11 +7622,11 @@ public struct Client: APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)`. - public func orgsCreateOrUpdateCustomProperty(_ input: Operations.OrgsCreateOrUpdateCustomProperty.Input) async throws -> Operations.OrgsCreateOrUpdateCustomProperty.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateOrUpdateCustomProperty.id, + forOperation: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/schema/{}", @@ -7659,7 +7659,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok.Body + let body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7744,11 +7744,11 @@ public struct Client: APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)`. - public func orgsRemoveCustomProperty(_ input: Operations.OrgsRemoveCustomProperty.Input) async throws -> Operations.OrgsRemoveCustomProperty.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)`. + public func orgsCustomPropertiesForReposDeleteOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Output { try await client.send( input: input, - forOperation: Operations.OrgsRemoveCustomProperty.id, + forOperation: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/schema/{}", @@ -7834,11 +7834,11 @@ public struct Client: APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)`. - public func orgsListCustomPropertiesValuesForRepos(_ input: Operations.OrgsListCustomPropertiesValuesForRepos.Input) async throws -> Operations.OrgsListCustomPropertiesValuesForRepos.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)`. + public func orgsCustomPropertiesForReposGetOrganizationValues(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output { try await client.send( input: input, - forOperation: Operations.OrgsListCustomPropertiesValuesForRepos.id, + forOperation: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/values", @@ -7881,13 +7881,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.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.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Body + let body: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7980,11 +7980,11 @@ public struct Client: APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)`. - public func orgsCreateOrUpdateCustomPropertiesValuesForRepos(_ input: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input) async throws -> Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationValues(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.id, + forOperation: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/values", diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index e7be3d7e748..803448baef0 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -727,8 +727,8 @@ public protocol APIProtocol: Sendable { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)`. - func orgsGetAllCustomProperties(_ input: Operations.OrgsGetAllCustomProperties.Input) async throws -> Operations.OrgsGetAllCustomProperties.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)`. + func orgsCustomPropertiesForReposGetOrganizationDefinitions(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output /// Create or update custom properties for an organization /// /// Creates new or updates existing custom properties defined for an organization in a batch. @@ -742,16 +742,16 @@ public protocol APIProtocol: Sendable { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)`. - func orgsCreateOrUpdateCustomProperties(_ input: Operations.OrgsCreateOrUpdateCustomProperties.Input) async throws -> Operations.OrgsCreateOrUpdateCustomProperties.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)`. + func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output /// Get a custom property for an organization /// /// Gets a custom property that is defined for an organization. /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)`. - func orgsGetCustomProperty(_ input: Operations.OrgsGetCustomProperty.Input) async throws -> Operations.OrgsGetCustomProperty.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)`. + func orgsCustomPropertiesForReposGetOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output /// Create or update a custom property for an organization /// /// Creates a new or updates an existing custom property that is defined for an organization. @@ -761,8 +761,8 @@ public protocol APIProtocol: Sendable { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)`. - func orgsCreateOrUpdateCustomProperty(_ input: Operations.OrgsCreateOrUpdateCustomProperty.Input) async throws -> Operations.OrgsCreateOrUpdateCustomProperty.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)`. + func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output /// Remove a custom property for an organization /// /// Removes a custom property that is defined for an organization. @@ -772,16 +772,16 @@ public protocol APIProtocol: Sendable { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)`. - func orgsRemoveCustomProperty(_ input: Operations.OrgsRemoveCustomProperty.Input) async throws -> Operations.OrgsRemoveCustomProperty.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)`. + func orgsCustomPropertiesForReposDeleteOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Output /// List custom property values for organization repositories /// /// Lists organization repositories with all of their custom property values. /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)`. - func orgsListCustomPropertiesValuesForRepos(_ input: Operations.OrgsListCustomPropertiesValuesForRepos.Input) async throws -> Operations.OrgsListCustomPropertiesValuesForRepos.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)`. + func orgsCustomPropertiesForReposGetOrganizationValues(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output /// Create or update custom property values for organization repositories /// /// Create new or update existing custom property values for repositories in a batch that belong to an organization. @@ -796,8 +796,8 @@ public protocol APIProtocol: Sendable { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)`. - func orgsCreateOrUpdateCustomPropertiesValuesForRepos(_ input: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input) async throws -> Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)`. + func orgsCustomPropertiesForReposCreateOrUpdateOrganizationValues(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output /// List public organization members /// /// Members of an organization can choose to have their membership publicized or not. @@ -2258,12 +2258,12 @@ extension APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)`. - public func orgsGetAllCustomProperties( - path: Operations.OrgsGetAllCustomProperties.Input.Path, - headers: Operations.OrgsGetAllCustomProperties.Input.Headers = .init() - ) async throws -> Operations.OrgsGetAllCustomProperties.Output { - try await orgsGetAllCustomProperties(Operations.OrgsGetAllCustomProperties.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)`. + public func orgsCustomPropertiesForReposGetOrganizationDefinitions( + path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output { + try await orgsCustomPropertiesForReposGetOrganizationDefinitions(Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input( path: path, headers: headers )) @@ -2281,13 +2281,13 @@ extension APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)`. - public func orgsCreateOrUpdateCustomProperties( - path: Operations.OrgsCreateOrUpdateCustomProperties.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomProperties.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomProperties.Input.Body - ) async throws -> Operations.OrgsCreateOrUpdateCustomProperties.Output { - try await orgsCreateOrUpdateCustomProperties(Operations.OrgsCreateOrUpdateCustomProperties.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions( + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Body + ) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output { + try await orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input( path: path, headers: headers, body: body @@ -2299,12 +2299,12 @@ extension APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)`. - public func orgsGetCustomProperty( - path: Operations.OrgsGetCustomProperty.Input.Path, - headers: Operations.OrgsGetCustomProperty.Input.Headers = .init() - ) async throws -> Operations.OrgsGetCustomProperty.Output { - try await orgsGetCustomProperty(Operations.OrgsGetCustomProperty.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)`. + public func orgsCustomPropertiesForReposGetOrganizationDefinition( + path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output { + try await orgsCustomPropertiesForReposGetOrganizationDefinition(Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input( path: path, headers: headers )) @@ -2318,13 +2318,13 @@ extension APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)`. - public func orgsCreateOrUpdateCustomProperty( - path: Operations.OrgsCreateOrUpdateCustomProperty.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomProperty.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomProperty.Input.Body - ) async throws -> Operations.OrgsCreateOrUpdateCustomProperty.Output { - try await orgsCreateOrUpdateCustomProperty(Operations.OrgsCreateOrUpdateCustomProperty.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition( + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Body + ) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output { + try await orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input( path: path, headers: headers, body: body @@ -2339,12 +2339,12 @@ extension APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)`. - public func orgsRemoveCustomProperty( - path: Operations.OrgsRemoveCustomProperty.Input.Path, - headers: Operations.OrgsRemoveCustomProperty.Input.Headers = .init() - ) async throws -> Operations.OrgsRemoveCustomProperty.Output { - try await orgsRemoveCustomProperty(Operations.OrgsRemoveCustomProperty.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)`. + public func orgsCustomPropertiesForReposDeleteOrganizationDefinition( + path: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Output { + try await orgsCustomPropertiesForReposDeleteOrganizationDefinition(Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input( path: path, headers: headers )) @@ -2355,13 +2355,13 @@ extension APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)`. - public func orgsListCustomPropertiesValuesForRepos( - path: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Path, - query: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Query = .init(), - headers: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Headers = .init() - ) async throws -> Operations.OrgsListCustomPropertiesValuesForRepos.Output { - try await orgsListCustomPropertiesValuesForRepos(Operations.OrgsListCustomPropertiesValuesForRepos.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)`. + public func orgsCustomPropertiesForReposGetOrganizationValues( + path: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Path, + query: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Query = .init(), + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output { + try await orgsCustomPropertiesForReposGetOrganizationValues(Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input( path: path, query: query, headers: headers @@ -2381,13 +2381,13 @@ extension APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)`. - public func orgsCreateOrUpdateCustomPropertiesValuesForRepos( - path: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Body - ) async throws -> Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output { - try await orgsCreateOrUpdateCustomPropertiesValuesForRepos(Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationValues( + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Body + ) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output { + try await orgsCustomPropertiesForReposCreateOrUpdateOrganizationValues(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input( path: path, headers: headers, body: body @@ -6263,6 +6263,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -6279,6 +6298,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -6292,7 +6314,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -6307,6 +6332,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -6322,6 +6350,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -6395,6 +6426,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -6413,6 +6463,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -6428,6 +6481,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -6443,6 +6499,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -6459,6 +6518,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -7312,6 +7374,25 @@ public enum Components { public var repositoriesUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team-role-assignment/parent`. public var parent: Components.Schemas.NullableTeamSimple? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/type`. + public var _type: Components.Schemas.TeamRoleAssignment._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `TeamRoleAssignment`. /// /// - Parameters: @@ -7330,6 +7411,9 @@ public enum Components { /// - membersUrl: /// - repositoriesUrl: /// - parent: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( assignment: Components.Schemas.TeamRoleAssignment.AssignmentPayload? = nil, id: Swift.Int, @@ -7345,7 +7429,10 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, - parent: Components.Schemas.NullableTeamSimple? = nil + parent: Components.Schemas.NullableTeamSimple? = nil, + _type: Components.Schemas.TeamRoleAssignment._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.assignment = assignment self.id = id @@ -7362,6 +7449,9 @@ public enum Components { self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl self.parent = parent + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case assignment @@ -7379,6 +7469,9 @@ public enum Components { case membersUrl = "members_url" case repositoriesUrl = "repositories_url" case parent + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -7427,6 +7520,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-simple/type`. + public var _type: Components.Schemas.TeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `TeamSimple`. /// /// - Parameters: @@ -7443,6 +7555,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -7456,7 +7571,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.TeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -7471,6 +7589,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -7486,6 +7607,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// The Relationship a User has with a role. @@ -8551,6 +8675,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias TeamSlug = Swift.String /// An organization ID. Only return organizations with an ID greater than this ID. /// /// - Remark: Generated from `#/components/parameters/since-org`. @@ -8559,10 +8691,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/org`. public typealias Org = Swift.String - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// /// - Remark: Generated from `#/components/parameters/hook-id`. @@ -8642,10 +8770,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/issue-type-id`. public typealias IssueTypeId = Swift.Int - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias TeamSlug = Swift.String /// The unique identifier of the role. /// /// - Remark: Generated from `#/components/parameters/role-id`. @@ -24021,9 +24145,9 @@ public enum Operations { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)`. - public enum OrgsGetAllCustomProperties { - public static let id: Swift.String = "orgs/get-all-custom-properties" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)`. + public enum OrgsCustomPropertiesForReposGetOrganizationDefinitions { + public static let id: Swift.String = "orgs/custom-properties-for-repos-get-organization-definitions" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/path`. public struct Path: Sendable, Hashable { @@ -24039,27 +24163,27 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsGetAllCustomProperties.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/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.OrgsGetAllCustomProperties.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsGetAllCustomProperties.Input.Path, - headers: Operations.OrgsGetAllCustomProperties.Input.Headers = .init() + path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -24085,26 +24209,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetAllCustomProperties.Output.Ok.Body + public var body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGetAllCustomProperties.Output.Ok.Body) { + public init(body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetAllCustomProperties.Output.Ok) + case ok(Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.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.OrgsGetAllCustomProperties.Output.Ok { + public var ok: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok { get throws { switch self { case let .ok(response): @@ -24119,7 +24243,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -24142,7 +24266,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -24207,9 +24331,9 @@ public enum Operations { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)`. - public enum OrgsCreateOrUpdateCustomProperties { - public static let id: Swift.String = "orgs/create-or-update-custom-properties" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)`. + public enum OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions { + public static let id: Swift.String = "orgs/custom-properties-for-repos-create-or-update-organization-definitions" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/path`. public struct Path: Sendable, Hashable { @@ -24225,19 +24349,19 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsCreateOrUpdateCustomProperties.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/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.OrgsCreateOrUpdateCustomProperties.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Headers /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody/json`. @@ -24258,9 +24382,9 @@ public enum Operations { } } /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsCreateOrUpdateCustomProperties.Input.Body.JsonPayload) + case json(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Body.JsonPayload) } - public var body: Operations.OrgsCreateOrUpdateCustomProperties.Input.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -24268,9 +24392,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsCreateOrUpdateCustomProperties.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomProperties.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomProperties.Input.Body + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Body ) { self.path = path self.headers = headers @@ -24297,26 +24421,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok.Body) { + public init(body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok) + case ok(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.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.OrgsCreateOrUpdateCustomProperties.Output.Ok { + public var ok: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok { get throws { switch self { case let .ok(response): @@ -24331,7 +24455,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -24354,7 +24478,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -24412,9 +24536,9 @@ public enum Operations { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)`. - public enum OrgsGetCustomProperty { - public static let id: Swift.String = "orgs/get-custom-property" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)`. + public enum OrgsCustomPropertiesForReposGetOrganizationDefinition { + public static let id: Swift.String = "orgs/custom-properties-for-repos-get-organization-definition" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/path`. public struct Path: Sendable, Hashable { @@ -24439,27 +24563,27 @@ public enum Operations { self.customPropertyName = customPropertyName } } - public var path: Operations.OrgsGetCustomProperty.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/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.OrgsGetCustomProperty.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsGetCustomProperty.Input.Path, - headers: Operations.OrgsGetCustomProperty.Input.Headers = .init() + path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -24485,26 +24609,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetCustomProperty.Output.Ok.Body + public var body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGetCustomProperty.Output.Ok.Body) { + public init(body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetCustomProperty.Output.Ok) + case ok(Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.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.OrgsGetCustomProperty.Output.Ok { + public var ok: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok { get throws { switch self { case let .ok(response): @@ -24519,7 +24643,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -24542,7 +24666,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -24603,9 +24727,9 @@ public enum Operations { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)`. - public enum OrgsCreateOrUpdateCustomProperty { - public static let id: Swift.String = "orgs/create-or-update-custom-property" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)`. + public enum OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition { + public static let id: Swift.String = "orgs/custom-properties-for-repos-create-or-update-organization-definition" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path`. public struct Path: Sendable, Hashable { @@ -24630,25 +24754,25 @@ public enum Operations { self.customPropertyName = customPropertyName } } - public var path: Operations.OrgsCreateOrUpdateCustomProperty.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/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.OrgsCreateOrUpdateCustomProperty.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Headers /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/content/application\/json`. case json(Components.Schemas.CustomPropertySetPayload) } - public var body: Operations.OrgsCreateOrUpdateCustomProperty.Input.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -24656,9 +24780,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsCreateOrUpdateCustomProperty.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomProperty.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomProperty.Input.Body + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Body ) { self.path = path self.headers = headers @@ -24685,26 +24809,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok.Body) { + public init(body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok) + case ok(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.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.OrgsCreateOrUpdateCustomProperty.Output.Ok { + public var ok: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok { get throws { switch self { case let .ok(response): @@ -24719,7 +24843,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -24742,7 +24866,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -24803,9 +24927,9 @@ public enum Operations { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)`. - public enum OrgsRemoveCustomProperty { - public static let id: Swift.String = "orgs/remove-custom-property" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)`. + public enum OrgsCustomPropertiesForReposDeleteOrganizationDefinition { + public static let id: Swift.String = "orgs/custom-properties-for-repos-delete-organization-definition" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/path`. public struct Path: Sendable, Hashable { @@ -24830,27 +24954,27 @@ public enum Operations { self.customPropertyName = customPropertyName } } - public var path: Operations.OrgsRemoveCustomProperty.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/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.OrgsRemoveCustomProperty.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsRemoveCustomProperty.Input.Path, - headers: Operations.OrgsRemoveCustomProperty.Input.Headers = .init() + path: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -24859,13 +24983,13 @@ public enum Operations { @frozen public enum Output: Sendable, Hashable { /// A header with no content is returned. /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)/responses/204`. /// /// HTTP response code: `204 noContent`. case noContent(Components.Responses.NoContent) /// A header with no content is returned. /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -24890,7 +25014,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -24913,7 +25037,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -24971,9 +25095,9 @@ public enum Operations { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)`. - public enum OrgsListCustomPropertiesValuesForRepos { - public static let id: Swift.String = "orgs/list-custom-properties-values-for-repos" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)`. + public enum OrgsCustomPropertiesForReposGetOrganizationValues { + public static let id: Swift.String = "orgs/custom-properties-for-repos-get-organization-values" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/path`. public struct Path: Sendable, Hashable { @@ -24989,7 +25113,7 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/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)." @@ -25020,19 +25144,19 @@ public enum Operations { self.repositoryQuery = repositoryQuery } } - public var query: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Query + public var query: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Query /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/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.OrgsListCustomPropertiesValuesForRepos.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -25040,9 +25164,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Path, - query: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Query = .init(), - headers: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Headers = .init() + path: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Path, + query: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Query = .init(), + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Headers = .init() ) { self.path = path self.query = query @@ -25064,7 +25188,7 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Headers + public var headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Headers /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/responses/200/content/application\/json`. @@ -25083,15 +25207,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Body + public var body: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Headers = .init(), - body: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Body + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Body ) { self.headers = headers self.body = body @@ -25099,15 +25223,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok) + case ok(Operations.OrgsCustomPropertiesForReposGetOrganizationValues.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.OrgsListCustomPropertiesValuesForRepos.Output.Ok { + public var ok: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok { get throws { switch self { case let .ok(response): @@ -25122,7 +25246,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -25145,7 +25269,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -25211,9 +25335,9 @@ public enum Operations { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)`. - public enum OrgsCreateOrUpdateCustomPropertiesValuesForRepos { - public static let id: Swift.String = "orgs/create-or-update-custom-properties-values-for-repos" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)`. + public enum OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues { + public static let id: Swift.String = "orgs/custom-properties-for-repos-create-or-update-organization-values" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/path`. public struct Path: Sendable, Hashable { @@ -25229,19 +25353,19 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/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.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Headers /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody/json`. @@ -25272,9 +25396,9 @@ public enum Operations { } } /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Body.JsonPayload) + case json(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Body.JsonPayload) } - public var body: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -25282,9 +25406,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Body + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Body ) { self.path = path self.headers = headers @@ -25298,13 +25422,13 @@ public enum Operations { } /// No Content when custom property values are successfully created or updated /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output.NoContent) + case noContent(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output.NoContent) /// No Content when custom property values are successfully created or updated /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -25314,7 +25438,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output.NoContent { + public var noContent: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -25329,7 +25453,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -25352,7 +25476,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -25375,7 +25499,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) diff --git a/Sources/packages/Types.swift b/Sources/packages/Types.swift index 36747349f40..17bd9829232 100644 --- a/Sources/packages/Types.swift +++ b/Sources/packages/Types.swift @@ -2323,14 +2323,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The selected visibility of the packages. This parameter is optional and only filters an existing result set. /// /// The `internal` visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystems `internal` is synonymous with `private`. diff --git a/Sources/projects-classic/Types.swift b/Sources/projects-classic/Types.swift index 2ddc354a992..f93db3881e8 100644 --- a/Sources/projects-classic/Types.swift +++ b/Sources/projects-classic/Types.swift @@ -1302,6 +1302,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -1314,10 +1318,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/org`. public typealias Org = Swift.String - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String /// The unique identifier of the project. /// /// - Remark: Generated from `#/components/parameters/project-id`. diff --git a/Sources/projects/Client.swift b/Sources/projects/Client.swift index 3b8fa88a4b3..fb63d961271 100644 --- a/Sources/projects/Client.swift +++ b/Sources/projects/Client.swift @@ -1217,12 +1217,158 @@ public struct Client: APIProtocol { } ) } + /// List projects for user + /// + /// List all projects owned by a specific user accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsListForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2", + parameters: [ + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "q", + value: input.query.q + ) + 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: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsListForUser.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.ProjectsListForUser.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.ProjectsV2].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + 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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get project for user /// /// Get a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. public func projectsGetForUser(_ input: Operations.ProjectsGetForUser.Input) async throws -> Operations.ProjectsGetForUser.Output { try await client.send( input: input, @@ -1231,7 +1377,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber ] ) @@ -1340,8 +1486,8 @@ public struct Client: APIProtocol { /// /// List all fields for a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. public func projectsListFieldsForUser(_ input: Operations.ProjectsListFieldsForUser.Input) async throws -> Operations.ProjectsListFieldsForUser.Output { try await client.send( input: input, @@ -1350,7 +1496,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/fields", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber ] ) @@ -1480,8 +1626,8 @@ public struct Client: APIProtocol { /// /// Get a specific field for a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. public func projectsGetFieldForUser(_ input: Operations.ProjectsGetFieldForUser.Input) async throws -> Operations.ProjectsGetFieldForUser.Output { try await client.send( input: input, @@ -1490,7 +1636,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/fields/{}", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber, input.path.fieldId ] @@ -1600,8 +1746,8 @@ public struct Client: APIProtocol { /// /// List all items for a specific user-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. public func projectsListItemsForUser(_ input: Operations.ProjectsListItemsForUser.Input) async throws -> Operations.ProjectsListItemsForUser.Output { try await client.send( input: input, @@ -1610,7 +1756,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/items", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber ] ) @@ -1754,8 +1900,8 @@ public struct Client: APIProtocol { /// /// Add an issue or pull request item to the specified user owned project. /// - /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. public func projectsAddItemForUser(_ input: Operations.ProjectsAddItemForUser.Input) async throws -> Operations.ProjectsAddItemForUser.Output { try await client.send( input: input, @@ -1764,7 +1910,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/items", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber ] ) @@ -1874,8 +2020,8 @@ public struct Client: APIProtocol { /// /// Get a specific item from a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. public func projectsGetUserItem(_ input: Operations.ProjectsGetUserItem.Input) async throws -> Operations.ProjectsGetUserItem.Output { try await client.send( input: input, @@ -1884,7 +2030,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/items/{}", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber, input.path.itemId ] @@ -2001,8 +2147,8 @@ public struct Client: APIProtocol { /// /// Update a specific item in a user-owned project. /// - /// - Remark: HTTP `PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + /// - Remark: HTTP `PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. public func projectsUpdateItemForUser(_ input: Operations.ProjectsUpdateItemForUser.Input) async throws -> Operations.ProjectsUpdateItemForUser.Output { try await client.send( input: input, @@ -2011,7 +2157,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/items/{}", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber, input.path.itemId ] @@ -2164,8 +2310,8 @@ public struct Client: APIProtocol { /// /// Delete a specific item from a user-owned project. /// - /// - Remark: HTTP `DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. public func projectsDeleteItemForUser(_ input: Operations.ProjectsDeleteItemForUser.Input) async throws -> Operations.ProjectsDeleteItemForUser.Output { try await client.send( input: input, @@ -2174,7 +2320,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/items/{}", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber, input.path.itemId ] @@ -2250,150 +2396,4 @@ public struct Client: APIProtocol { } ) } - /// List projects for user - /// - /// List all projects owned by a specific user accessible by the authenticated user. - /// - /// - Remark: HTTP `GET /users/{username}/projectsV2`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. - public func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsListForUser.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/users/{}/projectsV2", - parameters: [ - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "q", - value: input.query.q - ) - 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: "per_page", - value: input.query.perPage - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.ProjectsListForUser.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.ProjectsListForUser.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.ProjectsV2].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - 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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } } diff --git a/Sources/projects/Types.swift b/Sources/projects/Types.swift index 548e41ea0a8..8c558f685ad 100644 --- a/Sources/projects/Types.swift +++ b/Sources/projects/Types.swift @@ -74,69 +74,69 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. func projectsDeleteItemForOrg(_ input: Operations.ProjectsDeleteItemForOrg.Input) async throws -> Operations.ProjectsDeleteItemForOrg.Output + /// List projects for user + /// + /// List all projects owned by a specific user accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output /// Get project for user /// /// Get a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. func projectsGetForUser(_ input: Operations.ProjectsGetForUser.Input) async throws -> Operations.ProjectsGetForUser.Output /// List project fields for user /// /// List all fields for a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. func projectsListFieldsForUser(_ input: Operations.ProjectsListFieldsForUser.Input) async throws -> Operations.ProjectsListFieldsForUser.Output /// Get project field for user /// /// Get a specific field for a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. func projectsGetFieldForUser(_ input: Operations.ProjectsGetFieldForUser.Input) async throws -> Operations.ProjectsGetFieldForUser.Output /// List items for a user owned project /// /// List all items for a specific user-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. func projectsListItemsForUser(_ input: Operations.ProjectsListItemsForUser.Input) async throws -> Operations.ProjectsListItemsForUser.Output /// Add item to user owned project /// /// Add an issue or pull request item to the specified user owned project. /// - /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. func projectsAddItemForUser(_ input: Operations.ProjectsAddItemForUser.Input) async throws -> Operations.ProjectsAddItemForUser.Output /// Get an item for a user owned project /// /// Get a specific item from a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. func projectsGetUserItem(_ input: Operations.ProjectsGetUserItem.Input) async throws -> Operations.ProjectsGetUserItem.Output /// Update project item for user /// /// Update a specific item in a user-owned project. /// - /// - Remark: HTTP `PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + /// - Remark: HTTP `PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. func projectsUpdateItemForUser(_ input: Operations.ProjectsUpdateItemForUser.Input) async throws -> Operations.ProjectsUpdateItemForUser.Output /// Delete project item for user /// /// Delete a specific item from a user-owned project. /// - /// - Remark: HTTP `DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. func projectsDeleteItemForUser(_ input: Operations.ProjectsDeleteItemForUser.Input) async throws -> Operations.ProjectsDeleteItemForUser.Output - /// List projects for user - /// - /// List all projects owned by a specific user accessible by the authenticated user. - /// - /// - Remark: HTTP `GET /users/{username}/projectsV2`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. - func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output } /// Convenience overloads for operation inputs. @@ -288,12 +288,29 @@ extension APIProtocol { headers: headers )) } + /// List projects for user + /// + /// List all projects owned by a specific user accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public func projectsListForUser( + path: Operations.ProjectsListForUser.Input.Path, + query: Operations.ProjectsListForUser.Input.Query = .init(), + headers: Operations.ProjectsListForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsListForUser.Output { + try await projectsListForUser(Operations.ProjectsListForUser.Input( + path: path, + query: query, + headers: headers + )) + } /// Get project for user /// /// Get a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. public func projectsGetForUser( path: Operations.ProjectsGetForUser.Input.Path, headers: Operations.ProjectsGetForUser.Input.Headers = .init() @@ -307,8 +324,8 @@ extension APIProtocol { /// /// List all fields for a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. public func projectsListFieldsForUser( path: Operations.ProjectsListFieldsForUser.Input.Path, query: Operations.ProjectsListFieldsForUser.Input.Query = .init(), @@ -324,8 +341,8 @@ extension APIProtocol { /// /// Get a specific field for a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. public func projectsGetFieldForUser( path: Operations.ProjectsGetFieldForUser.Input.Path, headers: Operations.ProjectsGetFieldForUser.Input.Headers = .init() @@ -339,8 +356,8 @@ extension APIProtocol { /// /// List all items for a specific user-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. public func projectsListItemsForUser( path: Operations.ProjectsListItemsForUser.Input.Path, query: Operations.ProjectsListItemsForUser.Input.Query = .init(), @@ -356,8 +373,8 @@ extension APIProtocol { /// /// Add an issue or pull request item to the specified user owned project. /// - /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. public func projectsAddItemForUser( path: Operations.ProjectsAddItemForUser.Input.Path, headers: Operations.ProjectsAddItemForUser.Input.Headers = .init(), @@ -373,8 +390,8 @@ extension APIProtocol { /// /// Get a specific item from a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. public func projectsGetUserItem( path: Operations.ProjectsGetUserItem.Input.Path, query: Operations.ProjectsGetUserItem.Input.Query = .init(), @@ -390,8 +407,8 @@ extension APIProtocol { /// /// Update a specific item in a user-owned project. /// - /// - Remark: HTTP `PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + /// - Remark: HTTP `PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. public func projectsUpdateItemForUser( path: Operations.ProjectsUpdateItemForUser.Input.Path, headers: Operations.ProjectsUpdateItemForUser.Input.Headers = .init(), @@ -407,8 +424,8 @@ extension APIProtocol { /// /// Delete a specific item from a user-owned project. /// - /// - Remark: HTTP `DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. public func projectsDeleteItemForUser( path: Operations.ProjectsDeleteItemForUser.Input.Path, headers: Operations.ProjectsDeleteItemForUser.Input.Headers = .init() @@ -418,23 +435,6 @@ extension APIProtocol { headers: headers )) } - /// List projects for user - /// - /// List all projects owned by a specific user accessible by the authenticated user. - /// - /// - Remark: HTTP `GET /users/{username}/projectsV2`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. - public func projectsListForUser( - path: Operations.ProjectsListForUser.Input.Path, - query: Operations.ProjectsListForUser.Input.Query = .init(), - headers: Operations.ProjectsListForUser.Input.Headers = .init() - ) async throws -> Operations.ProjectsListForUser.Output { - try await projectsListForUser(Operations.ProjectsListForUser.Input( - path: path, - query: query, - headers: headers - )) - } } /// Server URLs defined in the OpenAPI document. @@ -3032,6 +3032,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -3048,6 +3067,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -3061,7 +3083,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -3076,6 +3101,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -3091,6 +3119,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -3164,6 +3195,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -3182,6 +3232,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -3197,6 +3250,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -3212,6 +3268,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -3228,6 +3287,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -4653,14 +4715,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/per-page`. public typealias PerPage = Swift.Int - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The project's number. /// /// - Remark: Generated from `#/components/parameters/project-number`. @@ -4673,10 +4735,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/item-id`. public typealias ItemId = Swift.Int - /// The unique identifier of the user. - /// - /// - Remark: Generated from `#/components/parameters/user-id`. - public typealias UserId = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} @@ -7155,69 +7213,101 @@ public enum Operations { } } } - /// Get project for user + /// List projects for user /// - /// Get a specific user-owned project. + /// List all projects owned by a specific user accessible by the authenticated user. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)`. - public enum ProjectsGetForUser { - public static let id: Swift.String = "projects/get-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public enum ProjectsListForUser { + public static let id: Swift.String = "projects/list-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path`. public struct Path: Sendable, Hashable { - /// The project's number. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/path/project_number`. - public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the user. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/path/user_id`. - public var userId: Components.Parameters.UserId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: - /// - projectNumber: The project's number. - /// - userId: The unique identifier of the user. + /// - username: The handle for the GitHub user account. + public init(username: Components.Parameters.Username) { + self.username = username + } + } + public var path: Operations.ProjectsListForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query`. + public struct Query: Sendable, Hashable { + /// Limit results to projects of the specified type. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/q`. + public var q: 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 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}/projectsV2/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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}/projectsV2/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// 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}/projectsV2/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - q: Limit results to projects of the specified type. + /// - 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)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( - projectNumber: Components.Parameters.ProjectNumber, - userId: Components.Parameters.UserId + q: Swift.String? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil ) { - self.projectNumber = projectNumber - self.userId = userId + self.q = q + self.before = before + self.after = after + self.perPage = perPage } } - public var path: Operations.ProjectsGetForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/header`. + public var query: Operations.ProjectsListForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/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.ProjectsGetForUser.Input.Headers + public var headers: Operations.ProjectsListForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ProjectsGetForUser.Input.Path, - headers: Operations.ProjectsGetForUser.Input.Headers = .init() + path: Operations.ProjectsListForUser.Input.Path, + query: Operations.ProjectsListForUser.Input.Query = .init(), + headers: Operations.ProjectsListForUser.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/{user_id}/projectsV2/{project_number}/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -7228,16 +7318,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsGetForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/responses/200/content`. + public var headers: Operations.ProjectsListForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectsV2) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2]) /// 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.ProjectsV2 { + public var json: [Components.Schemas.ProjectsV2] { get throws { switch self { case let .json(body): @@ -7247,15 +7337,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsGetForUser.Output.Ok.Body + public var body: Operations.ProjectsListForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsGetForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsGetForUser.Output.Ok.Body + headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListForUser.Output.Ok.Body ) { self.headers = headers self.body = body @@ -7263,15 +7353,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetForUser.Output.Ok) + case ok(Operations.ProjectsListForUser.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.ProjectsGetForUser.Output.Ok { + public var ok: Operations.ProjectsListForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -7286,13 +7376,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -7317,7 +7407,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7340,7 +7430,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7392,103 +7482,69 @@ public enum Operations { } } } - /// List project fields for user + /// Get project for user /// - /// List all fields for a specific user-owned project. + /// Get a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. - public enum ProjectsListFieldsForUser { - public static let id: Swift.String = "projects/list-fields-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. + public enum ProjectsGetForUser { + public static let id: Swift.String = "projects/get-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the user. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/path/user_id`. - public var userId: Components.Parameters.UserId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. - /// - userId: The unique identifier of the user. + /// - username: The handle for the GitHub user account. public init( projectNumber: Components.Parameters.ProjectNumber, - userId: Components.Parameters.UserId + username: Components.Parameters.Username ) { self.projectNumber = projectNumber - self.userId = userId - } - } - public var path: Operations.ProjectsListFieldsForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/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/{user_id}/projectsV2/{project_number}/fields/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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/{user_id}/projectsV2/{project_number}/fields/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// 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/{user_id}/projectsV2/{project_number}/fields/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - 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( - perPage: Components.Parameters.PerPage? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil - ) { - self.perPage = perPage - self.before = before - self.after = after + self.username = username } } - public var query: Operations.ProjectsListFieldsForUser.Input.Query - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/header`. + public var path: Operations.ProjectsGetForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/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.ProjectsListFieldsForUser.Input.Headers + public var headers: Operations.ProjectsGetForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ProjectsListFieldsForUser.Input.Path, - query: Operations.ProjectsListFieldsForUser.Input.Query = .init(), - headers: Operations.ProjectsListFieldsForUser.Input.Headers = .init() + path: Operations.ProjectsGetForUser.Input.Path, + headers: Operations.ProjectsGetForUser.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/{user_id}/projectsV2/{project_number}/fields/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -7499,16 +7555,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/responses/200/content`. + public var headers: Operations.ProjectsGetForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectsV2Field]) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2) /// 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.ProjectsV2Field] { + public var json: Components.Schemas.ProjectsV2 { get throws { switch self { case let .json(body): @@ -7518,15 +7574,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListFieldsForUser.Output.Ok.Body + public var body: Operations.ProjectsGetForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsListFieldsForUser.Output.Ok.Body + headers: Operations.ProjectsGetForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetForUser.Output.Ok.Body ) { self.headers = headers self.body = body @@ -7534,15 +7590,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListFieldsForUser.Output.Ok) + case ok(Operations.ProjectsGetForUser.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.ProjectsListFieldsForUser.Output.Ok { + public var ok: Operations.ProjectsGetForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -7557,13 +7613,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -7588,7 +7644,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7611,7 +7667,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7663,76 +7719,103 @@ public enum Operations { } } } - /// Get project field for user + /// List project fields for user /// - /// Get a specific field for a user-owned project. + /// List all fields for a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. - public enum ProjectsGetFieldForUser { - public static let id: Swift.String = "projects/get-field-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + public enum ProjectsListFieldsForUser { + public static let id: Swift.String = "projects/list-fields-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the field. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/path/field_id`. - public var fieldId: Components.Parameters.FieldId - /// The unique identifier of the user. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/path/user_id`. - public var userId: Components.Parameters.UserId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. - /// - fieldId: The unique identifier of the field. - /// - userId: The unique identifier of the user. + /// - username: The handle for the GitHub user account. public init( projectNumber: Components.Parameters.ProjectNumber, - fieldId: Components.Parameters.FieldId, - userId: Components.Parameters.UserId + username: Components.Parameters.Username ) { self.projectNumber = projectNumber - self.fieldId = fieldId - self.userId = userId + self.username = username } } - public var path: Operations.ProjectsGetFieldForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/header`. + public var path: Operations.ProjectsListFieldsForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/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}/projectsV2/{project_number}/fields/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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}/projectsV2/{project_number}/fields/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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}/projectsV2/{project_number}/fields/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - 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( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after + } + } + public var query: Operations.ProjectsListFieldsForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/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.ProjectsGetFieldForUser.Input.Headers + public var headers: Operations.ProjectsListFieldsForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ProjectsGetFieldForUser.Input.Path, - headers: Operations.ProjectsGetFieldForUser.Input.Headers = .init() + path: Operations.ProjectsListFieldsForUser.Input.Path, + query: Operations.ProjectsListFieldsForUser.Input.Query = .init(), + headers: Operations.ProjectsListFieldsForUser.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/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -7743,16 +7826,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content`. + public var headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectsV2Field) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2Field]) /// 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.ProjectsV2Field { + public var json: [Components.Schemas.ProjectsV2Field] { get throws { switch self { case let .json(body): @@ -7762,15 +7845,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsGetFieldForUser.Output.Ok.Body + public var body: Operations.ProjectsListFieldsForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsGetFieldForUser.Output.Ok.Body + headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListFieldsForUser.Output.Ok.Body ) { self.headers = headers self.body = body @@ -7778,15 +7861,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetFieldForUser.Output.Ok) + case ok(Operations.ProjectsListFieldsForUser.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.ProjectsGetFieldForUser.Output.Ok { + public var ok: Operations.ProjectsListFieldsForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -7801,13 +7884,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -7832,7 +7915,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7855,7 +7938,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7907,117 +7990,76 @@ public enum Operations { } } } - /// List items for a user owned project + /// Get project field for user /// - /// List all items for a specific user-owned project accessible by the authenticated user. + /// Get a specific field for a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. - public enum ProjectsListItemsForUser { - public static let id: Swift.String = "projects/list-items-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + public enum ProjectsGetFieldForUser { + public static let id: Swift.String = "projects/get-field-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the user. + /// The unique identifier of the field. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/path/field_id`. + public var fieldId: Components.Parameters.FieldId + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/path/user_id`. - public var userId: Components.Parameters.UserId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. - /// - userId: The unique identifier of the user. + /// - fieldId: The unique identifier of the field. + /// - username: The handle for the GitHub user account. public init( projectNumber: Components.Parameters.ProjectNumber, - userId: Components.Parameters.UserId + fieldId: Components.Parameters.FieldId, + username: Components.Parameters.Username ) { self.projectNumber = projectNumber - self.userId = userId - } - } - public var path: Operations.ProjectsListItemsForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query`. - public struct Query: Sendable, Hashable { - /// 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/{user_id}/projectsV2/{project_number}/items/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// 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/{user_id}/projectsV2/{project_number}/items/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// 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/{user_id}/projectsV2/{project_number}/items/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query/q`. - public var q: Swift.String? - /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query/fields`. - public var fields: [Swift.String]? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - 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)." - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - q: Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. - /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. - public init( - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, - perPage: Components.Parameters.PerPage? = nil, - q: Swift.String? = nil, - fields: [Swift.String]? = nil - ) { - self.before = before - self.after = after - self.perPage = perPage - self.q = q - self.fields = fields + self.fieldId = fieldId + self.username = username } } - public var query: Operations.ProjectsListItemsForUser.Input.Query - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/header`. + public var path: Operations.ProjectsGetFieldForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/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.ProjectsListItemsForUser.Input.Headers + public var headers: Operations.ProjectsGetFieldForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ProjectsListItemsForUser.Input.Path, - query: Operations.ProjectsListItemsForUser.Input.Query = .init(), - headers: Operations.ProjectsListItemsForUser.Input.Headers = .init() + path: Operations.ProjectsGetFieldForUser.Input.Path, + headers: Operations.ProjectsGetFieldForUser.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/{user_id}/projectsV2/{project_number}/items/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -8028,16 +8070,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsListItemsForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/responses/200/content`. + public var headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectsV2ItemWithContent]) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2Field) /// 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.ProjectsV2ItemWithContent] { + public var json: Components.Schemas.ProjectsV2Field { get throws { switch self { case let .json(body): @@ -8047,15 +8089,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListItemsForUser.Output.Ok.Body + public var body: Operations.ProjectsGetFieldForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsListItemsForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsListItemsForUser.Output.Ok.Body + headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetFieldForUser.Output.Ok.Body ) { self.headers = headers self.body = body @@ -8063,15 +8105,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListItemsForUser.Output.Ok) + case ok(Operations.ProjectsGetFieldForUser.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.ProjectsListItemsForUser.Output.Ok { + public var ok: Operations.ProjectsGetFieldForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -8086,13 +8128,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -8117,7 +8159,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8140,7 +8182,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -8192,118 +8234,137 @@ public enum Operations { } } } - /// Add item to user owned project + /// List items for a user owned project /// - /// Add an issue or pull request item to the specified user owned project. + /// List all items for a specific user-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. - public enum ProjectsAddItemForUser { - public static let id: Swift.String = "projects/add-item-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + public enum ProjectsListItemsForUser { + public static let id: Swift.String = "projects/list-items-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the user. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/path/user_id`. - public var userId: Components.Parameters.UserId /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: - /// - userId: The unique identifier of the user. /// - projectNumber: The project's number. + /// - username: The handle for the GitHub user account. public init( - userId: Components.Parameters.UserId, - projectNumber: Components.Parameters.ProjectNumber + projectNumber: Components.Parameters.ProjectNumber, + username: Components.Parameters.Username ) { - self.userId = userId self.projectNumber = projectNumber + self.username = username } } - public var path: Operations.ProjectsAddItemForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/header`. + public var path: Operations.ProjectsListItemsForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query`. + public struct Query: Sendable, Hashable { + /// 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}/projectsV2/{project_number}/items/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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}/projectsV2/{project_number}/items/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// 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}/projectsV2/{project_number}/items/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/q`. + public var q: Swift.String? + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/fields`. + public var fields: [Swift.String]? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - 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)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - q: Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + public init( + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil, + q: Swift.String? = nil, + fields: [Swift.String]? = nil + ) { + self.before = before + self.after = after + self.perPage = perPage + self.q = q + self.fields = fields + } + } + public var query: Operations.ProjectsListItemsForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/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.ProjectsAddItemForUser.Input.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The type of item to add to the project. Must be either Issue or PullRequest. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/json/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case issue = "Issue" - case pullRequest = "PullRequest" - } - /// The type of item to add to the project. Must be either Issue or PullRequest. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/json/type`. - public var _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload - /// The numeric ID of the issue or pull request to add to the project. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/json/id`. - public var id: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - _type: The type of item to add to the project. Must be either Issue or PullRequest. - /// - id: The numeric ID of the issue or pull request to add to the project. - public init( - _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload, - id: Swift.Int - ) { - self._type = _type - self.id = id - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case id - } - } - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsAddItemForUser.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsAddItemForUser.Input.Body + public var headers: Operations.ProjectsListItemsForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ProjectsAddItemForUser.Input.Path, - headers: Operations.ProjectsAddItemForUser.Input.Headers = .init(), - body: Operations.ProjectsAddItemForUser.Input.Body + path: Operations.ProjectsListItemsForUser.Input.Path, + query: Operations.ProjectsListItemsForUser.Input.Query = .init(), + headers: Operations.ProjectsListItemsForUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/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.ProjectsListItemsForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/responses/201/content/application\/json`. - case json(Components.Schemas.ProjectsV2ItemSimple) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2ItemWithContent]) /// 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.ProjectsV2ItemSimple { + public var json: [Components.Schemas.ProjectsV2ItemWithContent] { get throws { switch self { case let .json(body): @@ -8313,33 +8374,38 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsAddItemForUser.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ProjectsListItemsForUser.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ProjectsAddItemForUser.Output.Created.Body) { + public init( + headers: Operations.ProjectsListItemsForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListItemsForUser.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/201`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsAddItemForUser.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListItemsForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ProjectsAddItemForUser.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListItemsForUser.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } @@ -8347,13 +8413,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -8378,7 +8444,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8401,7 +8467,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -8453,114 +8519,118 @@ public enum Operations { } } } - /// Get an item for a user owned project + /// Add item to user owned project /// - /// Get a specific item from a user-owned project. + /// Add an issue or pull request item to the specified user owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. - public enum ProjectsGetUserItem { - public static let id: Swift.String = "projects/get-user-item" + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + public enum ProjectsAddItemForUser { + public static let id: Swift.String = "projects/add-item-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/path`. public struct Path: Sendable, Hashable { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/path/username`. + public var username: Components.Parameters.Username /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the user. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/path/user_id`. - public var userId: Components.Parameters.UserId - /// The unique identifier of the project item. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/path/item_id`. - public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: + /// - username: The handle for the GitHub user account. /// - projectNumber: The project's number. - /// - userId: The unique identifier of the user. - /// - itemId: The unique identifier of the project item. public init( - projectNumber: Components.Parameters.ProjectNumber, - userId: Components.Parameters.UserId, - itemId: Components.Parameters.ItemId + username: Components.Parameters.Username, + projectNumber: Components.Parameters.ProjectNumber ) { + self.username = username self.projectNumber = projectNumber - self.userId = userId - self.itemId = itemId - } - } - public var path: Operations.ProjectsGetUserItem.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/query`. - public struct Query: Sendable, Hashable { - /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. - public var fields: [Swift.String]? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. - public init(fields: [Swift.String]? = nil) { - self.fields = fields } } - public var query: Operations.ProjectsGetUserItem.Input.Query - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/header`. + public var path: Operations.ProjectsAddItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/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.ProjectsGetUserItem.Input.Headers + public var headers: Operations.ProjectsAddItemForUser.Input.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The type of item to add to the project. Must be either Issue or PullRequest. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case issue = "Issue" + case pullRequest = "PullRequest" + } + /// The type of item to add to the project. Must be either Issue or PullRequest. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/type`. + public var _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload + /// The numeric ID of the issue or pull request to add to the project. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/id`. + public var id: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - _type: The type of item to add to the project. Must be either Issue or PullRequest. + /// - id: The numeric ID of the issue or pull request to add to the project. + public init( + _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload, + id: Swift.Int + ) { + self._type = _type + self.id = id + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case id + } + } + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsAddItemForUser.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsAddItemForUser.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ProjectsGetUserItem.Input.Path, - query: Operations.ProjectsGetUserItem.Input.Query = .init(), - headers: Operations.ProjectsGetUserItem.Input.Headers = .init() + path: Operations.ProjectsAddItemForUser.Input.Path, + headers: Operations.ProjectsAddItemForUser.Input.Headers = .init(), + body: Operations.ProjectsAddItemForUser.Input.Body ) { 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/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/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.ProjectsGetUserItem.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectsV2ItemWithContent) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemSimple) /// 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.ProjectsV2ItemWithContent { + public var json: Components.Schemas.ProjectsV2ItemSimple { get throws { switch self { case let .json(body): @@ -8570,38 +8640,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsGetUserItem.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ProjectsAddItemForUser.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsGetUserItem.Output.Ok.Headers = .init(), - body: Operations.ProjectsGetUserItem.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ProjectsAddItemForUser.Output.Created.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetUserItem.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ProjectsAddItemForUser.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsGetUserItem.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsAddItemForUser.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } @@ -8609,13 +8674,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -8640,7 +8705,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8663,7 +8728,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -8715,176 +8780,108 @@ public enum Operations { } } } - /// Update project item for user + /// Get an item for a user owned project /// - /// Update a specific item in a user-owned project. + /// Get a specific item from a user-owned project. /// - /// - Remark: HTTP `PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. - public enum ProjectsUpdateItemForUser { - public static let id: Swift.String = "projects/update-item-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + public enum ProjectsGetUserItem { + public static let id: Swift.String = "projects/get-user-item" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the user. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/path/user_id`. - public var userId: Components.Parameters.UserId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/path/username`. + public var username: Components.Parameters.Username /// The unique identifier of the project item. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/path/item_id`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/path/item_id`. public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. - /// - userId: The unique identifier of the user. + /// - username: The handle for the GitHub user account. /// - itemId: The unique identifier of the project item. public init( projectNumber: Components.Parameters.ProjectNumber, - userId: Components.Parameters.UserId, + username: Components.Parameters.Username, itemId: Components.Parameters.ItemId ) { self.projectNumber = projectNumber - self.userId = userId + self.username = username self.itemId = itemId } } - public var path: Operations.ProjectsUpdateItemForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/header`. + public var path: Operations.ProjectsGetUserItem.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. + public var fields: [Swift.String]? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + public init(fields: [Swift.String]? = nil) { + self.fields = fields + } + } + public var query: Operations.ProjectsGetUserItem.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/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.ProjectsUpdateItemForUser.Input.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload`. - public struct FieldsPayloadPayload: Codable, Hashable, Sendable { - /// The ID of the project field to update. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/id`. - public var id: Swift.Int - /// The new value for the field: - /// - For text, number, and date fields, provide the new value directly. - /// - For single select and iteration fields, provide the ID of the option or iteration. - /// - To clear the field, set this to null. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. - @frozen public enum ValuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case2`. - case case2(Swift.Double) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// The new value for the field: - /// - For text, number, and date fields, provide the new value directly. - /// - For single select and iteration fields, provide the ID of the option or iteration. - /// - To clear the field, set this to null. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. - public var value: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? - /// Creates a new `FieldsPayloadPayload`. - /// - /// - Parameters: - /// - id: The ID of the project field to update. - /// - value: The new value for the field: - public init( - id: Swift.Int, - value: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? = nil - ) { - self.id = id - self.value = value - } - public enum CodingKeys: String, CodingKey { - case id - case value - } - } - /// A list of field updates to apply. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. - public typealias FieldsPayload = [Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload] - /// A list of field updates to apply. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. - public var fields: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayload - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - fields: A list of field updates to apply. - public init(fields: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayload) { - self.fields = fields - } - public enum CodingKeys: String, CodingKey { - case fields - } - } - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsUpdateItemForUser.Input.Body + public var headers: Operations.ProjectsGetUserItem.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ProjectsUpdateItemForUser.Input.Path, - headers: Operations.ProjectsUpdateItemForUser.Input.Headers = .init(), - body: Operations.ProjectsUpdateItemForUser.Input.Body + path: Operations.ProjectsGetUserItem.Input.Path, + query: Operations.ProjectsGetUserItem.Input.Query = .init(), + headers: Operations.ProjectsGetUserItem.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/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/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.ProjectsGetUserItem.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content/application\/json`. case json(Components.Schemas.ProjectsV2ItemWithContent) /// The associated value of the enum case if `self` is `.json`. /// @@ -8900,26 +8897,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body + public var body: Operations.ProjectsGetUserItem.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body) { + public init( + headers: Operations.ProjectsGetUserItem.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetUserItem.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsUpdateItemForUser.Output.Ok) + case ok(Operations.ProjectsGetUserItem.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.ProjectsUpdateItemForUser.Output.Ok { + public var ok: Operations.ProjectsGetUserItem.Output.Ok { get throws { switch self { case let .ok(response): @@ -8932,24 +8934,32 @@ public enum Operations { } } } - /// Requires authentication + /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/304`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// 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.NotModified { get throws { switch self { - case let .unauthorized(response): + case let .notModified(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "notModified", response: self ) } @@ -8957,7 +8967,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8978,47 +8988,24 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. + /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/422`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/401`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .unprocessableContent(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "unauthorized", response: self ) } @@ -9055,102 +9042,241 @@ public enum Operations { } } } - /// Delete project item for user + /// Update project item for user /// - /// Delete a specific item from a user-owned project. + /// Update a specific item in a user-owned project. /// - /// - Remark: HTTP `DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. - public enum ProjectsDeleteItemForUser { - public static let id: Swift.String = "projects/delete-item-for-user" + /// - Remark: HTTP `PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + public enum ProjectsUpdateItemForUser { + public static let id: Swift.String = "projects/update-item-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the user. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/path/user_id`. - public var userId: Components.Parameters.UserId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/path/username`. + public var username: Components.Parameters.Username /// The unique identifier of the project item. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/path/item_id`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/path/item_id`. public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. - /// - userId: The unique identifier of the user. + /// - username: The handle for the GitHub user account. /// - itemId: The unique identifier of the project item. public init( projectNumber: Components.Parameters.ProjectNumber, - userId: Components.Parameters.UserId, + username: Components.Parameters.Username, itemId: Components.Parameters.ItemId ) { self.projectNumber = projectNumber - self.userId = userId + self.username = username self.itemId = itemId } } - public var path: Operations.ProjectsDeleteItemForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/header`. + public var path: Operations.ProjectsUpdateItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/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.ProjectsDeleteItemForUser.Input.Headers + public var headers: Operations.ProjectsUpdateItemForUser.Input.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload`. + public struct FieldsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the project field to update. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/id`. + public var id: Swift.Int + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case2`. + case case2(Swift.Double) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + public var value: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? + /// Creates a new `FieldsPayloadPayload`. + /// + /// - Parameters: + /// - id: The ID of the project field to update. + /// - value: The new value for the field: + public init( + id: Swift.Int, + value: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? = nil + ) { + self.id = id + self.value = value + } + public enum CodingKeys: String, CodingKey { + case id + case value + } + } + /// A list of field updates to apply. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public typealias FieldsPayload = [Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload] + /// A list of field updates to apply. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public var fields: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - fields: A list of field updates to apply. + public init(fields: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayload) { + self.fields = fields + } + public enum CodingKeys: String, CodingKey { + case fields + } + } + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsUpdateItemForUser.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ProjectsDeleteItemForUser.Input.Path, - headers: Operations.ProjectsDeleteItemForUser.Input.Headers = .init() + path: Operations.ProjectsUpdateItemForUser.Input.Path, + headers: Operations.ProjectsUpdateItemForUser.Input.Headers = .init(), + body: Operations.ProjectsUpdateItemForUser.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemWithContent) + /// 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.ProjectsV2ItemWithContent { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsDeleteItemForUser.Output.NoContent) - /// Response + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/200`. /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsUpdateItemForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsUpdateItemForUser.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - /// The associated value of the enum case if `self` is `.noContent`. + /// Requires authentication /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ProjectsDeleteItemForUser.Output.NoContent { + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// 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.RequiresAuthentication { get throws { switch self { - case let .noContent(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "unauthorized", response: self ) } @@ -9158,7 +9284,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -9179,24 +9305,47 @@ public enum Operations { } } } - /// Requires authentication + /// Resource not found /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/404`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unauthorized(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// 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.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -9233,193 +9382,102 @@ public enum Operations { } } } - /// List projects for user + /// Delete project item for user /// - /// List all projects owned by a specific user accessible by the authenticated user. + /// Delete a specific item from a user-owned project. /// - /// - Remark: HTTP `GET /users/{username}/projectsV2`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. - public enum ProjectsListForUser { - public static let id: Swift.String = "projects/list-for-user" + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + public enum ProjectsDeleteItemForUser { + public static let id: Swift.String = "projects/delete-item-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path`. public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/username`. public var username: Components.Parameters.Username + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/item_id`. + public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: + /// - projectNumber: The project's number. /// - username: The handle for the GitHub user account. - public init(username: Components.Parameters.Username) { - self.username = username - } - } - public var path: Operations.ProjectsListForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query`. - public struct Query: Sendable, Hashable { - /// Limit results to projects of the specified type. - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/q`. - public var q: 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 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}/projectsV2/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// 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}/projectsV2/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// 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}/projectsV2/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - q: Limit results to projects of the specified type. - /// - 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)." - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - itemId: The unique identifier of the project item. public init( - q: Swift.String? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, - perPage: Components.Parameters.PerPage? = nil + projectNumber: Components.Parameters.ProjectNumber, + username: Components.Parameters.Username, + itemId: Components.Parameters.ItemId ) { - self.q = q - self.before = before - self.after = after - self.perPage = perPage + self.projectNumber = projectNumber + self.username = username + self.itemId = itemId } } - public var query: Operations.ProjectsListForUser.Input.Query - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/header`. + public var path: Operations.ProjectsDeleteItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/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.ProjectsListForUser.Input.Headers + public var headers: Operations.ProjectsDeleteItemForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ProjectsListForUser.Input.Path, - query: Operations.ProjectsListForUser.Input.Query = .init(), - headers: Operations.ProjectsListForUser.Input.Headers = .init() + path: Operations.ProjectsDeleteItemForUser.Input.Path, + headers: Operations.ProjectsDeleteItemForUser.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}/projectsV2/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/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.ProjectsListForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectsV2]) - /// 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.ProjectsV2] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsListForUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsListForUser.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListForUser.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.ProjectsListForUser.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//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsDeleteItemForUser.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) } - /// The associated value of the enum case if `self` is `.notModified`. + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsDeleteItemForUser.Output.NoContent { get throws { switch self { - case let .notModified(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notModified", + expectedStatus: "noContent", response: self ) } @@ -9427,7 +9485,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -9450,7 +9508,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) diff --git a/Sources/pulls/Types.swift b/Sources/pulls/Types.swift index 1a700472b75..6cdfe0b457d 100644 --- a/Sources/pulls/Types.swift +++ b/Sources/pulls/Types.swift @@ -2633,6 +2633,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -2649,6 +2668,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -2662,7 +2684,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -2677,6 +2702,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -2692,6 +2720,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -2765,6 +2796,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -2783,6 +2833,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -2798,6 +2851,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -2813,6 +2869,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -2829,6 +2888,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -2878,6 +2940,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-simple/type`. + public var _type: Components.Schemas.TeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `TeamSimple`. /// /// - Parameters: @@ -2894,6 +2975,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -2907,7 +2991,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.TeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -2922,6 +3009,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -2937,6 +3027,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Hypermedia Link diff --git a/Sources/reactions/Types.swift b/Sources/reactions/Types.swift index b51f7cc81d0..c75c28d18df 100644 --- a/Sources/reactions/Types.swift +++ b/Sources/reactions/Types.swift @@ -1114,6 +1114,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias TeamSlug = Swift.String /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. @@ -1130,10 +1134,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/org`. public typealias Org = Swift.String - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias TeamSlug = Swift.String /// The number that identifies the discussion. /// /// - Remark: Generated from `#/components/parameters/discussion-number`. diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index 2eeb2872ecf..7ed008312a7 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -14473,11 +14473,11 @@ public struct Client: APIProtocol { /// Users with read access to the repository can use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)`. - public func reposGetCustomPropertiesValues(_ input: Operations.ReposGetCustomPropertiesValues.Input) async throws -> Operations.ReposGetCustomPropertiesValues.Output { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)`. + public func reposCustomPropertiesForReposGetRepositoryValues(_ input: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input) async throws -> Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output { try await client.send( input: input, - forOperation: Operations.ReposGetCustomPropertiesValues.id, + forOperation: Operations.ReposCustomPropertiesForReposGetRepositoryValues.id, serializer: { input in let path = try converter.renderedPath( template: "/repos/{}/{}/properties/values", @@ -14501,7 +14501,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReposGetCustomPropertiesValues.Output.Ok.Body + let body: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14585,11 +14585,11 @@ public struct Client: APIProtocol { /// Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)`. - public func reposCreateOrUpdateCustomPropertiesValues(_ input: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input) async throws -> Operations.ReposCreateOrUpdateCustomPropertiesValues.Output { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)`. + public func reposCustomPropertiesForReposCreateOrUpdateRepositoryValues(_ input: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input) async throws -> Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output { try await client.send( input: input, - forOperation: Operations.ReposCreateOrUpdateCustomPropertiesValues.id, + forOperation: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.id, serializer: { input in let path = try converter.renderedPath( template: "/repos/{}/{}/properties/values", diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 0d16e6b5958..acbf4cea006 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -1590,8 +1590,8 @@ public protocol APIProtocol: Sendable { /// Users with read access to the repository can use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)`. - func reposGetCustomPropertiesValues(_ input: Operations.ReposGetCustomPropertiesValues.Input) async throws -> Operations.ReposGetCustomPropertiesValues.Output + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)`. + func reposCustomPropertiesForReposGetRepositoryValues(_ input: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input) async throws -> Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output /// Create or update custom property values for a repository /// /// Create new or update existing custom property values for a repository. @@ -1600,8 +1600,8 @@ public protocol APIProtocol: Sendable { /// Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)`. - func reposCreateOrUpdateCustomPropertiesValues(_ input: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input) async throws -> Operations.ReposCreateOrUpdateCustomPropertiesValues.Output + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)`. + func reposCustomPropertiesForReposCreateOrUpdateRepositoryValues(_ input: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input) async throws -> Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output /// Get a repository README /// /// Gets the preferred README for a repository. @@ -4926,12 +4926,12 @@ extension APIProtocol { /// Users with read access to the repository can use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)`. - public func reposGetCustomPropertiesValues( - path: Operations.ReposGetCustomPropertiesValues.Input.Path, - headers: Operations.ReposGetCustomPropertiesValues.Input.Headers = .init() - ) async throws -> Operations.ReposGetCustomPropertiesValues.Output { - try await reposGetCustomPropertiesValues(Operations.ReposGetCustomPropertiesValues.Input( + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)`. + public func reposCustomPropertiesForReposGetRepositoryValues( + path: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Path, + headers: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Headers = .init() + ) async throws -> Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output { + try await reposCustomPropertiesForReposGetRepositoryValues(Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input( path: path, headers: headers )) @@ -4944,13 +4944,13 @@ extension APIProtocol { /// Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)`. - public func reposCreateOrUpdateCustomPropertiesValues( - path: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Path, - headers: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Headers = .init(), - body: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Body - ) async throws -> Operations.ReposCreateOrUpdateCustomPropertiesValues.Output { - try await reposCreateOrUpdateCustomPropertiesValues(Operations.ReposCreateOrUpdateCustomPropertiesValues.Input( + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)`. + public func reposCustomPropertiesForReposCreateOrUpdateRepositoryValues( + path: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Path, + headers: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Headers = .init(), + body: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Body + ) async throws -> Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output { + try await reposCustomPropertiesForReposCreateOrUpdateRepositoryValues(Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input( path: path, headers: headers, body: body @@ -9482,6 +9482,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -9498,6 +9517,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -9511,7 +9533,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -9526,6 +9551,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -9541,6 +9569,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -9614,6 +9645,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -9632,6 +9682,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -9647,6 +9700,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -9662,6 +9718,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -9678,6 +9737,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -13543,6 +13605,62 @@ public enum Components { case parameters } } + /// Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review`. + public struct RepositoryRuleCopilotCodeReview: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case copilotCodeReview = "copilot_code_review" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/type`. + public var _type: Components.Schemas.RepositoryRuleCopilotCodeReview._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// Copilot automatically reviews draft pull requests before they are marked as ready for review. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/parameters/review_draft_pull_requests`. + public var reviewDraftPullRequests: Swift.Bool? + /// Copilot automatically reviews each new push to the pull request. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/parameters/review_on_push`. + public var reviewOnPush: Swift.Bool? + /// Creates a new `ParametersPayload`. + /// + /// - Parameters: + /// - reviewDraftPullRequests: Copilot automatically reviews draft pull requests before they are marked as ready for review. + /// - reviewOnPush: Copilot automatically reviews each new push to the pull request. + public init( + reviewDraftPullRequests: Swift.Bool? = nil, + reviewOnPush: Swift.Bool? = nil + ) { + self.reviewDraftPullRequests = reviewDraftPullRequests + self.reviewOnPush = reviewOnPush + } + public enum CodingKeys: String, CodingKey { + case reviewDraftPullRequests = "review_draft_pull_requests" + case reviewOnPush = "review_on_push" + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/parameters`. + public var parameters: Components.Schemas.RepositoryRuleCopilotCodeReview.ParametersPayload? + /// Creates a new `RepositoryRuleCopilotCodeReview`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRuleCopilotCodeReview._TypePayload, + parameters: Components.Schemas.RepositoryRuleCopilotCodeReview.ParametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } /// A repository rule. /// /// - Remark: Generated from `#/components/schemas/repository-rule`. @@ -13589,6 +13707,8 @@ public enum Components { case RepositoryRuleWorkflows(Components.Schemas.RepositoryRuleWorkflows) /// - Remark: Generated from `#/components/schemas/repository-rule/case21`. case RepositoryRuleCodeScanning(Components.Schemas.RepositoryRuleCodeScanning) + /// - Remark: Generated from `#/components/schemas/repository-rule/case22`. + case RepositoryRuleCopilotCodeReview(Components.Schemas.RepositoryRuleCopilotCodeReview) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] do { @@ -13717,6 +13837,12 @@ public enum Components { } catch { errors.append(error) } + do { + self = .RepositoryRuleCopilotCodeReview(try .init(from: decoder)) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -13767,6 +13893,8 @@ public enum Components { try value.encode(to: encoder) case let .RepositoryRuleCodeScanning(value): try value.encode(to: encoder) + case let .RepositoryRuleCopilotCodeReview(value): + try value.encode(to: encoder) } } } @@ -22318,6 +22446,35 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case21`. case case21(Components.Schemas.RepositoryRuleDetailed.Case21Payload) + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22`. + public struct Case22Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22/value1`. + public var value1: Components.Schemas.RepositoryRuleCopilotCodeReview + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22/value2`. + public var value2: Components.Schemas.RepositoryRuleRulesetInfo + /// Creates a new `Case22Payload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.RepositoryRuleCopilotCodeReview, + value2: Components.Schemas.RepositoryRuleRulesetInfo + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22`. + case case22(Components.Schemas.RepositoryRuleDetailed.Case22Payload) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] do { @@ -22446,6 +22603,12 @@ public enum Components { } catch { errors.append(error) } + do { + self = .case22(try .init(from: decoder)) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -22496,6 +22659,8 @@ public enum Components { try value.encode(to: encoder) case let .case21(value): try value.encode(to: encoder) + case let .case22(value): + try value.encode(to: encoder) } } } @@ -22942,6 +23107,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. @@ -22958,10 +23127,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/org`. public typealias Org = Swift.String - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// /// - Remark: Generated from `#/components/parameters/hook-id`. @@ -54350,9 +54515,9 @@ public enum Operations { /// Users with read access to the repository can use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)`. - public enum ReposGetCustomPropertiesValues { - public static let id: Swift.String = "repos/get-custom-properties-values" + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)`. + public enum ReposCustomPropertiesForReposGetRepositoryValues { + public static let id: Swift.String = "repos/custom-properties-for-repos-get-repository-values" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/GET/path`. public struct Path: Sendable, Hashable { @@ -54377,27 +54542,27 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ReposGetCustomPropertiesValues.Input.Path + public var path: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Path /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/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.ReposGetCustomPropertiesValues.Input.Headers + public var headers: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ReposGetCustomPropertiesValues.Input.Path, - headers: Operations.ReposGetCustomPropertiesValues.Input.Headers = .init() + path: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Path, + headers: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -54423,26 +54588,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReposGetCustomPropertiesValues.Output.Ok.Body + public var body: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReposGetCustomPropertiesValues.Output.Ok.Body) { + public init(body: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReposGetCustomPropertiesValues.Output.Ok) + case ok(Operations.ReposCustomPropertiesForReposGetRepositoryValues.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.ReposGetCustomPropertiesValues.Output.Ok { + public var ok: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok { get throws { switch self { case let .ok(response): @@ -54457,7 +54622,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -54480,7 +54645,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -54540,9 +54705,9 @@ public enum Operations { /// Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)`. - public enum ReposCreateOrUpdateCustomPropertiesValues { - public static let id: Swift.String = "repos/create-or-update-custom-properties-values" + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)`. + public enum ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues { + public static let id: Swift.String = "repos/custom-properties-for-repos-create-or-update-repository-values" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/path`. public struct Path: Sendable, Hashable { @@ -54567,19 +54732,19 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Path + public var path: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Path /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/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.ReposCreateOrUpdateCustomPropertiesValues.Input.Headers + public var headers: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Headers /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/requestBody/json`. @@ -54600,9 +54765,9 @@ public enum Operations { } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/requestBody/content/application\/json`. - case json(Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Body.JsonPayload) + case json(Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Body.JsonPayload) } - public var body: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Body + public var body: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -54610,9 +54775,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Path, - headers: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Headers = .init(), - body: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Body + path: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Path, + headers: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Headers = .init(), + body: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Body ) { self.path = path self.headers = headers @@ -54626,13 +54791,13 @@ public enum Operations { } /// No Content when custom property values are successfully created or updated /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ReposCreateOrUpdateCustomPropertiesValues.Output.NoContent) + case noContent(Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output.NoContent) /// No Content when custom property values are successfully created or updated /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -54642,7 +54807,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ReposCreateOrUpdateCustomPropertiesValues.Output.NoContent { + public var noContent: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -54657,7 +54822,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -54680,7 +54845,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -54703,7 +54868,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) diff --git a/Sources/search/Client.swift b/Sources/search/Client.swift index 95c2694c627..80609104bda 100644 --- a/Sources/search/Client.swift +++ b/Sources/search/Client.swift @@ -393,6 +393,13 @@ public struct Client: APIProtocol { name: "advanced_search", value: input.query.advancedSearch ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "search_type", + value: input.query.searchType + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index d3d33af1bb2..3c2ac0f8165 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -5255,6 +5255,12 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/issues-advanced-search`. public typealias IssuesAdvancedSearch = Swift.String + /// The type of search to perform. Set to `semantic` to perform a semantic search. + /// + /// - Remark: Generated from `#/components/parameters/search-type`. + @frozen public enum SearchType: String, Codable, Hashable, Sendable, CaseIterable { + case semantic = "semantic" + } } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} @@ -6029,6 +6035,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/search/issues/GET/query/advanced_search`. public var advancedSearch: Components.Parameters.IssuesAdvancedSearch? + /// - Remark: Generated from `#/components/parameters/search-type`. + @frozen public enum SearchType: String, Codable, Hashable, Sendable, CaseIterable { + case semantic = "semantic" + } + /// The type of search to perform. Set to `semantic` to perform a semantic search. + /// + /// - Remark: Generated from `#/paths/search/issues/GET/query/search_type`. + public var searchType: Components.Parameters.SearchType? /// Creates a new `Query`. /// /// - Parameters: @@ -6038,13 +6052,15 @@ public enum Operations { /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - advancedSearch: Set to `true` to use advanced search. + /// - searchType: The type of search to perform. Set to `semantic` to perform a semantic search. public init( q: Swift.String, sort: Operations.SearchIssuesAndPullRequests.Input.Query.SortPayload? = nil, order: Components.Parameters.Order? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil, - advancedSearch: Components.Parameters.IssuesAdvancedSearch? = nil + advancedSearch: Components.Parameters.IssuesAdvancedSearch? = nil, + searchType: Components.Parameters.SearchType? = nil ) { self.q = q self.sort = sort @@ -6052,6 +6068,7 @@ public enum Operations { self.perPage = perPage self.page = page self.advancedSearch = advancedSearch + self.searchType = searchType } } public var query: Operations.SearchIssuesAndPullRequests.Input.Query diff --git a/Sources/security-advisories/Types.swift b/Sources/security-advisories/Types.swift index be06d58ef2b..e428d2d54cc 100644 --- a/Sources/security-advisories/Types.swift +++ b/Sources/security-advisories/Types.swift @@ -2982,6 +2982,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -2998,6 +3017,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -3011,7 +3033,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -3026,6 +3051,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -3041,6 +3069,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -3114,6 +3145,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -3132,6 +3182,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -3147,6 +3200,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -3162,6 +3218,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -3178,6 +3237,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } diff --git a/Sources/teams/Types.swift b/Sources/teams/Types.swift index 4cf5f13b32f..dff5ebdce80 100644 --- a/Sources/teams/Types.swift +++ b/Sources/teams/Types.swift @@ -3513,6 +3513,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -3529,6 +3548,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -3542,7 +3564,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -3557,6 +3582,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -3572,6 +3600,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -3645,6 +3676,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -3663,6 +3713,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -3678,6 +3731,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -3693,6 +3749,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -3709,6 +3768,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -4145,6 +4207,10 @@ public enum Components { case archivedAt = "archived_at" } } + /// The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. + /// + /// - Remark: Generated from `#/components/schemas/ldap-dn`. + public typealias LdapDn = Swift.String /// Groups of organization members that gives permissions on specified repositories. /// /// - Remark: Generated from `#/components/schemas/team-full`. @@ -4211,10 +4277,27 @@ public enum Components { public var updatedAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/team-full/organization`. public var organization: Components.Schemas.TeamOrganization - /// Distinguished Name (DN) that team maps to within LDAP environment - /// /// - Remark: Generated from `#/components/schemas/team-full/ldap_dn`. - public var ldapDn: Swift.String? + public var ldapDn: Components.Schemas.LdapDn? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-full/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-full/type`. + public var _type: Components.Schemas.TeamFull._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-full/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-full/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `TeamFull`. /// /// - Parameters: @@ -4236,7 +4319,10 @@ public enum Components { /// - createdAt: /// - updatedAt: /// - organization: - /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - ldapDn: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -4256,7 +4342,10 @@ public enum Components { createdAt: Foundation.Date, updatedAt: Foundation.Date, organization: Components.Schemas.TeamOrganization, - ldapDn: Swift.String? = nil + ldapDn: Components.Schemas.LdapDn? = nil, + _type: Components.Schemas.TeamFull._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -4277,6 +4366,9 @@ public enum Components { self.updatedAt = updatedAt self.organization = organization self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -4298,6 +4390,9 @@ public enum Components { case updatedAt = "updated_at" case organization case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// A team discussion is a persistent record of a free-form conversation within a team. @@ -5365,6 +5460,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias TeamSlug = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -5377,14 +5480,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/org`. public typealias Org = Swift.String - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias TeamSlug = Swift.String /// The number that identifies the discussion. /// /// - Remark: Generated from `#/components/parameters/discussion-number`. diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index 15e04d2297d..6d4706ad01a 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -2834,14 +2834,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// account_id parameter - /// - /// - Remark: Generated from `#/components/parameters/account-id`. - public typealias AccountId = Swift.Int /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. public typealias Username = Swift.String + /// account_id parameter + /// + /// - Remark: Generated from `#/components/parameters/account-id`. + public typealias AccountId = Swift.Int /// A user ID. Only return users with an ID greater than this ID. /// /// - Remark: Generated from `#/components/parameters/since-user`. diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index b27d92b4094..44dd20c107c 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit b27d92b4094f9c4c6c60680325830982f04e5449 +Subproject commit 44dd20c107ca46d1dbcaf4aa522d9039e96e631c