Skip to content

Commit 7be64e1

Browse files
Commit via running: make Sources/pulls
1 parent b376f9e commit 7be64e1

2 files changed

Lines changed: 0 additions & 686 deletions

File tree

Sources/pulls/Client.swift

Lines changed: 0 additions & 228 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,234 +1003,6 @@ public struct Client: APIProtocol {
10031003
}
10041004
)
10051005
}
1006-
/// Archive a pull request
1007-
///
1008-
/// Archives a pull request. Closes, locks, and marks the pull request as archived.
1009-
/// Only repository admins can archive pull requests.
1010-
/// Archived pull requests are hidden from non-admin users.
1011-
///
1012-
/// - Remark: HTTP `PUT /repos/{owner}/{repo}/pulls/{pull_number}/archive`.
1013-
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/put(pulls/archive)`.
1014-
public func pullsArchive(_ input: Operations.PullsArchive.Input) async throws -> Operations.PullsArchive.Output {
1015-
try await client.send(
1016-
input: input,
1017-
forOperation: Operations.PullsArchive.id,
1018-
serializer: { input in
1019-
let path = try converter.renderedPath(
1020-
template: "/repos/{}/{}/pulls/{}/archive",
1021-
parameters: [
1022-
input.path.owner,
1023-
input.path.repo,
1024-
input.path.pullNumber
1025-
]
1026-
)
1027-
var request: HTTPTypes.HTTPRequest = .init(
1028-
soar_path: path,
1029-
method: .put
1030-
)
1031-
suppressMutabilityWarning(&request)
1032-
converter.setAcceptHeader(
1033-
in: &request.headerFields,
1034-
contentTypes: input.headers.accept
1035-
)
1036-
return (request, nil)
1037-
},
1038-
deserializer: { response, responseBody in
1039-
switch response.status.code {
1040-
case 204:
1041-
return .noContent(.init())
1042-
case 403:
1043-
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1044-
let body: Components.Responses.Forbidden.Body
1045-
let chosenContentType = try converter.bestContentType(
1046-
received: contentType,
1047-
options: [
1048-
"application/json"
1049-
]
1050-
)
1051-
switch chosenContentType {
1052-
case "application/json":
1053-
body = try await converter.getResponseBodyAsJSON(
1054-
Components.Schemas.BasicError.self,
1055-
from: responseBody,
1056-
transforming: { value in
1057-
.json(value)
1058-
}
1059-
)
1060-
default:
1061-
preconditionFailure("bestContentType chose an invalid content type.")
1062-
}
1063-
return .forbidden(.init(body: body))
1064-
case 404:
1065-
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1066-
let body: Components.Responses.NotFound.Body
1067-
let chosenContentType = try converter.bestContentType(
1068-
received: contentType,
1069-
options: [
1070-
"application/json"
1071-
]
1072-
)
1073-
switch chosenContentType {
1074-
case "application/json":
1075-
body = try await converter.getResponseBodyAsJSON(
1076-
Components.Schemas.BasicError.self,
1077-
from: responseBody,
1078-
transforming: { value in
1079-
.json(value)
1080-
}
1081-
)
1082-
default:
1083-
preconditionFailure("bestContentType chose an invalid content type.")
1084-
}
1085-
return .notFound(.init(body: body))
1086-
case 422:
1087-
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1088-
let body: Components.Responses.ValidationFailed.Body
1089-
let chosenContentType = try converter.bestContentType(
1090-
received: contentType,
1091-
options: [
1092-
"application/json"
1093-
]
1094-
)
1095-
switch chosenContentType {
1096-
case "application/json":
1097-
body = try await converter.getResponseBodyAsJSON(
1098-
Components.Schemas.ValidationError.self,
1099-
from: responseBody,
1100-
transforming: { value in
1101-
.json(value)
1102-
}
1103-
)
1104-
default:
1105-
preconditionFailure("bestContentType chose an invalid content type.")
1106-
}
1107-
return .unprocessableContent(.init(body: body))
1108-
default:
1109-
return .undocumented(
1110-
statusCode: response.status.code,
1111-
.init(
1112-
headerFields: response.headerFields,
1113-
body: responseBody
1114-
)
1115-
)
1116-
}
1117-
}
1118-
)
1119-
}
1120-
/// Unarchive a pull request
1121-
///
1122-
/// Unarchives a pull request. Removes the archived flag from the pull request.
1123-
/// Does not automatically reopen or unlock the pull request.
1124-
/// Only repository admins can unarchive pull requests.
1125-
///
1126-
/// - Remark: HTTP `DELETE /repos/{owner}/{repo}/pulls/{pull_number}/archive`.
1127-
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/delete(pulls/unarchive)`.
1128-
public func pullsUnarchive(_ input: Operations.PullsUnarchive.Input) async throws -> Operations.PullsUnarchive.Output {
1129-
try await client.send(
1130-
input: input,
1131-
forOperation: Operations.PullsUnarchive.id,
1132-
serializer: { input in
1133-
let path = try converter.renderedPath(
1134-
template: "/repos/{}/{}/pulls/{}/archive",
1135-
parameters: [
1136-
input.path.owner,
1137-
input.path.repo,
1138-
input.path.pullNumber
1139-
]
1140-
)
1141-
var request: HTTPTypes.HTTPRequest = .init(
1142-
soar_path: path,
1143-
method: .delete
1144-
)
1145-
suppressMutabilityWarning(&request)
1146-
converter.setAcceptHeader(
1147-
in: &request.headerFields,
1148-
contentTypes: input.headers.accept
1149-
)
1150-
return (request, nil)
1151-
},
1152-
deserializer: { response, responseBody in
1153-
switch response.status.code {
1154-
case 204:
1155-
return .noContent(.init())
1156-
case 403:
1157-
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1158-
let body: Components.Responses.Forbidden.Body
1159-
let chosenContentType = try converter.bestContentType(
1160-
received: contentType,
1161-
options: [
1162-
"application/json"
1163-
]
1164-
)
1165-
switch chosenContentType {
1166-
case "application/json":
1167-
body = try await converter.getResponseBodyAsJSON(
1168-
Components.Schemas.BasicError.self,
1169-
from: responseBody,
1170-
transforming: { value in
1171-
.json(value)
1172-
}
1173-
)
1174-
default:
1175-
preconditionFailure("bestContentType chose an invalid content type.")
1176-
}
1177-
return .forbidden(.init(body: body))
1178-
case 404:
1179-
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1180-
let body: Components.Responses.NotFound.Body
1181-
let chosenContentType = try converter.bestContentType(
1182-
received: contentType,
1183-
options: [
1184-
"application/json"
1185-
]
1186-
)
1187-
switch chosenContentType {
1188-
case "application/json":
1189-
body = try await converter.getResponseBodyAsJSON(
1190-
Components.Schemas.BasicError.self,
1191-
from: responseBody,
1192-
transforming: { value in
1193-
.json(value)
1194-
}
1195-
)
1196-
default:
1197-
preconditionFailure("bestContentType chose an invalid content type.")
1198-
}
1199-
return .notFound(.init(body: body))
1200-
case 422:
1201-
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1202-
let body: Components.Responses.ValidationFailed.Body
1203-
let chosenContentType = try converter.bestContentType(
1204-
received: contentType,
1205-
options: [
1206-
"application/json"
1207-
]
1208-
)
1209-
switch chosenContentType {
1210-
case "application/json":
1211-
body = try await converter.getResponseBodyAsJSON(
1212-
Components.Schemas.ValidationError.self,
1213-
from: responseBody,
1214-
transforming: { value in
1215-
.json(value)
1216-
}
1217-
)
1218-
default:
1219-
preconditionFailure("bestContentType chose an invalid content type.")
1220-
}
1221-
return .unprocessableContent(.init(body: body))
1222-
default:
1223-
return .undocumented(
1224-
statusCode: response.status.code,
1225-
.init(
1226-
headerFields: response.headerFields,
1227-
body: responseBody
1228-
)
1229-
)
1230-
}
1231-
}
1232-
)
1233-
}
12341006
/// List review comments on a pull request
12351007
///
12361008
/// Lists all review comments for a specified pull request. By default, review comments

0 commit comments

Comments
 (0)