8000 Improve handling of paid developer accounts by kabiroberai · Pull Request #20 · xtool-org/xtool · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improve handling of paid developer accounts #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ update-api:
@+$(MAKE) -B api

openapi/openapi.json: openapi/base.json Sources/DeveloperAPI/openapi-overlay.yaml
npx bump-cli overlay openapi/base.json Sources/DeveloperAPI/openapi-overlay.yaml > openapi/openapi.json
npx --yes bump-cli overlay openapi/base.json Sources/DeveloperAPI/openapi-overlay.yaml > openapi/openapi.json

openapi/base.json:
@mkdir -p openapi
Expand Down
201 changes: 201 additions & 0 deletions Sources/DeveloperAPI/Generated/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2017,6 +2017,207 @@ public struct DeveloperAPIClient: APIProtocol {
}
)
}
/// - Remark: HTTP `PATCH /v1/certificates/{id}`.
/// - Remark: Generated from `#/paths//v1/certificates/{id}/patch(certificates_updateInstance)`.
public func certificatesUpdateInstance(_ input: Operations.CertificatesUpdateInstance.Input) async throws -> Operations.CertificatesUpdateInstance.Output {
try await client.send(
input: input,
forOperation: Operations.CertificatesUpdateInstance.id,
serializer: { input in
let path = try converter.renderedPath(
template: "/v1/certificates/{}",
parameters: [
input.path.id
]
)
var request: HTTPTypes.HTTPRequest = .init(
soar_path: path,
method: .patch
)
suppressMutabilityWarning(&request)
converter.setAcceptHeader(
in: &request.headerFields,
contentTypes: input.headers.accept
)
let body: OpenAPIRuntime.HTTPBody?
switch input.body {
case let .json(value):
body = try converter.setRequiredRequestBodyAsJSON(
value,
headerFields: &request.headerFields,
contentType: "application/json; charset=utf-8"
)
}
return (request, body)
},
deserializer: { response, responseBody in
switch response.status.code {
case 200:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.CertificatesUpdateInstance.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.CertificateResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .ok(.init(body: body))
case 400:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.CertificatesUpdateInstance.Output.BadRequest.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.ErrorResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .badRequest(.init(body: body))
case 401:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.CertificatesUpdateInstance.Output.Unauthorized.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.ErrorResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .unauthorized(.init(body: body))
case 403:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.CertificatesUpdateInstance.Output.Forbidden.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.ErrorResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .forbidden(.init(body: body))
case 404:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.CertificatesUpdateInstance.Output.NotFound.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.ErrorResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .notFound(.init(body: body))
case 409:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.CertificatesUpdateInstance.Output.Conflict.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.ErrorResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .conflict(.init(body: body))
case 422:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.CertificatesUpdateInstance.Output.UnprocessableContent.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.ErrorResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .unprocessableContent(.init(body: body))
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
)
}
}
)
}
/// - Remark: HTTP `DELETE /v1/certificates/{id}`.
/// - Remark: Generated from `#/paths//v1/certificates/{id}/delete(certificates_deleteInstance)`.
public func certificatesDeleteInstance(_ input: Operations.CertificatesDeleteInstance.Input) async throws -> Operations.CertificatesDeleteInstance.Output {
Expand Down
Loading
0