Files

104 KiB

\GitAPI

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
DeleteGitReposByName Delete /v1/git/repos/{name} Removes a repo's metadata and purges its storage.
DeleteGitReposByNameSubscriptionsById 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.
DeleteGitReposByNameTargetsById Delete /v1/git/repos/{name}/targets/{id} Removes one outbound mirror target; later pushes stop being forwarded to it.
GetGit Get /v1/git Browse your org's repositories
GetGitActivity Get /v1/git/activity Answers the estate's last 365 days: distinct commits, merges, active repositories and contributors, for the whole estate, each group and each org, a commit count per day, the newest public commits, and one page of public repositories.
GetGitByOrgByProjectByRepoInfoRefs Get /v1/git/{org}/{project}/{repo}/info/refs Advertise a repository's refs to a git client
GetGitByOrgByRepo Get /v1/git/{org}/{repo} Open a repository's home page
GetGitByOrgByRepoCommits Get /v1/git/{org}/{repo}/commits Read a repository's commit log
GetGitByOrgByRepoInfoRefs Get /v1/git/{org}/{repo}/info/refs Advertise a repository's refs to a git client
GetGitExplore Get /v1/git/explore Discover public repositories across every org
GetGitPools Get /v1/git/pools Returns the capacity this org has declared and how many daemons have entered each pool.
GetGitRepos Get /v1/git/repos Returns the repos in the caller's scope, most recently updated first.
GetGitReposByName Get /v1/git/repos/{name} Returns one repo with its live ref state: every branch name and the resolved HEAD commit.
GetGitReposByNameBlob Get /v1/git/repos/{name}/blob Returns one file's bytes at one revision.
GetGitReposByNameCommits Get /v1/git/repos/{name}/commits Walks a ref's history newest first, or one path's history when a path is given.
GetGitReposByNameFiles Get /v1/git/repos/{name}/files Returns every file a glob selects at one revision, WITH its bytes and the revision they came from.
GetGitReposByNamePulls 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.
GetGitReposByNamePullsByNumber Get /v1/git/repos/{name}/pulls/{number} Returns one pull request by its per-repo number.
GetGitReposByNameReadme 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.
GetGitReposByNameRefs Get /v1/git/repos/{name}/refs Lists a repo's branches, tags and default branch — what a branch picker needs in one call.
GetGitReposByNameSubscriptions 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.
GetGitReposByNameTargets 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.
GetGitReposByNameTree Get /v1/git/repos/{name}/tree Lists the immediate children of one directory at one revision, directories before files.
GetGitRunners Get /v1/git/runners Returns the daemons registered into this org's pools, newest first, with when each was last heard from.
GetGitRuns Get /v1/git/runs Returns this org's runs, newest first.
GetGitRunsById Get /v1/git/runs/{id} Returns one run.
GetGitUsage 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.
GetGitWorkflows Get /v1/git/workflows Reports the workflows a repository declares at a ref and which declared pool would execute each job — the answer to "would a push here run, and where".
PatchGitReposByName Patch /v1/git/repos/{name} Flips a repo's public bit, the one mutable repo setting today.
PostGitByOrgByProjectByRepoGitReceivePack Post /v1/git/{org}/{project}/{repo}/git-receive-pack Accept a push, and turn it into a build
PostGitByOrgByProjectByRepoGitUploadPack Post /v1/git/{org}/{project}/{repo}/git-upload-pack Serve a clone or fetch
PostGitByOrgByRepoGitReceivePack Post /v1/git/{org}/{repo}/git-receive-pack Accept a push, and turn it into a build
PostGitByOrgByRepoGitUploadPack Post /v1/git/{org}/{repo}/git-upload-pack Serve a clone or fetch
PostGitLink Post /v1/git/link Links every repository of the caller's org that holds no history here and names no link to github.com/<owner>/<name>, where GitHub lets the caller read it.
PostGitPools Post /v1/git/pools Records the capacity an org has, and answers with the secret a runner daemon presents to enter it.
PostGitRepos Post /v1/git/repos Provisions an empty bare repository in the caller's scope and returns it with its clone URLs.
PostGitReposByNameGc 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.
PostGitReposByNameHome Post /v1/git/repos/{name}/home Moves a repository whose history is HERE to the forge (git.hanzo.ai), the one home of a repository no other host holds, and links it there: the repository is made in the org's own namespace on the forge, every branch and tag is pushed to it, the forge's refs are read back and must equal these, and only then does the row name the forge as its link, so this copy becomes the cache it can be fetched back into.
PostGitReposByNameLink Post /v1/git/repos/{name}/link Records that a repository's history lives on another host, making the repository first when the org has none of that name.
PostGitReposByNamePulls Post /v1/git/repos/{name}/pulls Proposes a branch for merging and returns it with its number.
PostGitReposByNamePullsByNumberMerge 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.
PostGitReposByNamePush Post /v1/git/repos/{name}/push Lands a set of files as one commit without a git client — the hanzo.app builder's push.
PostGitReposByNameSubscriptions 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.
PostGitReposByNameTargets Post /v1/git/repos/{name}/targets Registers a downstream remote the repo's advanced refs are pushed to whenever a push lands here.
PostGitRuns Post /v1/git/runs Runs a repository's workflows at a ref, on demand.
PostGitWebhook Post /v1/git/webhook Retired — push-to-deploy has no inbound webhook
PostGitWorkspace Post /v1/git/workspace Sets the org's code workspace up for the caller and answers it: the namespace, made when the org has none, and the caller's forge account and seat there.
PostRunnerDeclare Post /v1/runner/declare Republishes what a registered runner can do, and answers with what this side understands, so the two learn about each other from one exchange.
PostRunnerLog Post /v1/runner/log Adds console output to a task's log and answers with how far that log is durable, so the runner knows where to resend from.
PostRunnerRegister Post /v1/runner/register Trades a pool's join secret for a runner identity and the token that authenticates every later call.
PostRunnerState Post /v1/runner/state Records a task's progress and that of its steps, and answers with the result this side now holds — which is how a runner learns its task was stopped from somewhere else.
PostRunnerTask Post /v1/runner/task Hands the runner a job to execute, if its pool has one, and answers immediately either way.

DeleteGitReposByName

DeleteGitReposByName(ctx, name).Execute()

Removes a repo's metadata and purges its storage.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo's org-unique handle, from the :name path segment. A trailing \".git\" is stripped.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.DeleteGitReposByName(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.DeleteGitReposByName``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo's org-unique handle, from the :name path segment. A trailing &quot;.git&quot; is stripped.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteGitReposByNameRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteGitReposByNameSubscriptionsById

DeleteGitReposByNameSubscriptionsById(ctx, name, id).Execute()

Removes one Slack subscription from a repo; the notifier stops posting that repo's events to that channel.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo, from the :name path segment.
	id := "sub_7c2e" // string | ID is the row to remove, from the :id path segment.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.DeleteGitReposByNameSubscriptionsById(context.Background(), name, id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.DeleteGitReposByNameSubscriptionsById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo, from the :name path segment.
id string ID is the row to remove, from the :id path segment.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteGitReposByNameSubscriptionsByIdRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteGitReposByNameTargetsById

DeleteGitReposByNameTargetsById(ctx, name, id).Execute()

Removes one outbound mirror target; later pushes stop being forwarded to it.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo, from the :name path segment.
	id := "mir_2d90" // string | ID is the row to remove, from the :id path segment.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.DeleteGitReposByNameTargetsById(context.Background(), name, id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.DeleteGitReposByNameTargetsById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo, from the :name path segment.
id string ID is the row to remove, from the :id path segment.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteGitReposByNameTargetsByIdRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGit

GetGit(ctx).Execute()

Browse your org's repositories

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.GetGit(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGit``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitRequest struct via the builder pattern

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitActivity

GitActivityOut GetGitActivity(ctx).Org(org).Group(group).Page(page).Limit(limit).Execute()

Answers the estate's last 365 days: distinct commits, merges, active repositories and contributors, for the whole estate, each group and each org, a commit count per day, the newest public commits, and one page of public repositories.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	org := "org_example" // string | Org lists one org's repositories; empty lists every org's. (optional)
	group := "lux" // string | Group lists one group's repositories (hanzo, lux, zoo); empty lists every group's. (optional)
	page := int64(1) // int64 | Page is the repository page, from 1. Anything not positive means 1. (optional)
	limit := int64(20) // int64 | Limit is the page size. Anything not positive means 50; the cap is 200. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitActivity(context.Background()).Org(org).Group(group).Page(page).Limit(limit).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitActivity``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitActivity`: GitActivityOut
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitActivity`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetGitActivityRequest struct via the builder pattern

Name Type Description Notes
org string Org lists one org's repositories; empty lists every org's.
group string Group lists one group's repositories (hanzo, lux, zoo); empty lists every group's.
page int64 Page is the repository page, from 1. Anything not positive means 1.
limit int64 Limit is the page size. Anything not positive means 50; the cap is 200.

Return type

GitActivityOut

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitByOrgByProjectByRepoInfoRefs

GetGitByOrgByProjectByRepoInfoRefs(ctx, org, project, repo).Execute()

Advertise a repository's refs to a git client

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	org := "org_example" // string | 
	project := "project_example" // string | 
	repo := "repo_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.GetGitByOrgByProjectByRepoInfoRefs(context.Background(), org, project, repo).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitByOrgByProjectByRepoInfoRefs``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
org string
project string
repo string

Other Parameters

Other parameters are passed through a pointer to a apiGetGitByOrgByProjectByRepoInfoRefsRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitByOrgByRepo

GetGitByOrgByRepo(ctx, org, repo).Execute()

Open a repository's home page

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	org := "org_example" // string | 
	repo := "repo_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.GetGitByOrgByRepo(context.Background(), org, repo).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitByOrgByRepo``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
org string
repo string

Other Parameters

Other parameters are passed through a pointer to a apiGetGitByOrgByRepoRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitByOrgByRepoCommits

GetGitByOrgByRepoCommits(ctx, org, repo).Execute()

Read a repository's commit log

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	org := "org_example" // string | 
	repo := "repo_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.GetGitByOrgByRepoCommits(context.Background(), org, repo).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitByOrgByRepoCommits``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
org string
repo string

Other Parameters

Other parameters are passed through a pointer to a apiGetGitByOrgByRepoCommitsRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitByOrgByRepoInfoRefs

GetGitByOrgByRepoInfoRefs(ctx, org, repo).Execute()

Advertise a repository's refs to a git client

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	org := "org_example" // string | 
	repo := "repo_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.GetGitByOrgByRepoInfoRefs(context.Background(), org, repo).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitByOrgByRepoInfoRefs``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
org string
repo string

Other Parameters

Other parameters are passed through a pointer to a apiGetGitByOrgByRepoInfoRefsRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitExplore

GetGitExplore(ctx).Execute()

Discover public repositories across every org

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.GetGitExplore(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitExplore``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitExploreRequest struct via the builder pattern

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitPools

GitPoolList GetGitPools(ctx).Execute()

Returns the capacity this org has declared and how many daemons have entered each pool.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitPools(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitPools``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitPools`: GitPoolList
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitPools`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitPoolsRequest struct via the builder pattern

Return type

GitPoolList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitRepos

GitRepoList GetGitRepos(ctx).Execute()

Returns the repos in the caller's scope, most recently updated first.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitRepos(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitRepos``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitRepos`: GitRepoList
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitRepos`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitReposRequest struct via the builder pattern

Return type

GitRepoList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitReposByName

GitRepoView GetGitReposByName(ctx, name).Execute()

Returns one repo with its live ref state: every branch name and the resolved HEAD commit.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo's org-unique handle, from the :name path segment. A trailing \".git\" is stripped.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitReposByName(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitReposByName``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitReposByName`: GitRepoView
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitReposByName`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo's org-unique handle, from the :name path segment. A trailing &quot;.git&quot; is stripped.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitReposByNameRequest struct via the builder pattern

Name Type Description Notes

Return type

GitRepoView

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitReposByNameBlob

GitBlobJSON GetGitReposByNameBlob(ctx, name).Ref(ref).Path(path).Execute()

Returns one file's bytes at one revision.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo to read, from the :name path segment.
	ref := "main" // string | Ref is a branch, tag or commit; empty means the repo's HEAD. (optional)
	path := "go.mod" // string | Path is repo-relative; empty is the tree root. Traversal is stripped. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitReposByNameBlob(context.Background(), name).Ref(ref).Path(path).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitReposByNameBlob``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitReposByNameBlob`: GitBlobJSON
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitReposByNameBlob`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo to read, from the :name path segment.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitReposByNameBlobRequest struct via the builder pattern

Name Type Description Notes

ref | string | Ref is a branch, tag or commit; empty means the repo's HEAD. | path | string | Path is repo-relative; empty is the tree root. Traversal is stripped. |

Return type

GitBlobJSON

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitReposByNameCommits

GitCommitsJSON GetGitReposByNameCommits(ctx, name).Ref(ref).Path(path).Limit(limit).Execute()

Walks a ref's history newest first, or one path's history when a path is given.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo to read, from the :name path segment.
	ref := "main" // string | Ref is the branch, tag or commit to walk back from; empty means HEAD. (optional)
	path := "path_example" // string | Path narrows the history to commits touching it; empty walks the whole ref. (optional)
	limit := int64(2) // int64 | Limit caps the page. Anything not positive means 50; the cap is 100. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitReposByNameCommits(context.Background(), name).Ref(ref).Path(path).Limit(limit).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitReposByNameCommits``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitReposByNameCommits`: GitCommitsJSON
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitReposByNameCommits`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo to read, from the :name path segment.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitReposByNameCommitsRequest struct via the builder pattern

Name Type Description Notes

ref | string | Ref is the branch, tag or commit to walk back from; empty means HEAD. | path | string | Path narrows the history to commits touching it; empty walks the whole ref. | limit | int64 | Limit caps the page. Anything not positive means 50; the cap is 100. |

Return type

GitCommitsJSON

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitReposByNameFiles

GitFilesJSON GetGitReposByNameFiles(ctx, name).Ref(ref).Glob(glob).Execute()

Returns every file a glob selects at one revision, WITH its bytes and the revision they came from.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "universe" // string | Name is the repo to read, from the :name path segment.
	ref := "main" // string | Ref is a branch, tag or commit; empty means the repo's HEAD. (optional)
	glob := "charts/app/values/*/*.yaml" // string | Glob selects files, matched segment by segment so `*` never crosses a `/`. `**` matches zero or more whole segments. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitReposByNameFiles(context.Background(), name).Ref(ref).Glob(glob).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitReposByNameFiles``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitReposByNameFiles`: GitFilesJSON
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitReposByNameFiles`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo to read, from the :name path segment.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitReposByNameFilesRequest struct via the builder pattern

Name Type Description Notes

ref | string | Ref is a branch, tag or commit; empty means the repo's HEAD. | glob | string | Glob selects files, matched segment by segment so `*` never crosses a `/`. `**` matches zero or more whole segments. |

Return type

GitFilesJSON

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitReposByNamePulls

GitPullList GetGitReposByNamePulls(ctx, name).State(state).Execute()

Returns a repo's pull requests, newest number first — what is waiting to be reviewed, and what has already landed.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo, from the :name path segment.
	state := "open" // string | State narrows the list to \"open\" or \"merged\". Omit it for every proposal. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitReposByNamePulls(context.Background(), name).State(state).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitReposByNamePulls``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitReposByNamePulls`: GitPullList
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitReposByNamePulls`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo, from the :name path segment.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitReposByNamePullsRequest struct via the builder pattern

Name Type Description Notes

state | string | State narrows the list to &quot;open&quot; or &quot;merged&quot;. Omit it for every proposal. |

Return type

GitPullList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitReposByNamePullsByNumber

GitPullView GetGitReposByNamePullsByNumber(ctx, name, number).Execute()

Returns one pull request by its per-repo number.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo, from the :name path segment.
	number := int64(4) // int64 | Number is the proposal's per-repo number, from the :number path segment.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitReposByNamePullsByNumber(context.Background(), name, number).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitReposByNamePullsByNumber``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitReposByNamePullsByNumber`: GitPullView
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitReposByNamePullsByNumber`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo, from the :name path segment.
number int64 Number is the proposal's per-repo number, from the :number path segment.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitReposByNamePullsByNumberRequest struct via the builder pattern

Name Type Description Notes

Return type

GitPullView

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitReposByNameReadme

GitReadmeJSON GetGitReposByNameReadme(ctx, name).Ref(ref).Execute()

Returns the README at the tree root as plain text — unrendered, so the caller decides how to present it.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo to read, from the :name path segment.
	ref := "main" // string | Ref is a branch, tag or commit; empty means the repo's HEAD. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitReposByNameReadme(context.Background(), name).Ref(ref).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitReposByNameReadme``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitReposByNameReadme`: GitReadmeJSON
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitReposByNameReadme`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo to read, from the :name path segment.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitReposByNameReadmeRequest struct via the builder pattern

Name Type Description Notes

ref | string | Ref is a branch, tag or commit; empty means the repo's HEAD. |

Return type

GitReadmeJSON

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitReposByNameRefs

GitRefsJSON GetGitReposByNameRefs(ctx, name).Execute()

Lists a repo's branches, tags and default branch — what a branch picker needs in one call.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo's org-unique handle, from the :name path segment. A trailing \".git\" is stripped.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitReposByNameRefs(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitReposByNameRefs``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitReposByNameRefs`: GitRefsJSON
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitReposByNameRefs`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo's org-unique handle, from the :name path segment. A trailing &quot;.git&quot; is stripped.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitReposByNameRefsRequest struct via the builder pattern

Name Type Description Notes

Return type

GitRefsJSON

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitReposByNameSubscriptions

GitSubscriptionList GetGitReposByNameSubscriptions(ctx, name).Execute()

Returns a repo's Slack subscriptions — which channels the lifecycle notifier posts this repo's push and deploy events to.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo's org-unique handle, from the :name path segment. A trailing \".git\" is stripped.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitReposByNameSubscriptions(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitReposByNameSubscriptions``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitReposByNameSubscriptions`: GitSubscriptionList
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitReposByNameSubscriptions`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo's org-unique handle, from the :name path segment. A trailing &quot;.git&quot; is stripped.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitReposByNameSubscriptionsRequest struct via the builder pattern

Name Type Description Notes

Return type

GitSubscriptionList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitReposByNameTargets

GitMirrorList GetGitReposByNameTargets(ctx, name).Execute()

Returns a repo's outbound mirror targets — the downstream remotes the mirror reactor pushes to whenever a push lands here.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo's org-unique handle, from the :name path segment. A trailing \".git\" is stripped.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitReposByNameTargets(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitReposByNameTargets``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitReposByNameTargets`: GitMirrorList
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitReposByNameTargets`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo's org-unique handle, from the :name path segment. A trailing &quot;.git&quot; is stripped.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitReposByNameTargetsRequest struct via the builder pattern

Name Type Description Notes

Return type

GitMirrorList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitReposByNameTree

GitTreeJSON GetGitReposByNameTree(ctx, name).Ref(ref).Path(path).Execute()

Lists the immediate children of one directory at one revision, directories before files.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo to read, from the :name path segment.
	ref := "main" // string | Ref is a branch, tag or commit; empty means the repo's HEAD. (optional)
	path := "cmd" // string | Path is repo-relative; empty is the tree root. Traversal is stripped. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitReposByNameTree(context.Background(), name).Ref(ref).Path(path).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitReposByNameTree``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitReposByNameTree`: GitTreeJSON
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitReposByNameTree`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo to read, from the :name path segment.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitReposByNameTreeRequest struct via the builder pattern

Name Type Description Notes

ref | string | Ref is a branch, tag or commit; empty means the repo's HEAD. | path | string | Path is repo-relative; empty is the tree root. Traversal is stripped. |

Return type

GitTreeJSON

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitRunners

GitRunnerList GetGitRunners(ctx).Execute()

Returns the daemons registered into this org's pools, newest first, with when each was last heard from.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitRunners(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitRunners``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitRunners`: GitRunnerList
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitRunners`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitRunnersRequest struct via the builder pattern

Return type

GitRunnerList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitRuns

GitWorkflowRuns GetGitRuns(ctx).Repo(repo).Limit(limit).Execute()

Returns this org's runs, newest first.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	repo := "repo_example" // string | Repo restricts the listing to one repository. Empty lists the whole org. (optional)
	limit := int64(789) // int64 | Limit caps the answer; 0 means the default of 50, and 200 is the ceiling. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitRuns(context.Background()).Repo(repo).Limit(limit).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitRuns``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitRuns`: GitWorkflowRuns
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitRuns`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetGitRunsRequest struct via the builder pattern

Name Type Description Notes
repo string Repo restricts the listing to one repository. Empty lists the whole org.
limit int64 Limit caps the answer; 0 means the default of 50, and 200 is the ceiling.

Return type

GitWorkflowRuns

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitRunsById

GitWorkflowRun GetGitRunsById(ctx, id).Execute()

Returns one run.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	id := "id_example" // string | ID is the run to read, from the :id path segment.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitRunsById(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitRunsById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitRunsById`: GitWorkflowRun
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitRunsById`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID is the run to read, from the :id path segment.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitRunsByIdRequest struct via the builder pattern

Name Type Description Notes

Return type

GitWorkflowRun

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitUsage

GitUsageView GetGitUsage(ctx).Execute()

Returns per-repo and total storage bytes for the caller's org — the queryable, per-tenant number commerce and o11y meter on.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitUsage(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitUsage``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitUsage`: GitUsageView
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitUsage`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetGitUsageRequest struct via the builder pattern

Return type

GitUsageView

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGitWorkflows

GitWorkflowList GetGitWorkflows(ctx).Repo(repo).Ref(ref).Execute()

Reports the workflows a repository declares at a ref and which declared pool would execute each job — the answer to "would a push here run, and where".

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	repo := "repo_example" // string | Repo is the repository whose workflows to read. (optional)
	ref := "ref_example" // string | Ref is the branch to read them at; empty means the default. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.GetGitWorkflows(context.Background()).Repo(repo).Ref(ref).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.GetGitWorkflows``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetGitWorkflows`: GitWorkflowList
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.GetGitWorkflows`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetGitWorkflowsRequest struct via the builder pattern

Name Type Description Notes
repo string Repo is the repository whose workflows to read.
ref string Ref is the branch to read them at; empty means the default.

Return type

GitWorkflowList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PatchGitReposByName

GitRepoView PatchGitReposByName(ctx, name).GitPatchIn(gitPatchIn).Execute()

Flips a repo's public bit, the one mutable repo setting today.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo to update, from the :name path segment.
	gitPatchIn := *openapiclient.NewGitPatchIn() // GitPatchIn | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PatchGitReposByName(context.Background(), name).GitPatchIn(gitPatchIn).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PatchGitReposByName``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PatchGitReposByName`: GitRepoView
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PatchGitReposByName`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo to update, from the :name path segment.

Other Parameters

Other parameters are passed through a pointer to a apiPatchGitReposByNameRequest struct via the builder pattern

Name Type Description Notes

gitPatchIn | GitPatchIn | |

Return type

GitRepoView

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitByOrgByProjectByRepoGitReceivePack

PostGitByOrgByProjectByRepoGitReceivePack(ctx, org, project, repo).Body(body).Execute()

Accept a push, and turn it into a build

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	org := "org_example" // string | 
	project := "project_example" // string | 
	repo := "repo_example" // string | 
	body := os.NewFile(1234, "some_file") // *os.File |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.PostGitByOrgByProjectByRepoGitReceivePack(context.Background(), org, project, repo).Body(body).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitByOrgByProjectByRepoGitReceivePack``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
org string
project string
repo string

Other Parameters

Other parameters are passed through a pointer to a apiPostGitByOrgByProjectByRepoGitReceivePackRequest struct via the builder pattern

Name Type Description Notes

body | *os.File | |

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: application/octet-stream
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitByOrgByProjectByRepoGitUploadPack

PostGitByOrgByProjectByRepoGitUploadPack(ctx, org, project, repo).Body(body).Execute()

Serve a clone or fetch

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	org := "org_example" // string | 
	project := "project_example" // string | 
	repo := "repo_example" // string | 
	body := os.NewFile(1234, "some_file") // *os.File |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.PostGitByOrgByProjectByRepoGitUploadPack(context.Background(), org, project, repo).Body(body).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitByOrgByProjectByRepoGitUploadPack``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
org string
project string
repo string

Other Parameters

Other parameters are passed through a pointer to a apiPostGitByOrgByProjectByRepoGitUploadPackRequest struct via the builder pattern

Name Type Description Notes

body | *os.File | |

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: application/octet-stream
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitByOrgByRepoGitReceivePack

PostGitByOrgByRepoGitReceivePack(ctx, org, repo).Body(body).Execute()

Accept a push, and turn it into a build

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	org := "org_example" // string | 
	repo := "repo_example" // string | 
	body := os.NewFile(1234, "some_file") // *os.File |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.PostGitByOrgByRepoGitReceivePack(context.Background(), org, repo).Body(body).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitByOrgByRepoGitReceivePack``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
org string
repo string

Other Parameters

Other parameters are passed through a pointer to a apiPostGitByOrgByRepoGitReceivePackRequest struct via the builder pattern

Name Type Description Notes

body | *os.File | |

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: application/octet-stream
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitByOrgByRepoGitUploadPack

PostGitByOrgByRepoGitUploadPack(ctx, org, repo).Body(body).Execute()

Serve a clone or fetch

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	org := "org_example" // string | 
	repo := "repo_example" // string | 
	body := os.NewFile(1234, "some_file") // *os.File |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.PostGitByOrgByRepoGitUploadPack(context.Background(), org, repo).Body(body).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitByOrgByRepoGitUploadPack``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
org string
repo string

Other Parameters

Other parameters are passed through a pointer to a apiPostGitByOrgByRepoGitUploadPackRequest struct via the builder pattern

Name Type Description Notes

body | *os.File | |

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: application/octet-stream
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GitLinked PostGitLink(ctx).GitLinkAll(gitLinkAll).Execute()

Links every repository of the caller's org that holds no history here and names no link to github.com//, where GitHub lets the caller read it.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	gitLinkAll := *openapiclient.NewGitLinkAll() // GitLinkAll | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitLink(context.Background()).GitLinkAll(gitLinkAll).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitLink``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitLink`: GitLinked
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitLink`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostGitLinkRequest struct via the builder pattern

Name Type Description Notes
gitLinkAll GitLinkAll

Return type

GitLinked

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitPools

GitPoolDeclared PostGitPools(ctx).GitPoolDeclare(gitPoolDeclare).Execute()

Records the capacity an org has, and answers with the secret a runner daemon presents to enter it.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	gitPoolDeclare := *openapiclient.NewGitPoolDeclare() // GitPoolDeclare | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitPools(context.Background()).GitPoolDeclare(gitPoolDeclare).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitPools``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitPools`: GitPoolDeclared
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitPools`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostGitPoolsRequest struct via the builder pattern

Name Type Description Notes
gitPoolDeclare GitPoolDeclare

Return type

GitPoolDeclared

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitRepos

GitRepoView PostGitRepos(ctx).GitCreateReq(gitCreateReq).Execute()

Provisions an empty bare repository in the caller's scope and returns it with its clone URLs.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	gitCreateReq := *openapiclient.NewGitCreateReq() // GitCreateReq | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitRepos(context.Background()).GitCreateReq(gitCreateReq).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitRepos``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitRepos`: GitRepoView
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitRepos`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostGitReposRequest struct via the builder pattern

Name Type Description Notes
gitCreateReq GitCreateReq

Return type

GitRepoView

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitReposByNameGc

GitGcOut PostGitReposByNameGc(ctx, name).Execute()

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.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo's org-unique handle, from the :name path segment. A trailing \".git\" is stripped.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitReposByNameGc(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitReposByNameGc``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitReposByNameGc`: GitGcOut
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitReposByNameGc`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo's org-unique handle, from the :name path segment. A trailing &quot;.git&quot; is stripped.

Other Parameters

Other parameters are passed through a pointer to a apiPostGitReposByNameGcRequest struct via the builder pattern

Name Type Description Notes

Return type

GitGcOut

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitReposByNameHome

GitRepoView PostGitReposByNameHome(ctx, name).Execute()

Moves a repository whose history is HERE to the forge (git.hanzo.ai), the one home of a repository no other host holds, and links it there: the repository is made in the org's own namespace on the forge, every branch and tag is pushed to it, the forge's refs are read back and must equal these, and only then does the row name the forge as its link, so this copy becomes the cache it can be fetched back into.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repository, from the :name path segment.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitReposByNameHome(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitReposByNameHome``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitReposByNameHome`: GitRepoView
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitReposByNameHome`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repository, from the :name path segment.

Other Parameters

Other parameters are passed through a pointer to a apiPostGitReposByNameHomeRequest struct via the builder pattern

Name Type Description Notes

Return type

GitRepoView

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GitRepoView PostGitReposByNameLink(ctx, name).GitLinkReq(gitLinkReq).Execute()

Records that a repository's history lives on another host, making the repository first when the org has none of that name.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repository, from the :name path segment. It is made when the org has none of that name.
	gitLinkReq := *openapiclient.NewGitLinkReq() // GitLinkReq | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitReposByNameLink(context.Background(), name).GitLinkReq(gitLinkReq).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitReposByNameLink``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitReposByNameLink`: GitRepoView
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitReposByNameLink`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repository, from the :name path segment. It is made when the org has none of that name.

Other Parameters

Other parameters are passed through a pointer to a apiPostGitReposByNameLinkRequest struct via the builder pattern

Name Type Description Notes

gitLinkReq | GitLinkReq | |

Return type

GitRepoView

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitReposByNamePulls

GitPullView PostGitReposByNamePulls(ctx, name).GitOpenReq(gitOpenReq).Execute()

Proposes a branch for merging and returns it with its number.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo the proposal belongs to, from the :name path segment.
	gitOpenReq := *openapiclient.NewGitOpenReq() // GitOpenReq | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitReposByNamePulls(context.Background(), name).GitOpenReq(gitOpenReq).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitReposByNamePulls``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitReposByNamePulls`: GitPullView
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitReposByNamePulls`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo the proposal belongs to, from the :name path segment.

Other Parameters

Other parameters are passed through a pointer to a apiPostGitReposByNamePullsRequest struct via the builder pattern

Name Type Description Notes

gitOpenReq | GitOpenReq | |

Return type

GitPullView

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitReposByNamePullsByNumberMerge

GitPullView PostGitReposByNamePullsByNumberMerge(ctx, name, number).Execute()

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.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo, from the :name path segment.
	number := int64(4) // int64 | Number is the proposal's per-repo number, from the :number path segment.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitReposByNamePullsByNumberMerge(context.Background(), name, number).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitReposByNamePullsByNumberMerge``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitReposByNamePullsByNumberMerge`: GitPullView
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitReposByNamePullsByNumberMerge`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo, from the :name path segment.
number int64 Number is the proposal's per-repo number, from the :number path segment.

Other Parameters

Other parameters are passed through a pointer to a apiPostGitReposByNamePullsByNumberMergeRequest struct via the builder pattern

Name Type Description Notes

Return type

GitPullView

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitReposByNamePush

GitPushResp PostGitReposByNamePush(ctx, name).GitPushReq(gitPushReq).Execute()

Lands a set of files as one commit without a git client — the hanzo.app builder's push.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo to push into, from the :name path segment. It is CREATED on first push if it does not exist.
	gitPushReq := *openapiclient.NewGitPushReq() // GitPushReq | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitReposByNamePush(context.Background(), name).GitPushReq(gitPushReq).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitReposByNamePush``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitReposByNamePush`: GitPushResp
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitReposByNamePush`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo to push into, from the :name path segment. It is CREATED on first push if it does not exist.

Other Parameters

Other parameters are passed through a pointer to a apiPostGitReposByNamePushRequest struct via the builder pattern

Name Type Description Notes

gitPushReq | GitPushReq | |

Return type

GitPushResp

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitReposByNameSubscriptions

GitSubscriptionView PostGitReposByNameSubscriptions(ctx, name).GitSubscribeReq(gitSubscribeReq).Execute()

Binds a Slack channel to a repo, so the lifecycle notifier posts that repo's push and deploy events there.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo to subscribe, from the :name path segment.
	gitSubscribeReq := *openapiclient.NewGitSubscribeReq() // GitSubscribeReq | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitReposByNameSubscriptions(context.Background(), name).GitSubscribeReq(gitSubscribeReq).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitReposByNameSubscriptions``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitReposByNameSubscriptions`: GitSubscriptionView
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitReposByNameSubscriptions`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo to subscribe, from the :name path segment.

Other Parameters

Other parameters are passed through a pointer to a apiPostGitReposByNameSubscriptionsRequest struct via the builder pattern

Name Type Description Notes

gitSubscribeReq | GitSubscribeReq | |

Return type

GitSubscriptionView

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitReposByNameTargets

GitMirrorTargetView PostGitReposByNameTargets(ctx, name).GitMirrorTargetReq(gitMirrorTargetReq).Execute()

Registers a downstream remote the repo's advanced refs are pushed to whenever a push lands here.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "widgets" // string | Name is the repo whose advanced refs are pushed downstream, from the :name path segment.
	gitMirrorTargetReq := *openapiclient.NewGitMirrorTargetReq() // GitMirrorTargetReq | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitReposByNameTargets(context.Background(), name).GitMirrorTargetReq(gitMirrorTargetReq).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitReposByNameTargets``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitReposByNameTargets`: GitMirrorTargetView
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitReposByNameTargets`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the repo whose advanced refs are pushed downstream, from the :name path segment.

Other Parameters

Other parameters are passed through a pointer to a apiPostGitReposByNameTargetsRequest struct via the builder pattern

Name Type Description Notes

gitMirrorTargetReq | GitMirrorTargetReq | |

Return type

GitMirrorTargetView

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitRuns

GitWorkflowRuns PostGitRuns(ctx).GitRunStart(gitRunStart).Execute()

Runs a repository's workflows at a ref, on demand.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	gitRunStart := *openapiclient.NewGitRunStart() // GitRunStart | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitRuns(context.Background()).GitRunStart(gitRunStart).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitRuns``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitRuns`: GitWorkflowRuns
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitRuns`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostGitRunsRequest struct via the builder pattern

Name Type Description Notes
gitRunStart GitRunStart

Return type

GitWorkflowRuns

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitWebhook

PostGitWebhook(ctx).Execute()

Retired — push-to-deploy has no inbound webhook

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.GitAPI.PostGitWebhook(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitWebhook``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiPostGitWebhookRequest struct via the builder pattern

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostGitWorkspace

GitWorkspaceView PostGitWorkspace(ctx).Execute()

Sets the org's code workspace up for the caller and answers it: the namespace, made when the org has none, and the caller's forge account and seat there.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostGitWorkspace(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostGitWorkspace``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostGitWorkspace`: GitWorkspaceView
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostGitWorkspace`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiPostGitWorkspaceRequest struct via the builder pattern

Return type

GitWorkspaceView

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostRunnerDeclare

RunnerDeclareOut PostRunnerDeclare(ctx).RunnerDeclareIn(runnerDeclareIn).XRunnerUuid(xRunnerUuid).XRunnerToken(xRunnerToken).Execute()

Republishes what a registered runner can do, and answers with what this side understands, so the two learn about each other from one exchange.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	runnerDeclareIn := *openapiclient.NewRunnerDeclareIn() // RunnerDeclareIn | 
	xRunnerUuid := "xRunnerUuid_example" // string |  (optional)
	xRunnerToken := "xRunnerToken_example" // string |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostRunnerDeclare(context.Background()).RunnerDeclareIn(runnerDeclareIn).XRunnerUuid(xRunnerUuid).XRunnerToken(xRunnerToken).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostRunnerDeclare``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostRunnerDeclare`: RunnerDeclareOut
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostRunnerDeclare`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostRunnerDeclareRequest struct via the builder pattern

Name Type Description Notes
runnerDeclareIn RunnerDeclareIn
xRunnerUuid string
xRunnerToken string

Return type

RunnerDeclareOut

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostRunnerLog

RunnerLogOut PostRunnerLog(ctx).RunnerLogIn(runnerLogIn).XRunnerUuid(xRunnerUuid).XRunnerToken(xRunnerToken).Execute()

Adds console output to a task's log and answers with how far that log is durable, so the runner knows where to resend from.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	runnerLogIn := *openapiclient.NewRunnerLogIn() // RunnerLogIn | 
	xRunnerUuid := "xRunnerUuid_example" // string |  (optional)
	xRunnerToken := "xRunnerToken_example" // string |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostRunnerLog(context.Background()).RunnerLogIn(runnerLogIn).XRunnerUuid(xRunnerUuid).XRunnerToken(xRunnerToken).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostRunnerLog``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostRunnerLog`: RunnerLogOut
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostRunnerLog`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostRunnerLogRequest struct via the builder pattern

Name Type Description Notes
runnerLogIn RunnerLogIn
xRunnerUuid string
xRunnerToken string

Return type

RunnerLogOut

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostRunnerRegister

RunnerRegisterOut PostRunnerRegister(ctx).RunnerRegisterIn(runnerRegisterIn).Execute()

Trades a pool's join secret for a runner identity and the token that authenticates every later call.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	runnerRegisterIn := *openapiclient.NewRunnerRegisterIn() // RunnerRegisterIn | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostRunnerRegister(context.Background()).RunnerRegisterIn(runnerRegisterIn).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostRunnerRegister``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostRunnerRegister`: RunnerRegisterOut
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostRunnerRegister`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostRunnerRegisterRequest struct via the builder pattern

Name Type Description Notes
runnerRegisterIn RunnerRegisterIn

Return type

RunnerRegisterOut

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostRunnerState

RunnerStateOut PostRunnerState(ctx).RunnerStateIn(runnerStateIn).XRunnerUuid(xRunnerUuid).XRunnerToken(xRunnerToken).Execute()

Records a task's progress and that of its steps, and answers with the result this side now holds — which is how a runner learns its task was stopped from somewhere else.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	runnerStateIn := *openapiclient.NewRunnerStateIn() // RunnerStateIn | 
	xRunnerUuid := "xRunnerUuid_example" // string |  (optional)
	xRunnerToken := "xRunnerToken_example" // string |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostRunnerState(context.Background()).RunnerStateIn(runnerStateIn).XRunnerUuid(xRunnerUuid).XRunnerToken(xRunnerToken).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostRunnerState``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostRunnerState`: RunnerStateOut
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostRunnerState`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostRunnerStateRequest struct via the builder pattern

Name Type Description Notes
runnerStateIn RunnerStateIn
xRunnerUuid string
xRunnerToken string

Return type

RunnerStateOut

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostRunnerTask

RunnerTaskOut PostRunnerTask(ctx).RunnerTaskIn(runnerTaskIn).XRunnerUuid(xRunnerUuid).XRunnerToken(xRunnerToken).Execute()

Hands the runner a job to execute, if its pool has one, and answers immediately either way.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	runnerTaskIn := *openapiclient.NewRunnerTaskIn() // RunnerTaskIn | 
	xRunnerUuid := "xRunnerUuid_example" // string |  (optional)
	xRunnerToken := "xRunnerToken_example" // string |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.GitAPI.PostRunnerTask(context.Background()).RunnerTaskIn(runnerTaskIn).XRunnerUuid(xRunnerUuid).XRunnerToken(xRunnerToken).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `GitAPI.PostRunnerTask``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostRunnerTask`: RunnerTaskOut
	fmt.Fprintf(os.Stdout, "Response from `GitAPI.PostRunnerTask`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostRunnerTaskRequest struct via the builder pattern

Name Type Description Notes
runnerTaskIn RunnerTaskIn
xRunnerUuid string
xRunnerToken string

Return type

RunnerTaskOut

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]