Skip to content

Commit 98b0017

Browse files
Commit via running ake Sources/repos
1 parent a2de071 commit 98b0017

File tree

2 files changed

+2021
-783
lines changed

2 files changed

+2021
-783
lines changed

Sources/repos/Client.swift

Lines changed: 261 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,6 +1849,13 @@ public struct Client: APIProtocol {
18491849
name: "after",
18501850
value: input.query.after
18511851
)
1852+
try converter.setQueryItemAsURI(
1853+
in: &request,
1854+
style: .form,
1855+
explode: true,
1856+
name: "predicate_type",
1857+
value: input.query.predicate_type
1858+
)
18521859
converter.setAcceptHeader(
18531860
in: &request.headerFields,
18541861
contentTypes: input.headers.accept
@@ -2222,9 +2229,9 @@ public struct Client: APIProtocol {
22222229
}
22232230
)
22242231
}
2225-
/// Check if automated security fixes are enabled for a repository
2232+
/// Check if Dependabot security updates are enabled for a repository
22262233
///
2227-
/// Shows whether automated security fixes are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)".
2234+
/// Shows whether Dependabot security updates are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)".
22282235
///
22292236
/// - Remark: HTTP `GET /repos/{owner}/{repo}/automated-security-fixes`.
22302237
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/get(repos/check-automated-security-fixes)`.
@@ -2289,9 +2296,9 @@ public struct Client: APIProtocol {
22892296
}
22902297
)
22912298
}
2292-
/// Enable automated security fixes
2299+
/// Enable Dependabot security updates
22932300
///
2294-
/// Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)".
2301+
/// Enables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)".
22952302
///
22962303
/// - Remark: HTTP `PUT /repos/{owner}/{repo}/automated-security-fixes`.
22972304
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/put(repos/enable-automated-security-fixes)`.
@@ -2330,9 +2337,9 @@ public struct Client: APIProtocol {
23302337
}
23312338
)
23322339
}
2333-
/// Disable automated security fixes
2340+
/// Disable Dependabot security updates
23342341
///
2335-
/// Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)".
2342+
/// Disables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)".
23362343
///
23372344
/// - Remark: HTTP `DELETE /repos/{owner}/{repo}/automated-security-fixes`.
23382345
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/delete(repos/disable-automated-security-fixes)`.
@@ -6195,8 +6202,8 @@ public struct Client: APIProtocol {
61956202
/// To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal.
61966203
///
61976204
/// This endpoint also:
6198-
/// - Cancels any outstanding invitations
6199-
/// - Unasigns the user from any issues
6205+
/// - Cancels any outstanding invitations sent by the collaborator
6206+
/// - Unassigns the user from any issues
62006207
/// - Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories.
62016208
/// - Unstars the repository
62026209
/// - Updates access permissions to packages
@@ -7353,7 +7360,7 @@ public struct Client: APIProtocol {
73537360
}
73547361
/// List pull requests associated with a commit
73557362
///
7356-
/// Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit.
7363+
/// Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, it will return merged and open pull requests associated with the commit.
73577364
///
73587365
/// To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name.
73597366
///
@@ -10428,7 +10435,7 @@ public struct Client: APIProtocol {
1042810435
///
1042910436
/// The authenticated user must have admin or owner permissions to the repository to use this endpoint.
1043010437
///
10431-
/// For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app).
10438+
/// For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app), as well as the [guide to creating custom deployment protection rules](https://docs.github.com/actions/managing-workflow-runs-and-deployments/managing-deployments/creating-custom-deployment-protection-rules).
1043210439
///
1043310440
/// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
1043410441
///
@@ -16957,6 +16964,241 @@ public struct Client: APIProtocol {
1695716964
}
1695816965
)
1695916966
}
16967+
/// Get repository ruleset history
16968+
///
16969+
/// Get the history of a repository ruleset.
16970+
///
16971+
/// - Remark: HTTP `GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history`.
16972+
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/get(repos/get-repo-ruleset-history)`.
16973+
public func repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history(_ input: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Input) async throws -> Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Output {
16974+
try await client.send(
16975+
input: input,
16976+
forOperation: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.id,
16977+
serializer: { input in
16978+
let path = try converter.renderedPath(
16979+
template: "/repos/{}/{}/rulesets/{}/history",
16980+
parameters: [
16981+
input.path.owner,
16982+
input.path.repo,
16983+
input.path.ruleset_id
16984+
]
16985+
)
16986+
var request: HTTPTypes.HTTPRequest = .init(
16987+
soar_path: path,
16988+
method: .get
16989+
)
16990+
suppressMutabilityWarning(&request)
16991+
try converter.setQueryItemAsURI(
16992+
in: &request,
16993+
style: .form,
16994+
explode: true,
16995+
name: "per_page",
16996+
value: input.query.per_page
16997+
)
16998+
try converter.setQueryItemAsURI(
16999+
in: &request,
17000+
style: .form,
17001+
explode: true,
17002+
name: "page",
17003+
value: input.query.page
17004+
)
17005+
converter.setAcceptHeader(
17006+
in: &request.headerFields,
17007+
contentTypes: input.headers.accept
17008+
)
17009+
return (request, nil)
17010+
},
17011+
deserializer: { response, responseBody in
17012+
switch response.status.code {
17013+
case 200:
17014+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
17015+
let body: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Output.Ok.Body
17016+
let chosenContentType = try converter.bestContentType(
17017+
received: contentType,
17018+
options: [
17019+
"application/json"
17020+
]
17021+
)
17022+
switch chosenContentType {
17023+
case "application/json":
17024+
body = try await converter.getResponseBodyAsJSON(
17025+
[Components.Schemas.ruleset_hyphen_version].self,
17026+
from: responseBody,
17027+
transforming: { value in
17028+
.json(value)
17029+
}
17030+
)
17031+
default:
17032+
preconditionFailure("bestContentType chose an invalid content type.")
17033+
}
17034+
return .ok(.init(body: body))
17035+
case 404:
17036+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
17037+
let body: Components.Responses.not_found.Body
17038+
let chosenContentType = try converter.bestContentType(
17039+
received: contentType,
17040+
options: [
17041+
"application/json"
17042+
]
17043+
)
17044+
switch chosenContentType {
17045+
case "application/json":
17046+
body = try await converter.getResponseBodyAsJSON(
17047+
Components.Schemas.basic_hyphen_error.self,
17048+
from: responseBody,
17049+
transforming: { value in
17050+
.json(value)
17051+
}
17052+
)
17053+
default:
17054+
preconditionFailure("bestContentType chose an invalid content type.")
17055+
}
17056+
return .notFound(.init(body: body))
17057+
case 500:
17058+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
17059+
let body: Components.Responses.internal_error.Body
17060+
let chosenContentType = try converter.bestContentType(
17061+
received: contentType,
17062+
options: [
17063+
"application/json"
17064+
]
17065+
)
17066+
switch chosenContentType {
17067+
case "application/json":
17068+
body = try await converter.getResponseBodyAsJSON(
17069+
Components.Schemas.basic_hyphen_error.self,
17070+
from: responseBody,
17071+
transforming: { value in
17072+
.json(value)
17073+
}
17074+
)
17075+
default:
17076+
preconditionFailure("bestContentType chose an invalid content type.")
17077+
}
17078+
return .internalServerError(.init(body: body))
17079+
default:
17080+
return .undocumented(
17081+
statusCode: response.status.code,
17082+
.init(
17083+
headerFields: response.headerFields,
17084+
body: responseBody
17085+
)
17086+
)
17087+
}
17088+
}
17089+
)
17090+
}
17091+
/// Get repository ruleset version
17092+
///
17093+
/// Get a version of a repository ruleset.
17094+
///
17095+
/// - Remark: HTTP `GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}`.
17096+
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/get(repos/get-repo-ruleset-version)`.
17097+
public func repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version(_ input: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Input) async throws -> Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Output {
17098+
try await client.send(
17099+
input: input,
17100+
forOperation: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.id,
17101+
serializer: { input in
17102+
let path = try converter.renderedPath(
17103+
template: "/repos/{}/{}/rulesets/{}/history/{}",
17104+
parameters: [
17105+
input.path.owner,
17106+
input.path.repo,
17107+
input.path.ruleset_id,
17108+
input.path.version_id
17109+
]
17110+
)
17111+
var request: HTTPTypes.HTTPRequest = .init(
17112+
soar_path: path,
17113+
method: .get
17114+
)
17115+
suppressMutabilityWarning(&request)
17116+
converter.setAcceptHeader(
17117+
in: &request.headerFields,
17118+
contentTypes: input.headers.accept
17119+
)
17120+
return (request, nil)
17121+
},
17122+
deserializer: { response, responseBody in
17123+
switch response.status.code {
17124+
case 200:
17125+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
17126+
let body: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Output.Ok.Body
17127+
let chosenContentType = try converter.bestContentType(
17128+
received: contentType,
17129+
options: [
17130+
"application/json"
17131+
]
17132+
)
17133+
switch chosenContentType {
17134+
case "application/json":
17135+
body = try await converter.getResponseBodyAsJSON(
17136+
Components.Schemas.ruleset_hyphen_version_hyphen_with_hyphen_state.self,
17137+
from: responseBody,
17138+
transforming: { value in
17139+
.json(value)
17140+
}
17141+
)
17142+
default:
17143+
preconditionFailure("bestContentType chose an invalid content type.")
17144+
}
17145+
return .ok(.init(body: body))
17146+
case 404:
17147+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
17148+
let body: Components.Responses.not_found.Body
17149+
let chosenContentType = try converter.bestContentType(
17150+
received: contentType,
17151+
options: [
17152+
"application/json"
17153+
]
17154+
)
17155+
switch chosenContentType {
17156+
case "application/json":
17157+
body = try await converter.getResponseBodyAsJSON(
17158+
Components.Schemas.basic_hyphen_error.self,
17159+
from: responseBody,
17160+
transforming: { value in
17161+
.json(value)
17162+
}
17163+
)
17164+
default:
17165+
preconditionFailure("bestContentType chose an invalid content type.")
17166+
}
17167+
return .notFound(.init(body: body))
17168+
case 500:
17169+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
17170+
let body: Components.Responses.internal_error.Body
17171+
let chosenContentType = try converter.bestContentType(
17172+
received: contentType,
17173+
options: [
17174+
"application/json"
17175+
]
17176+
)
17177+
switch chosenContentType {
17178+
case "application/json":
17179+
body = try await converter.getResponseBodyAsJSON(
17180+
Components.Schemas.basic_hyphen_error.self,
17181+
from: responseBody,
17182+
transforming: { value in
17183+
.json(value)
17184+
}
17185+
)
17186+
default:
17187+
preconditionFailure("bestContentType chose an invalid content type.")
17188+
}
17189+
return .internalServerError(.init(body: body))
17190+
default:
17191+
return .undocumented(
17192+
statusCode: response.status.code,
17193+
.init(
17194+
headerFields: response.headerFields,
17195+
body: responseBody
17196+
)
17197+
)
17198+
}
17199+
}
17200+
)
17201+
}
1696017202
/// Get the weekly commit activity
1696117203
///
1696217204
/// Returns a weekly aggregate of the number of additions and deletions pushed to a repository.
@@ -19189,6 +19431,11 @@ public struct Client: APIProtocol {
1918919431
deserializer: { response, responseBody in
1919019432
switch response.status.code {
1919119433
case 200:
19434+
let headers: Operations.repos_sol_list_hyphen_for_hyphen_authenticated_hyphen_user.Output.Ok.Headers = .init(Link: try converter.getOptionalHeaderFieldAsURI(
19435+
in: response.headerFields,
19436+
name: "Link",
19437+
as: Components.Headers.link.self
19438+
))
1919219439
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1919319440
let body: Operations.repos_sol_list_hyphen_for_hyphen_authenticated_hyphen_user.Output.Ok.Body
1919419441
let chosenContentType = try converter.bestContentType(
@@ -19209,7 +19456,10 @@ public struct Client: APIProtocol {
1920919456
default:
1921019457
preconditionFailure("bestContentType chose an invalid content type.")
1921119458
}
19212-
return .ok(.init(body: body))
19459+
return .ok(.init(
19460+
headers: headers,
19461+
body: body
19462+
))
1921319463
case 422:
1921419464
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1921519465
let body: Components.Responses.validation_failed.Body

0 commit comments

Comments
 (0)