Files
zeekay 1df3ddf6bd Regenerate against the document the deployment answers for
The projection these were generated from predated the compute migration, so
they described /v1/visor — which the API serves at zero paths now.

No /v1/visor path survives here.
2026-09-05 18:55:38 -07:00

1832 lines
122 KiB
Swift

//
// GitAPI.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
open class GitAPI {
/**
Removes a registered SSH key, scoped to the caller's org: an org can only delete its own, and a key id it does not own is not found.
- parameter id: (path) ID is the key's identifier (\"gitkey_…\"), from the :id path segment.
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func deleteGitKeysById(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await deleteGitKeysByIdWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Removes a registered SSH key, scoped to the caller's org: an org can only delete its own, and a key id it does not own is not found.
- DELETE /v1/git/keys/{id}
- Removes a registered SSH key, scoped to the caller's org: an org can only delete its own, and a key id it does not own is not found. Answers 204 with no body. Once removed the key no longer authenticates any SSH git access.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the key's identifier (\"gitkey_…\"), from the :id path segment.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func deleteGitKeysByIdWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/git/keys/{id}"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Removes a repo's metadata and purges its storage.
- parameter name: (path) Name is the repo&#39;s org-unique handle, from the :name path segment. A trailing \&quot;.git\&quot; is stripped.
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func deleteGitReposByName(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await deleteGitReposByNameWithRequestBuilder(name: name, apiConfiguration: apiConfiguration).execute().body
}
/**
Removes a repo's metadata and purges its storage.
- DELETE /v1/git/repos/{name}
- Removes a repo's metadata and purges its storage. Answers 204 with no body. The metadata row is the source of truth for existence, so a storage purge that fails is logged and the delete still succeeds — and a second call is a 404, not a second delete.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo&#39;s org-unique handle, from the :name path segment. A trailing \&quot;.git\&quot; is stripped.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func deleteGitReposByNameWithRequestBuilder(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/git/repos/{name}"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Removes one Slack subscription from a repo; the notifier stops posting that repo's events to that channel.
- parameter name: (path) Name is the repo, from the :name path segment.
- parameter id: (path) ID is the row to remove, from the :id path segment.
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func deleteGitReposByNameSubscriptionsById(name: String, id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await deleteGitReposByNameSubscriptionsByIdWithRequestBuilder(name: name, id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Removes one Slack subscription from a repo; the notifier stops posting that repo's events to that channel.
- DELETE /v1/git/repos/{name}/subscriptions/{id}
- Removes one Slack subscription from a repo; the notifier stops posting that repo's events to that channel. Answers 204 with no body. An id that is not this repo's subscription is not found.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo, from the :name path segment.
- parameter id: (path) ID is the row to remove, from the :id path segment.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func deleteGitReposByNameSubscriptionsByIdWithRequestBuilder(name: String, id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/git/repos/{name}/subscriptions/{id}"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Removes one outbound mirror target; later pushes stop being forwarded to it.
- parameter name: (path) Name is the repo, from the :name path segment.
- parameter id: (path) ID is the row to remove, from the :id path segment.
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func deleteGitReposByNameTargetsById(name: String, id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await deleteGitReposByNameTargetsByIdWithRequestBuilder(name: name, id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Removes one outbound mirror target; later pushes stop being forwarded to it.
- DELETE /v1/git/repos/{name}/targets/{id}
- Removes one outbound mirror target; later pushes stop being forwarded to it. Answers 204 with no body. Nothing is done to the downstream remote itself — only this repo's intent to push there is dropped.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo, from the :name path segment.
- parameter id: (path) ID is the row to remove, from the :id path segment.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func deleteGitReposByNameTargetsByIdWithRequestBuilder(name: String, id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/git/repos/{name}/targets/{id}"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Browse your org's repositories
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGit(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await getGitWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
}
/**
Browse your org's repositories
- GET /v1/git
- The repository list for the signed-in caller's org — each repo with its description, default branch, size and last update. SIGNED OUT it renders the public explore page instead of refusing, because most Hanzo repos are open source and the open face is the default one; signed in, the caller's own org shows its private repositories alongside its public ones. This is a server-rendered browser page, not JSON — the console repo-browser reads the same repository through the JSON ops under /v1/git/repos. Repository names, paths and file contents all render through auto-escaping templates rather than being concatenated into HTML.
- Bearer Token:
- type: http
- name: bearer
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func getGitWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
let localVariablePath = "/v1/git"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Advertise a repository's refs to a git client
- parameter org: (path)
- parameter project: (path)
- parameter repo: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitByOrgByProjectByRepoInfoRefs(org: String, project: String, repo: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await getGitByOrgByProjectByRepoInfoRefsWithRequestBuilder(org: org, project: project, repo: repo, apiConfiguration: apiConfiguration).execute().body
}
/**
Advertise a repository's refs to a git client
- GET /v1/git/{org}/{project}/{repo}/info/refs
- The ref-advertisement phase of git's smart-HTTP protocol — the first request a clone, a fetch and a push all make. `?service=` selects which: `git-upload-pack` advertises for a fetch, `git-receive-pack` for a push, and any other value is 400. ANONYMOUS ONLY FOR FETCH, AND ONLY ON A PUBLIC REPOSITORY. The push advertisement always requires an authenticated org, and where a path org is present it must equal the authenticated one. A private repository reached without its org is 404, indistinguishable from one that does not exist. Addressed under the API prefix, with the PROJECT as a middle path segment: project scope otherwise rides a header a git client cannot send, so this path is the only usable remote for a project-scoped repository. This is git's own wire protocol, not an API call to make by hand: point a git client at the clone URL and it makes this request itself.
- Bearer Token:
- type: http
- name: bearer
- parameter org: (path)
- parameter project: (path)
- parameter repo: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func getGitByOrgByProjectByRepoInfoRefsWithRequestBuilder(org: String, project: String, repo: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/git/{org}/{project}/{repo}/info/refs"
let orgPreEscape = "\(APIHelper.mapValueToPathItem(org))"
let orgPostEscape = orgPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{org}", with: orgPostEscape, options: .literal, range: nil)
let projectPreEscape = "\(APIHelper.mapValueToPathItem(project))"
let projectPostEscape = projectPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{project}", with: projectPostEscape, options: .literal, range: nil)
let repoPreEscape = "\(APIHelper.mapValueToPathItem(repo))"
let repoPostEscape = repoPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{repo}", with: repoPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Open a repository's home page
- parameter org: (path)
- parameter repo: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitByOrgByRepo(org: String, repo: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await getGitByOrgByRepoWithRequestBuilder(org: org, repo: repo, apiConfiguration: apiConfiguration).execute().body
}
/**
Open a repository's home page
- GET /v1/git/{org}/{repo}
- A repository at a glance: its branches, the tree at the tip, its most recent commits, its README rendered, and the HTTPS and SSH clone URLs. `?ref=` selects a branch, tag or commit; the default branch is used when it is omitted. A repository with no commits yet renders its clone instructions rather than an error, which is what a caller who has just created one needs to see. A public repository is readable by anyone; a private one only by its own org. A repository that does not exist and one belonging to another org answer the SAME 404, so the page is never an existence oracle. This is a server-rendered browser page, not JSON — the console repo-browser reads the same repository through the JSON ops under /v1/git/repos. Repository names, paths and file contents all render through auto-escaping templates rather than being concatenated into HTML.
- Bearer Token:
- type: http
- name: bearer
- parameter org: (path)
- parameter repo: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func getGitByOrgByRepoWithRequestBuilder(org: String, repo: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/git/{org}/{repo}"
let orgPreEscape = "\(APIHelper.mapValueToPathItem(org))"
let orgPostEscape = orgPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{org}", with: orgPostEscape, options: .literal, range: nil)
let repoPreEscape = "\(APIHelper.mapValueToPathItem(repo))"
let repoPostEscape = repoPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{repo}", with: repoPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Read a repository's commit log
- parameter org: (path)
- parameter repo: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitByOrgByRepoCommits(org: String, repo: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await getGitByOrgByRepoCommitsWithRequestBuilder(org: org, repo: repo, apiConfiguration: apiConfiguration).execute().body
}
/**
Read a repository's commit log
- GET /v1/git/{org}/{repo}/commits
- The hundred most recent commits on one ref, each with its author, message and date. `?ref=` selects the branch, tag or commit, defaulting to the repository's default branch; an unknown one is 404. A public repository is readable by anyone; a private one only by its own org. A repository that does not exist and one belonging to another org answer the SAME 404, so the page is never an existence oracle. This is a server-rendered browser page, not JSON — the console repo-browser reads the same repository through the JSON ops under /v1/git/repos. Repository names, paths and file contents all render through auto-escaping templates rather than being concatenated into HTML.
- Bearer Token:
- type: http
- name: bearer
- parameter org: (path)
- parameter repo: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func getGitByOrgByRepoCommitsWithRequestBuilder(org: String, repo: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/git/{org}/{repo}/commits"
let orgPreEscape = "\(APIHelper.mapValueToPathItem(org))"
let orgPostEscape = orgPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{org}", with: orgPostEscape, options: .literal, range: nil)
let repoPreEscape = "\(APIHelper.mapValueToPathItem(repo))"
let repoPostEscape = repoPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{repo}", with: repoPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Advertise a repository's refs to a git client
- parameter org: (path)
- parameter repo: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitByOrgByRepoInfoRefs(org: String, repo: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await getGitByOrgByRepoInfoRefsWithRequestBuilder(org: org, repo: repo, apiConfiguration: apiConfiguration).execute().body
}
/**
Advertise a repository's refs to a git client
- GET /v1/git/{org}/{repo}/info/refs
- The ref-advertisement phase of git's smart-HTTP protocol — the first request a clone, a fetch and a push all make. `?service=` selects which: `git-upload-pack` advertises for a fetch, `git-receive-pack` for a push, and any other value is 400. ANONYMOUS ONLY FOR FETCH, AND ONLY ON A PUBLIC REPOSITORY. The push advertisement always requires an authenticated org, and where a path org is present it must equal the authenticated one. A private repository reached without its org is 404, indistinguishable from one that does not exist. Addressed under the API prefix, so `git clone https://<host>/v1/git/<org>/<repo>.git` works on any host the binary serves. This is git's own wire protocol, not an API call to make by hand: point a git client at the clone URL and it makes this request itself.
- Bearer Token:
- type: http
- name: bearer
- parameter org: (path)
- parameter repo: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func getGitByOrgByRepoInfoRefsWithRequestBuilder(org: String, repo: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/git/{org}/{repo}/info/refs"
let orgPreEscape = "\(APIHelper.mapValueToPathItem(org))"
let orgPostEscape = orgPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{org}", with: orgPostEscape, options: .literal, range: nil)
let repoPreEscape = "\(APIHelper.mapValueToPathItem(repo))"
let repoPostEscape = repoPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{repo}", with: repoPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Discover public repositories across every org
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitExplore(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await getGitExploreWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
}
/**
Discover public repositories across every org
- GET /v1/git/explore
- The open, unauthenticated face of the git host: every PUBLIC repository in the fleet, org-qualified, so a project can be found and cloned with no account at all — signing in is for private repos and for writes. Repositories live in per-org stores with no global index, so this unions each org's public rows and is bounded to a fixed number of stores per request, keeping discovery quick however many orgs exist. A fleet with no orgs yet is an empty page, not an error. This is a server-rendered browser page, not JSON — the console repo-browser reads the same repository through the JSON ops under /v1/git/repos. Repository names, paths and file contents all render through auto-escaping templates rather than being concatenated into HTML.
- Bearer Token:
- type: http
- name: bearer
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func getGitExploreWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
let localVariablePath = "/v1/git/explore"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns the SSH public keys registered to the caller's org — the keys that authenticate `git clone git@<host>:<org>/<repo>.git`.
- parameter apiConfiguration: The configuration for the http request.
- returns: KeyList
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitKeys(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> KeyList {
return try await getGitKeysWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
}
/**
Returns the SSH public keys registered to the caller's org — the keys that authenticate `git clone git@<host>:<org>/<repo>.git`.
- GET /v1/git/keys
- Returns the SSH public keys registered to the caller's org — the keys that authenticate `git clone git@<host>:<org>/<repo>.git`. Keys are org-scoped on read even though the fingerprint index is global, so one org never sees another's.
- Bearer Token:
- type: http
- name: bearer
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<KeyList>
*/
open class func getGitKeysWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<KeyList> {
let localVariablePath = "/v1/git/keys"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<KeyList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns the repos in the caller's scope, most recently updated first.
- parameter apiConfiguration: The configuration for the http request.
- returns: RepoList
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitRepos(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RepoList {
return try await getGitReposWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
}
/**
Returns the repos in the caller's scope, most recently updated first.
- GET /v1/git/repos
- Returns the repos in the caller's scope, most recently updated first. The scope is the request principal's — the gateway-minted org and its optional project — never anything off the wire, so a caller only ever sees its own. Rows carry no branches or HEAD; read one repo for those.
- Bearer Token:
- type: http
- name: bearer
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<RepoList>
*/
open class func getGitReposWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RepoList> {
let localVariablePath = "/v1/git/repos"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<RepoList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns one repo with its live ref state: every branch name and the resolved HEAD commit.
- parameter name: (path) Name is the repo&#39;s org-unique handle, from the :name path segment. A trailing \&quot;.git\&quot; is stripped.
- parameter apiConfiguration: The configuration for the http request.
- returns: RepoView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitReposByName(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RepoView {
return try await getGitReposByNameWithRequestBuilder(name: name, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns one repo with its live ref state: every branch name and the resolved HEAD commit.
- GET /v1/git/repos/{name}
- Returns one repo with its live ref state: every branch name and the resolved HEAD commit. Both are read from the object store on each call, so an empty repo reports no branches and an empty head rather than failing. A repo outside the caller's scope is not found.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo&#39;s org-unique handle, from the :name path segment. A trailing \&quot;.git\&quot; is stripped.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<RepoView>
*/
open class func getGitReposByNameWithRequestBuilder(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RepoView> {
var localVariablePath = "/v1/git/repos/{name}"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<RepoView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns one file's bytes at one revision.
- parameter name: (path) Name is the repo to read, from the :name path segment.
- parameter ref: (query) Ref is a branch, tag or commit; empty means the repo&#39;s HEAD. (optional)
- parameter path: (query) Path is repo-relative; empty is the tree root. Traversal is stripped. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: BlobJSON
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitReposByNameBlob(name: String, ref: String? = nil, path: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> BlobJSON {
return try await getGitReposByNameBlobWithRequestBuilder(name: name, ref: ref, path: path, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns one file's bytes at one revision.
- GET /v1/git/repos/{name}/blob
- Returns one file's bytes at one revision. Text comes back verbatim, binary comes back base64, and a file past the 1 MiB view cap comes back marked truncated with NO content — the client is expected to clone instead.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo to read, from the :name path segment.
- parameter ref: (query) Ref is a branch, tag or commit; empty means the repo&#39;s HEAD. (optional)
- parameter path: (query) Path is repo-relative; empty is the tree root. Traversal is stripped. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<BlobJSON>
*/
open class func getGitReposByNameBlobWithRequestBuilder(name: String, ref: String? = nil, path: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<BlobJSON> {
var localVariablePath = "/v1/git/repos/{name}/blob"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"ref": (wrappedValue: ref?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"path": (wrappedValue: path?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
])
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<BlobJSON>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Walks a ref's history newest first, or one path's history when a path is given.
- parameter name: (path) Name is the repo to read, from the :name path segment.
- parameter ref: (query) Ref is the branch, tag or commit to walk back from; empty means HEAD. (optional)
- parameter path: (query) Path narrows the history to commits touching it; empty walks the whole ref. (optional)
- parameter limit: (query) Limit caps the page. Anything not positive means 50; the cap is 100. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: CommitsJSON
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitReposByNameCommits(name: String, ref: String? = nil, path: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> CommitsJSON {
return try await getGitReposByNameCommitsWithRequestBuilder(name: name, ref: ref, path: path, limit: limit, apiConfiguration: apiConfiguration).execute().body
}
/**
Walks a ref's history newest first, or one path's history when a path is given.
- GET /v1/git/repos/{name}/commits
- Walks a ref's history newest first, or one path's history when a path is given. There is no cursor: the page is the newest `limit` commits.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo to read, from the :name path segment.
- parameter ref: (query) Ref is the branch, tag or commit to walk back from; empty means HEAD. (optional)
- parameter path: (query) Path narrows the history to commits touching it; empty walks the whole ref. (optional)
- parameter limit: (query) Limit caps the page. Anything not positive means 50; the cap is 100. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<CommitsJSON>
*/
open class func getGitReposByNameCommitsWithRequestBuilder(name: String, ref: String? = nil, path: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<CommitsJSON> {
var localVariablePath = "/v1/git/repos/{name}/commits"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"ref": (wrappedValue: ref?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"path": (wrappedValue: path?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"limit": (wrappedValue: limit?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
])
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<CommitsJSON>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns every file a glob selects at one revision, WITH its bytes and the revision they came from.
- parameter name: (path) Name is the repo to read, from the :name path segment.
- parameter ref: (query) Ref is a branch, tag or commit; empty means the repo&#39;s HEAD. (optional)
- parameter glob: (query) Glob selects files, matched segment by segment so &#x60;*&#x60; never crosses a &#x60;/&#x60;. &#x60;**&#x60; matches zero or more whole segments. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: FilesJSON
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitReposByNameFiles(name: String, ref: String? = nil, glob: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> FilesJSON {
return try await getGitReposByNameFilesWithRequestBuilder(name: name, ref: ref, glob: glob, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns every file a glob selects at one revision, WITH its bytes and the revision they came from.
- GET /v1/git/repos/{name}/files
- Returns every file a glob selects at one revision, WITH its bytes and the revision they came from. It is the read a delivery generator makes: one call answers \"what is the inventory at this commit, and what does it say\", where listing and then fetching would be a request per file. Returning the resolved revision matters as much as the bytes. A generator that lists at `main` and then reads at `main` can straddle a push and assemble half its inventory from one commit and half from the next; resolving once makes the whole read consistent by construction. A file past the read cap comes back Truncated with no content rather than being dropped. A caller building a desired set has to know the difference between \"this file is empty\" and \"this file was not read\" — silently omitting it is how a pruning reconcile deletes what the missing file declared.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo to read, from the :name path segment.
- parameter ref: (query) Ref is a branch, tag or commit; empty means the repo&#39;s HEAD. (optional)
- parameter glob: (query) Glob selects files, matched segment by segment so &#x60;*&#x60; never crosses a &#x60;/&#x60;. &#x60;**&#x60; matches zero or more whole segments. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<FilesJSON>
*/
open class func getGitReposByNameFilesWithRequestBuilder(name: String, ref: String? = nil, glob: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<FilesJSON> {
var localVariablePath = "/v1/git/repos/{name}/files"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"ref": (wrappedValue: ref?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"glob": (wrappedValue: glob?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
])
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<FilesJSON>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns a repo's pull requests, newest number first — what is waiting to be reviewed, and what has already landed.
- parameter name: (path) Name is the repo, from the :name path segment.
- parameter state: (query) State narrows the list to \&quot;open\&quot; or \&quot;merged\&quot;. Omit it for every proposal. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: PullList
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitReposByNamePulls(name: String, state: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> PullList {
return try await getGitReposByNamePullsWithRequestBuilder(name: name, state: state, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns a repo's pull requests, newest number first — what is waiting to be reviewed, and what has already landed.
- GET /v1/git/repos/{name}/pulls
- Returns a repo's pull requests, newest number first — what is waiting to be reviewed, and what has already landed. Narrow it with ?state=open or ?state=merged; omit state for every proposal.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo, from the :name path segment.
- parameter state: (query) State narrows the list to \&quot;open\&quot; or \&quot;merged\&quot;. Omit it for every proposal. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<PullList>
*/
open class func getGitReposByNamePullsWithRequestBuilder(name: String, state: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<PullList> {
var localVariablePath = "/v1/git/repos/{name}/pulls"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"state": (wrappedValue: state?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
])
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<PullList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns one pull request by its per-repo number.
- parameter name: (path) Name is the repo, from the :name path segment.
- parameter number: (path) Number is the proposal&#39;s per-repo number, from the :number path segment.
- parameter apiConfiguration: The configuration for the http request.
- returns: PullView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitReposByNamePullsByNumber(name: String, number: Int64, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> PullView {
return try await getGitReposByNamePullsByNumberWithRequestBuilder(name: name, number: number, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns one pull request by its per-repo number.
- GET /v1/git/repos/{name}/pulls/{number}
- Returns one pull request by its per-repo number. A number belonging to another tenant's repo is not found, exactly as the repo itself is not.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo, from the :name path segment.
- parameter number: (path) Number is the proposal&#39;s per-repo number, from the :number path segment.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<PullView>
*/
open class func getGitReposByNamePullsByNumberWithRequestBuilder(name: String, number: Int64, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<PullView> {
var localVariablePath = "/v1/git/repos/{name}/pulls/{number}"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let numberPreEscape = "\(APIHelper.mapValueToPathItem(number))"
let numberPostEscape = numberPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{number}", with: numberPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<PullView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns the README at the tree root as plain text — unrendered, so the caller decides how to present it.
- parameter name: (path) Name is the repo to read, from the :name path segment.
- parameter ref: (query) Ref is a branch, tag or commit; empty means the repo&#39;s HEAD. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: ReadmeJSON
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitReposByNameReadme(name: String, ref: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> ReadmeJSON {
return try await getGitReposByNameReadmeWithRequestBuilder(name: name, ref: ref, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns the README at the tree root as plain text — unrendered, so the caller decides how to present it.
- GET /v1/git/repos/{name}/readme
- Returns the README at the tree root as plain text — unrendered, so the caller decides how to present it. A repo with no README is not found.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo to read, from the :name path segment.
- parameter ref: (query) Ref is a branch, tag or commit; empty means the repo&#39;s HEAD. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<ReadmeJSON>
*/
open class func getGitReposByNameReadmeWithRequestBuilder(name: String, ref: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<ReadmeJSON> {
var localVariablePath = "/v1/git/repos/{name}/readme"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"ref": (wrappedValue: ref?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
])
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<ReadmeJSON>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Lists a repo's branches, tags and default branch — what a branch picker needs in one call.
- parameter name: (path) Name is the repo&#39;s org-unique handle, from the :name path segment. A trailing \&quot;.git\&quot; is stripped.
- parameter apiConfiguration: The configuration for the http request.
- returns: RefsJSON
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitReposByNameRefs(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RefsJSON {
return try await getGitReposByNameRefsWithRequestBuilder(name: name, apiConfiguration: apiConfiguration).execute().body
}
/**
Lists a repo's branches, tags and default branch — what a branch picker needs in one call.
- GET /v1/git/repos/{name}/refs
- Lists a repo's branches, tags and default branch — what a branch picker needs in one call. Unlike the other read ops it tolerates a repo with no commits: the ref sets come back empty and the default branch is still named.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo&#39;s org-unique handle, from the :name path segment. A trailing \&quot;.git\&quot; is stripped.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<RefsJSON>
*/
open class func getGitReposByNameRefsWithRequestBuilder(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RefsJSON> {
var localVariablePath = "/v1/git/repos/{name}/refs"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<RefsJSON>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns a repo's Slack subscriptions — which channels the lifecycle notifier posts this repo's push and deploy events to.
- parameter name: (path) Name is the repo&#39;s org-unique handle, from the :name path segment. A trailing \&quot;.git\&quot; is stripped.
- parameter apiConfiguration: The configuration for the http request.
- returns: SubscriptionList
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitReposByNameSubscriptions(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> SubscriptionList {
return try await getGitReposByNameSubscriptionsWithRequestBuilder(name: name, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns a repo's Slack subscriptions — which channels the lifecycle notifier posts this repo's push and deploy events to.
- GET /v1/git/repos/{name}/subscriptions
- Returns a repo's Slack subscriptions — which channels the lifecycle notifier posts this repo's push and deploy events to.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo&#39;s org-unique handle, from the :name path segment. A trailing \&quot;.git\&quot; is stripped.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<SubscriptionList>
*/
open class func getGitReposByNameSubscriptionsWithRequestBuilder(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<SubscriptionList> {
var localVariablePath = "/v1/git/repos/{name}/subscriptions"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<SubscriptionList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns a repo's outbound mirror targets — the downstream remotes the mirror reactor pushes to whenever a push lands here.
- parameter name: (path) Name is the repo&#39;s org-unique handle, from the :name path segment. A trailing \&quot;.git\&quot; is stripped.
- parameter apiConfiguration: The configuration for the http request.
- returns: MirrorList
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitReposByNameTargets(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> MirrorList {
return try await getGitReposByNameTargetsWithRequestBuilder(name: name, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns a repo's outbound mirror targets — the downstream remotes the mirror reactor pushes to whenever a push lands here.
- GET /v1/git/repos/{name}/targets
- Returns a repo's outbound mirror targets — the downstream remotes the mirror reactor pushes to whenever a push lands here.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo&#39;s org-unique handle, from the :name path segment. A trailing \&quot;.git\&quot; is stripped.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<MirrorList>
*/
open class func getGitReposByNameTargetsWithRequestBuilder(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<MirrorList> {
var localVariablePath = "/v1/git/repos/{name}/targets"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<MirrorList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Lists the immediate children of one directory at one revision, directories before files.
- parameter name: (path) Name is the repo to read, from the :name path segment.
- parameter ref: (query) Ref is a branch, tag or commit; empty means the repo&#39;s HEAD. (optional)
- parameter path: (query) Path is repo-relative; empty is the tree root. Traversal is stripped. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: TreeJSON
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitReposByNameTree(name: String, ref: String? = nil, path: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> TreeJSON {
return try await getGitReposByNameTreeWithRequestBuilder(name: name, ref: ref, path: path, apiConfiguration: apiConfiguration).execute().body
}
/**
Lists the immediate children of one directory at one revision, directories before files.
- GET /v1/git/repos/{name}/tree
- Lists the immediate children of one directory at one revision, directories before files. It does not recurse — walk down a level at a time.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo to read, from the :name path segment.
- parameter ref: (query) Ref is a branch, tag or commit; empty means the repo&#39;s HEAD. (optional)
- parameter path: (query) Path is repo-relative; empty is the tree root. Traversal is stripped. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<TreeJSON>
*/
open class func getGitReposByNameTreeWithRequestBuilder(name: String, ref: String? = nil, path: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<TreeJSON> {
var localVariablePath = "/v1/git/repos/{name}/tree"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"ref": (wrappedValue: ref?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"path": (wrappedValue: path?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
])
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<TreeJSON>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns per-repo and total storage bytes for the caller's org — the queryable, per-tenant number commerce and o11y meter on.
- parameter apiConfiguration: The configuration for the http request.
- returns: UsageView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getGitUsage(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> UsageView {
return try await getGitUsageWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
}
/**
Returns per-repo and total storage bytes for the caller's org — the queryable, per-tenant number commerce and o11y meter on.
- GET /v1/git/usage
- Returns per-repo and total storage bytes for the caller's org — the queryable, per-tenant number commerce and o11y meter on. It spans EVERY project sub-scope, unlike the repo list, so a billing consumer sees the whole tenant footprint in one call. Sizes are last-measured values (create, push, mirror and gc each re-measure), not a live walk of the disk.
- Bearer Token:
- type: http
- name: bearer
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<UsageView>
*/
open class func getGitUsageWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<UsageView> {
let localVariablePath = "/v1/git/usage"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<UsageView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Flips a repo's public bit, the one mutable repo setting today.
- parameter name: (path) Name is the repo to update, from the :name path segment.
- parameter patchIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RepoView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func patchGitReposByName(name: String, patchIn: PatchIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RepoView {
return try await patchGitReposByNameWithRequestBuilder(name: name, patchIn: patchIn, apiConfiguration: apiConfiguration).execute().body
}
/**
Flips a repo's public bit, the one mutable repo setting today.
- PATCH /v1/git/repos/{name}
- Flips a repo's public bit, the one mutable repo setting today. Public grants ANONYMOUS fetch only; push and the whole control plane stay org-authed. Returns the updated repo.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo to update, from the :name path segment.
- parameter patchIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<RepoView>
*/
open class func patchGitReposByNameWithRequestBuilder(name: String, patchIn: PatchIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RepoView> {
var localVariablePath = "/v1/git/repos/{name}"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: patchIn, codableHelper: apiConfiguration.codableHelper)
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/json",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<RepoView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Accept a push, and turn it into a build
- parameter org: (path)
- parameter project: (path)
- parameter repo: (path)
- parameter body: (body) (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitByOrgByProjectByRepoGitReceivePack(org: String, project: String, repo: String, body: URL? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await postGitByOrgByProjectByRepoGitReceivePackWithRequestBuilder(org: org, project: project, repo: repo, body: body, apiConfiguration: apiConfiguration).execute().body
}
/**
Accept a push, and turn it into a build
- POST /v1/git/{org}/{project}/{repo}/git-receive-pack
- The pack-transfer phase of a push, and the point at which a push becomes an EVENT. NEVER ANONYMOUS: a push always requires an authenticated org, and the org in the path must equal it. Once the pack is on disk the repository's storage usage is metered and a build is fired for every branch whose tip actually moved, computed from the before/after branch diff rather than from what the client claimed. That runs on a cancel-immune context, so a client that hangs up the moment its push lands still gets its build, and it runs even when git itself exited non-zero — the refs on disk are the ground truth. Repacking housekeeping is detached and never blocks the response. A Content-Type other than `application/x-git-receive-pack-request` is 400. Addressed under the API prefix, with the PROJECT as a middle path segment: project scope otherwise rides a header a git client cannot send, so this path is the only usable remote for a project-scoped repository. This is git's own wire protocol, not an API call to make by hand: point a git client at the clone URL and it makes this request itself.
- Bearer Token:
- type: http
- name: bearer
- parameter org: (path)
- parameter project: (path)
- parameter repo: (path)
- parameter body: (body) (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func postGitByOrgByProjectByRepoGitReceivePackWithRequestBuilder(org: String, project: String, repo: String, body: URL? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/git/{org}/{project}/{repo}/git-receive-pack"
let orgPreEscape = "\(APIHelper.mapValueToPathItem(org))"
let orgPostEscape = orgPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{org}", with: orgPostEscape, options: .literal, range: nil)
let projectPreEscape = "\(APIHelper.mapValueToPathItem(project))"
let projectPostEscape = projectPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{project}", with: projectPostEscape, options: .literal, range: nil)
let repoPreEscape = "\(APIHelper.mapValueToPathItem(repo))"
let repoPostEscape = repoPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{repo}", with: repoPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = ["body": body]
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/octet-stream",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Serve a clone or fetch
- parameter org: (path)
- parameter project: (path)
- parameter repo: (path)
- parameter body: (body) (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitByOrgByProjectByRepoGitUploadPack(org: String, project: String, repo: String, body: URL? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await postGitByOrgByProjectByRepoGitUploadPackWithRequestBuilder(org: org, project: project, repo: repo, body: body, apiConfiguration: apiConfiguration).execute().body
}
/**
Serve a clone or fetch
- POST /v1/git/{org}/{project}/{repo}/git-upload-pack
- The pack-transfer phase of a clone or fetch: the request and the response are git's binary pack protocol, streamed straight through git itself — request body to git's stdin, git's stdout to the response — so a multi-gigabyte clone never lands in this process's memory. A PUBLIC repository is fetched anonymously; a private one requires its own org, and a wrong or absent org is 404 rather than a hint that the repository exists. A Content-Type other than `application/x-git-upload-pack-request` is 400. Addressed under the API prefix, with the PROJECT as a middle path segment: project scope otherwise rides a header a git client cannot send, so this path is the only usable remote for a project-scoped repository. This is git's own wire protocol, not an API call to make by hand: point a git client at the clone URL and it makes this request itself.
- Bearer Token:
- type: http
- name: bearer
- parameter org: (path)
- parameter project: (path)
- parameter repo: (path)
- parameter body: (body) (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func postGitByOrgByProjectByRepoGitUploadPackWithRequestBuilder(org: String, project: String, repo: String, body: URL? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/git/{org}/{project}/{repo}/git-upload-pack"
let orgPreEscape = "\(APIHelper.mapValueToPathItem(org))"
let orgPostEscape = orgPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{org}", with: orgPostEscape, options: .literal, range: nil)
let projectPreEscape = "\(APIHelper.mapValueToPathItem(project))"
let projectPostEscape = projectPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{project}", with: projectPostEscape, options: .literal, range: nil)
let repoPreEscape = "\(APIHelper.mapValueToPathItem(repo))"
let repoPostEscape = repoPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{repo}", with: repoPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = ["body": body]
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/octet-stream",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Accept a push, and turn it into a build
- parameter org: (path)
- parameter repo: (path)
- parameter body: (body) (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitByOrgByRepoGitReceivePack(org: String, repo: String, body: URL? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await postGitByOrgByRepoGitReceivePackWithRequestBuilder(org: org, repo: repo, body: body, apiConfiguration: apiConfiguration).execute().body
}
/**
Accept a push, and turn it into a build
- POST /v1/git/{org}/{repo}/git-receive-pack
- The pack-transfer phase of a push, and the point at which a push becomes an EVENT. NEVER ANONYMOUS: a push always requires an authenticated org, and the org in the path must equal it. Once the pack is on disk the repository's storage usage is metered and a build is fired for every branch whose tip actually moved, computed from the before/after branch diff rather than from what the client claimed. That runs on a cancel-immune context, so a client that hangs up the moment its push lands still gets its build, and it runs even when git itself exited non-zero — the refs on disk are the ground truth. Repacking housekeeping is detached and never blocks the response. A Content-Type other than `application/x-git-receive-pack-request` is 400. Addressed under the API prefix, so `git clone https://<host>/v1/git/<org>/<repo>.git` works on any host the binary serves. This is git's own wire protocol, not an API call to make by hand: point a git client at the clone URL and it makes this request itself.
- Bearer Token:
- type: http
- name: bearer
- parameter org: (path)
- parameter repo: (path)
- parameter body: (body) (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func postGitByOrgByRepoGitReceivePackWithRequestBuilder(org: String, repo: String, body: URL? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/git/{org}/{repo}/git-receive-pack"
let orgPreEscape = "\(APIHelper.mapValueToPathItem(org))"
let orgPostEscape = orgPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{org}", with: orgPostEscape, options: .literal, range: nil)
let repoPreEscape = "\(APIHelper.mapValueToPathItem(repo))"
let repoPostEscape = repoPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{repo}", with: repoPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = ["body": body]
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/octet-stream",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Serve a clone or fetch
- parameter org: (path)
- parameter repo: (path)
- parameter body: (body) (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitByOrgByRepoGitUploadPack(org: String, repo: String, body: URL? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await postGitByOrgByRepoGitUploadPackWithRequestBuilder(org: org, repo: repo, body: body, apiConfiguration: apiConfiguration).execute().body
}
/**
Serve a clone or fetch
- POST /v1/git/{org}/{repo}/git-upload-pack
- The pack-transfer phase of a clone or fetch: the request and the response are git's binary pack protocol, streamed straight through git itself — request body to git's stdin, git's stdout to the response — so a multi-gigabyte clone never lands in this process's memory. A PUBLIC repository is fetched anonymously; a private one requires its own org, and a wrong or absent org is 404 rather than a hint that the repository exists. A Content-Type other than `application/x-git-upload-pack-request` is 400. Addressed under the API prefix, so `git clone https://<host>/v1/git/<org>/<repo>.git` works on any host the binary serves. This is git's own wire protocol, not an API call to make by hand: point a git client at the clone URL and it makes this request itself.
- Bearer Token:
- type: http
- name: bearer
- parameter org: (path)
- parameter repo: (path)
- parameter body: (body) (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func postGitByOrgByRepoGitUploadPackWithRequestBuilder(org: String, repo: String, body: URL? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/git/{org}/{repo}/git-upload-pack"
let orgPreEscape = "\(APIHelper.mapValueToPathItem(org))"
let orgPostEscape = orgPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{org}", with: orgPostEscape, options: .literal, range: nil)
let repoPreEscape = "\(APIHelper.mapValueToPathItem(repo))"
let repoPostEscape = repoPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{repo}", with: repoPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = ["body": body]
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/octet-stream",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Registers an SSH public key so it can authenticate `git clone git@<host>:<org>/<repo>.git` for the caller's org.
- parameter registerKeyReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: KeyView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitKeys(registerKeyReq: RegisterKeyReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> KeyView {
return try await postGitKeysWithRequestBuilder(registerKeyReq: registerKeyReq, apiConfiguration: apiConfiguration).execute().body
}
/**
Registers an SSH public key so it can authenticate `git clone git@<host>:<org>/<repo>.git` for the caller's org.
- POST /v1/git/keys
- Registers an SSH public key so it can authenticate `git clone git@<host>:<org>/<repo>.git` for the caller's org. The key line is parsed and canonicalized before storage, its SHA256 fingerprint becomes the auth lookup handle, and the full public key round-trips (it is public). Answers 201. Fingerprints are globally unique, so a key already registered — to this org or any other — is a 409: one key belongs to exactly one org.
- Bearer Token:
- type: http
- name: bearer
- parameter registerKeyReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<KeyView>
*/
open class func postGitKeysWithRequestBuilder(registerKeyReq: RegisterKeyReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<KeyView> {
let localVariablePath = "/v1/git/keys"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: registerKeyReq, codableHelper: apiConfiguration.codableHelper)
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/json",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<KeyView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Provisions an empty bare repository in the caller's scope and returns it with its clone URLs.
- parameter createReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RepoView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitRepos(createReq: CreateReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RepoView {
return try await postGitReposWithRequestBuilder(createReq: createReq, apiConfiguration: apiConfiguration).execute().body
}
/**
Provisions an empty bare repository in the caller's scope and returns it with its clone URLs.
- POST /v1/git/repos
- Provisions an empty bare repository in the caller's scope and returns it with its clone URLs. Answers 201. The name must be unique within the scope — a repeat is a 409, never a silent overwrite of an existing repo. The org comes from the validated principal, so a repo is always born owned by the caller's own tenant.
- Bearer Token:
- type: http
- name: bearer
- parameter createReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<RepoView>
*/
open class func postGitReposWithRequestBuilder(createReq: CreateReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RepoView> {
let localVariablePath = "/v1/git/repos"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createReq, codableHelper: apiConfiguration.codableHelper)
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/json",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<RepoView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Repacks a repo into one bitmapped pack and rewrites its commit-graph, so the next clone reuses the bitmap instead of walking the whole object graph.
- parameter name: (path) Name is the repo&#39;s org-unique handle, from the :name path segment. A trailing \&quot;.git\&quot; is stripped.
- parameter apiConfiguration: The configuration for the http request.
- returns: GcOut
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitReposByNameGc(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> GcOut {
return try await postGitReposByNameGcWithRequestBuilder(name: name, apiConfiguration: apiConfiguration).execute().body
}
/**
Repacks a repo into one bitmapped pack and rewrites its commit-graph, so the next clone reuses the bitmap instead of walking the whole object graph.
- POST /v1/git/repos/{name}/gc
- Repacks a repo into one bitmapped pack and rewrites its commit-graph, so the next clone reuses the bitmap instead of walking the whole object graph. Idempotent, and safe to interrupt — git swaps both artifacts atomically. It runs under one pack slot with the same memory bounds as a clone, so it can block behind heavy pack traffic rather than compete with it. Storage usage is re-measured afterwards, since a repack reclaims space.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo&#39;s org-unique handle, from the :name path segment. A trailing \&quot;.git\&quot; is stripped.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<GcOut>
*/
open class func postGitReposByNameGcWithRequestBuilder(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<GcOut> {
var localVariablePath = "/v1/git/repos/{name}/gc"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<GcOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Imports an external git repository into the caller's repo, provisioning it on first use.
- parameter name: (path) Name is the local repo to mirror into, from the :name path segment. It is CREATED on first use.
- parameter mirrorReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RepoView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitReposByNameMirror(name: String, mirrorReq: MirrorReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RepoView {
return try await postGitReposByNameMirrorWithRequestBuilder(name: name, mirrorReq: mirrorReq, apiConfiguration: apiConfiguration).execute().body
}
/**
Imports an external git repository into the caller's repo, provisioning it on first use.
- POST /v1/git/repos/{name}/mirror
- Imports an external git repository into the caller's repo, provisioning it on first use. Fetch is FORCED and covers every ref, so a first call clones the source and a repeat call re-syncs it — the endpoint is idempotent by mirror semantics. Mirrored bytes are metered exactly like a push, and a push.landed event is emitted for the default branch so the code index picks the repo up.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the local repo to mirror into, from the :name path segment. It is CREATED on first use.
- parameter mirrorReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<RepoView>
*/
open class func postGitReposByNameMirrorWithRequestBuilder(name: String, mirrorReq: MirrorReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RepoView> {
var localVariablePath = "/v1/git/repos/{name}/mirror"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: mirrorReq, codableHelper: apiConfiguration.codableHelper)
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/json",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<RepoView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Proposes a branch for merging and returns it with its number.
- parameter name: (path) Name is the repo the proposal belongs to, from the :name path segment.
- parameter openReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: PullView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitReposByNamePulls(name: String, openReq: OpenReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> PullView {
return try await postGitReposByNamePullsWithRequestBuilder(name: name, openReq: openReq, apiConfiguration: apiConfiguration).execute().body
}
/**
Proposes a branch for merging and returns it with its number.
- POST /v1/git/repos/{name}/pulls
- Proposes a branch for merging and returns it with its number. Answers 201. Both branches must already exist — a proposal naming a branch nobody pushed is a typo, not a plan — and base defaults to the repo's default branch. Proposing the same head into the same base twice is a 409 while the first proposal is still open, so a retried agent run leaves ONE thing to review rather than a pile of identical ones. A repo outside the caller's scope is a 404, exactly as reading it is.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo the proposal belongs to, from the :name path segment.
- parameter openReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<PullView>
*/
open class func postGitReposByNamePullsWithRequestBuilder(name: String, openReq: OpenReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<PullView> {
var localVariablePath = "/v1/git/repos/{name}/pulls"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: openReq, codableHelper: apiConfiguration.codableHelper)
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/json",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<PullView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Merges an open pull request by FAST-FORWARDING base to head, and answers the proposal in its merged state with the revision base now points at.
- parameter name: (path) Name is the repo, from the :name path segment.
- parameter number: (path) Number is the proposal&#39;s per-repo number, from the :number path segment.
- parameter apiConfiguration: The configuration for the http request.
- returns: PullView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitReposByNamePullsByNumberMerge(name: String, number: Int64, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> PullView {
return try await postGitReposByNamePullsByNumberMergeWithRequestBuilder(name: name, number: number, apiConfiguration: apiConfiguration).execute().body
}
/**
Merges an open pull request by FAST-FORWARDING base to head, and answers the proposal in its merged state with the revision base now points at.
- POST /v1/git/repos/{name}/pulls/{number}/merge
- Merges an open pull request by FAST-FORWARDING base to head, and answers the proposal in its merged state with the revision base now points at. It merges only when base is already an ancestor of head — the case where head contains every commit base has, so moving the branch loses nothing and invents nothing. When base has moved on independently, this REFUSES with 409 and says so: a real three-way merge is not implemented here, and reporting one would claim a result these bytes do not produce. Rebase head onto base and merge again. The move is judged by the same ref policy a `git push` of it would face, and fires the same build and notify reactions, so merging is not a way around either. Merging an already-merged proposal is a 409.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo, from the :name path segment.
- parameter number: (path) Number is the proposal&#39;s per-repo number, from the :number path segment.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<PullView>
*/
open class func postGitReposByNamePullsByNumberMergeWithRequestBuilder(name: String, number: Int64, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<PullView> {
var localVariablePath = "/v1/git/repos/{name}/pulls/{number}/merge"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let numberPreEscape = "\(APIHelper.mapValueToPathItem(number))"
let numberPostEscape = numberPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{number}", with: numberPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<PullView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Lands a set of files as one commit without a git client — the hanzo.app builder's push.
- parameter name: (path) Name is the repo to push into, from the :name path segment. It is CREATED on first push if it does not exist.
- parameter pushReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: PushResp
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitReposByNamePush(name: String, pushReq: PushReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> PushResp {
return try await postGitReposByNamePushWithRequestBuilder(name: name, pushReq: pushReq, apiConfiguration: apiConfiguration).execute().body
}
/**
Lands a set of files as one commit without a git client — the hanzo.app builder's push.
- POST /v1/git/repos/{name}/push
- Lands a set of files as one commit without a git client — the hanzo.app builder's push. The repo is CREATED on first push, the files are merged onto the branch tip (unlisted files survive), and the same push-to-deploy hook a real receive-pack fires is fired, so downstream this is indistinguishable from a `git push`.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo to push into, from the :name path segment. It is CREATED on first push if it does not exist.
- parameter pushReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<PushResp>
*/
open class func postGitReposByNamePushWithRequestBuilder(name: String, pushReq: PushReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<PushResp> {
var localVariablePath = "/v1/git/repos/{name}/push"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pushReq, codableHelper: apiConfiguration.codableHelper)
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/json",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<PushResp>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Binds a Slack channel to a repo, so the lifecycle notifier posts that repo's push and deploy events there.
- parameter name: (path) Name is the repo to subscribe, from the :name path segment.
- parameter subscribeReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: SubscriptionView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitReposByNameSubscriptions(name: String, subscribeReq: SubscribeReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> SubscriptionView {
return try await postGitReposByNameSubscriptionsWithRequestBuilder(name: name, subscribeReq: subscribeReq, apiConfiguration: apiConfiguration).execute().body
}
/**
Binds a Slack channel to a repo, so the lifecycle notifier posts that repo's push and deploy events there.
- POST /v1/git/repos/{name}/subscriptions
- Binds a Slack channel to a repo, so the lifecycle notifier posts that repo's push and deploy events there. Answers 201. The same channel twice on one repo is a 409; a repo outside the caller's scope is a 404, exactly as reading it is.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo to subscribe, from the :name path segment.
- parameter subscribeReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<SubscriptionView>
*/
open class func postGitReposByNameSubscriptionsWithRequestBuilder(name: String, subscribeReq: SubscribeReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<SubscriptionView> {
var localVariablePath = "/v1/git/repos/{name}/subscriptions"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: subscribeReq, codableHelper: apiConfiguration.codableHelper)
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/json",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<SubscriptionView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Registers a downstream remote the repo's advanced refs are pushed to whenever a push lands here.
- parameter name: (path) Name is the repo whose advanced refs are pushed downstream, from the :name path segment.
- parameter mirrorTargetReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: MirrorTargetView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitReposByNameTargets(name: String, mirrorTargetReq: MirrorTargetReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> MirrorTargetView {
return try await postGitReposByNameTargetsWithRequestBuilder(name: name, mirrorTargetReq: mirrorTargetReq, apiConfiguration: apiConfiguration).execute().body
}
/**
Registers a downstream remote the repo's advanced refs are pushed to whenever a push lands here.
- POST /v1/git/repos/{name}/targets
- Registers a downstream remote the repo's advanced refs are pushed to whenever a push lands here. Answers 201. The URL must be https to a host on the mirror allowlist (github.com / gitlab.com): the same set the mirror credential may be sent to, so a target can never capture the shared token or point the push at an internal service. Any embedded userinfo is stripped — credentials ride env-only at push time and never enter the stored URL. One mirror per host per repo; a second is a 409.
- Bearer Token:
- type: http
- name: bearer
- parameter name: (path) Name is the repo whose advanced refs are pushed downstream, from the :name path segment.
- parameter mirrorTargetReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<MirrorTargetView>
*/
open class func postGitReposByNameTargetsWithRequestBuilder(name: String, mirrorTargetReq: MirrorTargetReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<MirrorTargetView> {
var localVariablePath = "/v1/git/repos/{name}/targets"
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: mirrorTargetReq, codableHelper: apiConfiguration.codableHelper)
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/json",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<MirrorTargetView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Retired — push-to-deploy has no inbound webhook
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postGitWebhook(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await postGitWebhookWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
}
/**
Retired — push-to-deploy has no inbound webhook
- POST /v1/git/webhook
- GONE (410). Push-to-deploy is not triggered by an inbound webhook. A push into this host's own git server fires the builder in-process, and a repository whose canonical home is GitHub is delivered by the Hanzo Platform GitHub App to POST /v1/integration/github/webhook. The forge does not report a push over HTTP. Every delivery answers 410 whatever it carries — this endpoint reads no body and authenticates nothing. 410 rather than 404, because the address was real and its meaning moved, which is the distinction 410 carries. A 404 from this estate is ambiguous: Hanzo Git serves /v1, so /api/v1 404s too and reads as \"the API is switched off\". A retired endpoint says it is retired and names its replacement, so the answer carries its own fix.
- Bearer Token:
- type: http
- name: bearer
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func postGitWebhookWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
let localVariablePath = "/v1/git/webhook"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
}