Files
sdk/api_task.go

1883 lines
69 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"bytes"
"context"
"io"
"net/http"
"net/url"
"strings"
)
// TaskAPIService TaskAPI service
type TaskAPIService service
type TaskAPIDeleteTaskProjectsByKeyRequest struct {
ctx context.Context
ApiService *TaskAPIService
key string
}
func (r TaskAPIDeleteTaskProjectsByKeyRequest) Execute() (*http.Response, error) {
return r.ApiService.DeleteTaskProjectsByKeyExecute(r)
}
/*
DeleteTaskProjectsByKey Refused — a board is a repository on the forge
Answers 405. A task board IS a repository on this deployment's forge, so creating, renaming and deleting one is a FORGE operation carried out with FORGE permissions.
Offering it here would put a second endpoint on the same object, guarded by this surface instead of by the forge — a weaker guard on the same thing. So the route exists and refuses, rather than 404ing: "not this service's job" and "no such thing" are different facts, and the body names the forge so a caller knows where the job IS done.
What this surface DOES own is the work on a board: list the boards you can see, read and file their issues, move a card between columns, and read the schedule a milestone is. Those are the routes beside this one.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param key
@return TaskAPIDeleteTaskProjectsByKeyRequest
*/
func (a *TaskAPIService) DeleteTaskProjectsByKey(ctx context.Context, key string) TaskAPIDeleteTaskProjectsByKeyRequest {
return TaskAPIDeleteTaskProjectsByKeyRequest{
ApiService: a,
ctx: ctx,
key: key,
}
}
// Execute executes the request
func (a *TaskAPIService) DeleteTaskProjectsByKeyExecute(r TaskAPIDeleteTaskProjectsByKeyRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.DeleteTaskProjectsByKey")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/projects/{key}"
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", url.PathEscape(parameterValueToString(r.key, "key")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type TaskAPIGetTaskBoardRequest struct {
ctx context.Context
ApiService *TaskAPIService
key *string
status *string
kind *string
repo *string
label *string
source *string
scheduled *bool
}
// Key is the project whose issues to list, from the path. EMPTY means every project in the org — the global board. It is a filter like the rest of this struct rather than an address, which is what lets one op answer both \"this board\" and \"all the work\" without a second surface disagreeing with the first about what a column is.
func (r TaskAPIGetTaskBoardRequest) Key(key string) TaskAPIGetTaskBoardRequest {
r.key = &key
return r
}
// Status keeps only issues in that board column: backlog, todo, in_progress, done or canceled. An unknown value is refused with 400.
func (r TaskAPIGetTaskBoardRequest) Status(status string) TaskAPIGetTaskBoardRequest {
r.status = &status
return r
}
// Kind keeps only work items of that shape: issue, pr or epic. An unknown value is refused with 400.
func (r TaskAPIGetTaskBoardRequest) Kind(kind string) TaskAPIGetTaskBoardRequest {
r.kind = &kind
return r
}
// Repo keeps only issues bound to that git repository.
func (r TaskAPIGetTaskBoardRequest) Repo(repo string) TaskAPIGetTaskBoardRequest {
r.repo = &repo
return r
}
// Label keeps only issues carrying that label, compared case-insensitively. This is how a board narrows to something SMALLER than a repository — the one mechanism for it. An estate whose apps are directories inside one repository (hanzoai/cloud carries ~140 of them) has no repository per app to address, so the app is a label: `label=app/meet` is the meet board. Nothing is provisioned to make one exist; a board is the query.
func (r TaskAPIGetTaskBoardRequest) Label(label string) TaskAPIGetTaskBoardRequest {
r.label = &label
return r
}
// Source keeps only issues opened from that surface: team, git, crm, helpdesk, cms or agent. An unknown value is refused with 400.
func (r TaskAPIGetTaskBoardRequest) Source(source string) TaskAPIGetTaskBoardRequest {
r.source = &source
return r
}
// Scheduled keeps only issues that carry a date — a start, a due date or both. This is the timeline's slice of the board: pass scheduled=true to get exactly the rows a gantt has somewhere to draw, instead of fetching every issue and discarding the undated ones client-side.
func (r TaskAPIGetTaskBoardRequest) Scheduled(scheduled bool) TaskAPIGetTaskBoardRequest {
r.scheduled = &scheduled
return r
}
func (r TaskAPIGetTaskBoardRequest) Execute() ([]TaskIssueView, *http.Response, error) {
return r.ApiService.GetTaskBoardExecute(r)
}
/*
GetTaskBoard Returns a board's issues — work items with their column, priority, assignee, labels and schedule.
Returns a board's issues — work items with their column, priority,
assignee, labels and schedule.
WHICH board is a filter, not an address. Bound to a repository (the key from
the path) it is that project's board; left unbound it is the org's whole
board; narrowed by label it is a board smaller than any repository — which is
the only way an app that lives as a directory inside a shared repository can
have one. Every combination is the same rows through the same projection, so
no two boards can disagree about what a column means.
The column is a LABEL on the forge, so the board and the forge web UI are the
same object seen twice: relabelling in either moves the card in both. A closed
issue reads as done whatever its labels say.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return TaskAPIGetTaskBoardRequest
*/
func (a *TaskAPIService) GetTaskBoard(ctx context.Context) TaskAPIGetTaskBoardRequest {
return TaskAPIGetTaskBoardRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return []TaskIssueView
func (a *TaskAPIService) GetTaskBoardExecute(r TaskAPIGetTaskBoardRequest) ([]TaskIssueView, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue []TaskIssueView
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.GetTaskBoard")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/board"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.key != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "key", r.key, "form", "")
}
if r.status != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "")
}
if r.kind != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "kind", r.kind, "form", "")
}
if r.repo != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "repo", r.repo, "form", "")
}
if r.label != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "label", r.label, "form", "")
}
if r.source != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "source", r.source, "form", "")
}
if r.scheduled != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "scheduled", r.scheduled, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type TaskAPIGetTaskChannelsByChannelRequest struct {
ctx context.Context
ApiService *TaskAPIService
channel string
}
func (r TaskAPIGetTaskChannelsByChannelRequest) Execute() (*TaskChannelWork, *http.Response, error) {
return r.ApiService.GetTaskChannelsByChannelExecute(r)
}
/*
GetTaskChannelsByChannel Summarises one channel's work.
Summarises one channel's work.
The channel is opaque here and is deliberately not resolved: this package cannot
say whether a channel exists — apps/team owns that document — so an unknown channel
answers an EMPTY board rather than a 404. That is the honest answer and the
useful one: a channel that has never had an item filed in it and a channel id
that was mistyped both have no work, and inventing a distinction would require
this surface to hold a second copy of the channel list (HIP-0523 §2 forbids it,
and it would drift the first time a channel was renamed).
Tenancy is the validated principal's org and nothing else, so a caller cannot
read another tenant's channel by naming its channel.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param channel Channel is the channel, spelled \"<space>_<channel>\" — the same value GET /v1/meet/call answers with, so a channel's call and its work name the channel identically. From the path.
@return TaskAPIGetTaskChannelsByChannelRequest
*/
func (a *TaskAPIService) GetTaskChannelsByChannel(ctx context.Context, channel string) TaskAPIGetTaskChannelsByChannelRequest {
return TaskAPIGetTaskChannelsByChannelRequest{
ApiService: a,
ctx: ctx,
channel: channel,
}
}
// Execute executes the request
//
// @return TaskChannelWork
func (a *TaskAPIService) GetTaskChannelsByChannelExecute(r TaskAPIGetTaskChannelsByChannelRequest) (*TaskChannelWork, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *TaskChannelWork
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.GetTaskChannelsByChannel")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/channels/{channel}"
localVarPath = strings.Replace(localVarPath, "{"+"channel"+"}", url.PathEscape(parameterValueToString(r.channel, "channel")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type TaskAPIGetTaskIssuesRequest struct {
ctx context.Context
ApiService *TaskAPIService
q *string
project *string
status *string
kind *string
repo *string
channel *string
source *string
assignee *string
limit *int64
}
// Q matches an issue&#39;s title or description. A word from the issue, which is what someone remembers — not its number, which is what they are looking up.
func (r TaskAPIGetTaskIssuesRequest) Q(q string) TaskAPIGetTaskIssuesRequest {
r.q = &q
return r
}
// Project narrows to one team key; \&quot;\&quot; searches every project in the org, which is the point of this op.
func (r TaskAPIGetTaskIssuesRequest) Project(project string) TaskAPIGetTaskIssuesRequest {
r.project = &project
return r
}
// Status keeps one board column: backlog, todo, in_progress, done, canceled.
func (r TaskAPIGetTaskIssuesRequest) Status(status string) TaskAPIGetTaskIssuesRequest {
r.status = &status
return r
}
// Kind keeps one shape: issue, pr, epic.
func (r TaskAPIGetTaskIssuesRequest) Kind(kind string) TaskAPIGetTaskIssuesRequest {
r.kind = &kind
return r
}
// Repo keeps issues bound to one git repository.
func (r TaskAPIGetTaskIssuesRequest) Repo(repo string) TaskAPIGetTaskIssuesRequest {
r.repo = &repo
return r
}
// Channel keeps issues bound to one collaboration channel, spelled \&quot;&lt;space&gt;_&lt;channel&gt;\&quot; — the exact value GET /v1/meet/call answers with, so a channel&#39;s call and its task list name the channel the same way. This is the read a channel view runs to draw its own list; it spans every board of the org, because the work a channel is about is not confined to one board.
func (r TaskAPIGetTaskIssuesRequest) Channel(channel string) TaskAPIGetTaskIssuesRequest {
r.channel = &channel
return r
}
// Source keeps one origin: team, git, crm, helpdesk, cms, agent. \&quot;git\&quot; is how you ask for the mirrored GitHub issues specifically.
func (r TaskAPIGetTaskIssuesRequest) Source(source string) TaskAPIGetTaskIssuesRequest {
r.source = &source
return r
}
// Assignee keeps issues held by one person. Pass \&quot;me\&quot; for yourself.
func (r TaskAPIGetTaskIssuesRequest) Assignee(assignee string) TaskAPIGetTaskIssuesRequest {
r.assignee = &assignee
return r
}
// Limit caps the answer; 0 means the default, and anything above the ceiling is clamped rather than refused — a search that errors on being too broad teaches people to guess.
func (r TaskAPIGetTaskIssuesRequest) Limit(limit int64) TaskAPIGetTaskIssuesRequest {
r.limit = &limit
return r
}
func (r TaskAPIGetTaskIssuesRequest) Execute() (*TaskIssueHits, *http.Response, error) {
return r.ApiService.GetTaskIssuesExecute(r)
}
/*
GetTaskIssues Answers across every project in the org.
Answers across every project in the org.
The org comes from the validated principal and never from the request: a
caller able to name the org could read another tenant's backlog, and a search
is exactly the shape that would quietly return it.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return TaskAPIGetTaskIssuesRequest
*/
func (a *TaskAPIService) GetTaskIssues(ctx context.Context) TaskAPIGetTaskIssuesRequest {
return TaskAPIGetTaskIssuesRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return TaskIssueHits
func (a *TaskAPIService) GetTaskIssuesExecute(r TaskAPIGetTaskIssuesRequest) (*TaskIssueHits, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *TaskIssueHits
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.GetTaskIssues")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/issues"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.q != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "form", "")
}
if r.project != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "project", r.project, "form", "")
}
if r.status != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "")
}
if r.kind != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "kind", r.kind, "form", "")
}
if r.repo != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "repo", r.repo, "form", "")
}
if r.channel != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "channel", r.channel, "form", "")
}
if r.source != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "source", r.source, "form", "")
}
if r.assignee != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "assignee", r.assignee, "form", "")
}
if r.limit != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type TaskAPIGetTaskProjectsRequest struct {
ctx context.Context
ApiService *TaskAPIService
}
func (r TaskAPIGetTaskProjectsRequest) Execute() ([]TaskBoardView, *http.Response, error) {
return r.ApiService.GetTaskProjectsExecute(r)
}
/*
GetTaskProjects Returns the boards of your org — the places your work actually is.
Returns the boards of your org — the places your work actually
is. The key addresses the board's issues.
A BOARD IS A PLACE WORK IS, not an object somebody provisioned. So the list is
assembled from the work itself: the repositories your org has filed issues on,
plus the boards the index holds. A repository with nothing on it is not in the
list and is still perfectly addressable — GET /projects/<name> reads it and a
create files into it — so nothing is lost by leaving it out.
Measured, which is why: reading the forge's whole repository inventory put 745
boards here, of which all but a handful were vendored forks and mirrors
(.github, .profile, DOMPurify, BoatAttack) that will never carry this org's
work. A list that long is not a list — the estate's real roadmap was in it
somewhere and no one could see it.
The forge half is the FORGE's answer for your own account, so two people in
one org can legitimately see different boards.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return TaskAPIGetTaskProjectsRequest
*/
func (a *TaskAPIService) GetTaskProjects(ctx context.Context) TaskAPIGetTaskProjectsRequest {
return TaskAPIGetTaskProjectsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return []TaskBoardView
func (a *TaskAPIService) GetTaskProjectsExecute(r TaskAPIGetTaskProjectsRequest) ([]TaskBoardView, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue []TaskBoardView
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.GetTaskProjects")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/projects"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type TaskAPIGetTaskProjectsByKeyRequest struct {
ctx context.Context
ApiService *TaskAPIService
key string
}
func (r TaskAPIGetTaskProjectsByKeyRequest) Execute() (*TaskBoardView, *http.Response, error) {
return r.ApiService.GetTaskProjectsByKeyExecute(r)
}
/*
GetTaskProjectsByKey Returns one board of your org by its key — the repository name.
Returns one board of your org by its key — the repository name.
404 when your org has no repository under that key, or when your own forge
account cannot see it.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param key Key is the project's org-unique handle: 2-8 uppercase alphanumerics starting with a letter (\"ENG\", \"OPS2\"). Matched case-insensitively.
@return TaskAPIGetTaskProjectsByKeyRequest
*/
func (a *TaskAPIService) GetTaskProjectsByKey(ctx context.Context, key string) TaskAPIGetTaskProjectsByKeyRequest {
return TaskAPIGetTaskProjectsByKeyRequest{
ApiService: a,
ctx: ctx,
key: key,
}
}
// Execute executes the request
//
// @return TaskBoardView
func (a *TaskAPIService) GetTaskProjectsByKeyExecute(r TaskAPIGetTaskProjectsByKeyRequest) (*TaskBoardView, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *TaskBoardView
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.GetTaskProjectsByKey")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/projects/{key}"
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", url.PathEscape(parameterValueToString(r.key, "key")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type TaskAPIGetTaskProjectsByKeyIssuesRequest struct {
ctx context.Context
ApiService *TaskAPIService
key string
status *string
kind *string
repo *string
label *string
source *string
scheduled *bool
}
// Status keeps only issues in that board column: backlog, todo, in_progress, done or canceled. An unknown value is refused with 400.
func (r TaskAPIGetTaskProjectsByKeyIssuesRequest) Status(status string) TaskAPIGetTaskProjectsByKeyIssuesRequest {
r.status = &status
return r
}
// Kind keeps only work items of that shape: issue, pr or epic. An unknown value is refused with 400.
func (r TaskAPIGetTaskProjectsByKeyIssuesRequest) Kind(kind string) TaskAPIGetTaskProjectsByKeyIssuesRequest {
r.kind = &kind
return r
}
// Repo keeps only issues bound to that git repository.
func (r TaskAPIGetTaskProjectsByKeyIssuesRequest) Repo(repo string) TaskAPIGetTaskProjectsByKeyIssuesRequest {
r.repo = &repo
return r
}
// Label keeps only issues carrying that label, compared case-insensitively. This is how a board narrows to something SMALLER than a repository — the one mechanism for it. An estate whose apps are directories inside one repository (hanzoai/cloud carries ~140 of them) has no repository per app to address, so the app is a label: &#x60;label&#x3D;app/meet&#x60; is the meet board. Nothing is provisioned to make one exist; a board is the query.
func (r TaskAPIGetTaskProjectsByKeyIssuesRequest) Label(label string) TaskAPIGetTaskProjectsByKeyIssuesRequest {
r.label = &label
return r
}
// Source keeps only issues opened from that surface: team, git, crm, helpdesk, cms or agent. An unknown value is refused with 400.
func (r TaskAPIGetTaskProjectsByKeyIssuesRequest) Source(source string) TaskAPIGetTaskProjectsByKeyIssuesRequest {
r.source = &source
return r
}
// Scheduled keeps only issues that carry a date — a start, a due date or both. This is the timeline&#39;s slice of the board: pass scheduled&#x3D;true to get exactly the rows a gantt has somewhere to draw, instead of fetching every issue and discarding the undated ones client-side.
func (r TaskAPIGetTaskProjectsByKeyIssuesRequest) Scheduled(scheduled bool) TaskAPIGetTaskProjectsByKeyIssuesRequest {
r.scheduled = &scheduled
return r
}
func (r TaskAPIGetTaskProjectsByKeyIssuesRequest) Execute() ([]TaskIssueView, *http.Response, error) {
return r.ApiService.GetTaskProjectsByKeyIssuesExecute(r)
}
/*
GetTaskProjectsByKeyIssues Returns a board's issues — work items with their column, priority, assignee, labels and schedule.
Returns a board's issues — work items with their column, priority,
assignee, labels and schedule.
WHICH board is a filter, not an address. Bound to a repository (the key from
the path) it is that project's board; left unbound it is the org's whole
board; narrowed by label it is a board smaller than any repository — which is
the only way an app that lives as a directory inside a shared repository can
have one. Every combination is the same rows through the same projection, so
no two boards can disagree about what a column means.
The column is a LABEL on the forge, so the board and the forge web UI are the
same object seen twice: relabelling in either moves the card in both. A closed
issue reads as done whatever its labels say.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param key Key is the project whose issues to list, from the path. EMPTY means every project in the org — the global board. It is a filter like the rest of this struct rather than an address, which is what lets one op answer both \"this board\" and \"all the work\" without a second surface disagreeing with the first about what a column is.
@return TaskAPIGetTaskProjectsByKeyIssuesRequest
*/
func (a *TaskAPIService) GetTaskProjectsByKeyIssues(ctx context.Context, key string) TaskAPIGetTaskProjectsByKeyIssuesRequest {
return TaskAPIGetTaskProjectsByKeyIssuesRequest{
ApiService: a,
ctx: ctx,
key: key,
}
}
// Execute executes the request
//
// @return []TaskIssueView
func (a *TaskAPIService) GetTaskProjectsByKeyIssuesExecute(r TaskAPIGetTaskProjectsByKeyIssuesRequest) ([]TaskIssueView, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue []TaskIssueView
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.GetTaskProjectsByKeyIssues")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/projects/{key}/issues"
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", url.PathEscape(parameterValueToString(r.key, "key")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.status != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "")
}
if r.kind != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "kind", r.kind, "form", "")
}
if r.repo != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "repo", r.repo, "form", "")
}
if r.label != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "label", r.label, "form", "")
}
if r.source != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "source", r.source, "form", "")
}
if r.scheduled != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "scheduled", r.scheduled, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type TaskAPIGetTaskProjectsByKeyIssuesByNumRequest struct {
ctx context.Context
ApiService *TaskAPIService
key string
num int64
}
func (r TaskAPIGetTaskProjectsByKeyIssuesByNumRequest) Execute() (*TaskIssueView, *http.Response, error) {
return r.ApiService.GetTaskProjectsByKeyIssuesByNumExecute(r)
}
/*
GetTaskProjectsByKeyIssuesByNum Returns ONE work item in full — its description included.
Returns ONE work item in full — its description included.
The list reads answer a board, and a board is a summary: the description is
where the actual content of a work item lives — what an issue asks for, what
an epic's acceptance criteria are — and no read on this surface returned it.
The address is the one PATCH already accepts, so an item you can move is now
an item you can read.
It reads the forge directly rather than filtering the org fan-out, then falls
back to the index for a board the forge has never heard of — the same order,
and the same reason, as GetProject: a row is one kind of thing however it came
to exist, so a caller does not have to know which store it is in to fetch it.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param key Key is the board — the repository name, or an index board's key.
@param num Num is the issue's number on that board.
@return TaskAPIGetTaskProjectsByKeyIssuesByNumRequest
*/
func (a *TaskAPIService) GetTaskProjectsByKeyIssuesByNum(ctx context.Context, key string, num int64) TaskAPIGetTaskProjectsByKeyIssuesByNumRequest {
return TaskAPIGetTaskProjectsByKeyIssuesByNumRequest{
ApiService: a,
ctx: ctx,
key: key,
num: num,
}
}
// Execute executes the request
//
// @return TaskIssueView
func (a *TaskAPIService) GetTaskProjectsByKeyIssuesByNumExecute(r TaskAPIGetTaskProjectsByKeyIssuesByNumRequest) (*TaskIssueView, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *TaskIssueView
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.GetTaskProjectsByKeyIssuesByNum")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/projects/{key}/issues/{num}"
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", url.PathEscape(parameterValueToString(r.key, "key")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"num"+"}", url.PathEscape(parameterValueToString(r.num, "num")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type TaskAPIGetTaskProjectsByKeyIssuesByNumCommentsRequest struct {
ctx context.Context
ApiService *TaskAPIService
key string
num int64
}
func (r TaskAPIGetTaskProjectsByKeyIssuesByNumCommentsRequest) Execute() (*TaskCommentList, *http.Response, error) {
return r.ApiService.GetTaskProjectsByKeyIssuesByNumCommentsExecute(r)
}
/*
GetTaskProjectsByKeyIssuesByNumComments Is one issue's conversation, oldest first, read as the caller.
Is one issue's conversation, oldest first, read as the caller.
An issue that lives on GitHub names its home and is read there.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param key Key is the board — the repository name, or an index board's key.
@param num Num is the issue's number on that board.
@return TaskAPIGetTaskProjectsByKeyIssuesByNumCommentsRequest
*/
func (a *TaskAPIService) GetTaskProjectsByKeyIssuesByNumComments(ctx context.Context, key string, num int64) TaskAPIGetTaskProjectsByKeyIssuesByNumCommentsRequest {
return TaskAPIGetTaskProjectsByKeyIssuesByNumCommentsRequest{
ApiService: a,
ctx: ctx,
key: key,
num: num,
}
}
// Execute executes the request
//
// @return TaskCommentList
func (a *TaskAPIService) GetTaskProjectsByKeyIssuesByNumCommentsExecute(r TaskAPIGetTaskProjectsByKeyIssuesByNumCommentsRequest) (*TaskCommentList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *TaskCommentList
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.GetTaskProjectsByKeyIssuesByNumComments")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/projects/{key}/issues/{num}/comments"
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", url.PathEscape(parameterValueToString(r.key, "key")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"num"+"}", url.PathEscape(parameterValueToString(r.num, "num")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type TaskAPIPatchTaskProjectsByKeyRequest struct {
ctx context.Context
ApiService *TaskAPIService
key string
}
func (r TaskAPIPatchTaskProjectsByKeyRequest) Execute() (*http.Response, error) {
return r.ApiService.PatchTaskProjectsByKeyExecute(r)
}
/*
PatchTaskProjectsByKey Refused — a board is a repository on the forge
Answers 405. A task board IS a repository on this deployment's forge, so creating, renaming and deleting one is a FORGE operation carried out with FORGE permissions.
Offering it here would put a second endpoint on the same object, guarded by this surface instead of by the forge — a weaker guard on the same thing. So the route exists and refuses, rather than 404ing: "not this service's job" and "no such thing" are different facts, and the body names the forge so a caller knows where the job IS done.
What this surface DOES own is the work on a board: list the boards you can see, read and file their issues, move a card between columns, and read the schedule a milestone is. Those are the routes beside this one.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param key
@return TaskAPIPatchTaskProjectsByKeyRequest
*/
func (a *TaskAPIService) PatchTaskProjectsByKey(ctx context.Context, key string) TaskAPIPatchTaskProjectsByKeyRequest {
return TaskAPIPatchTaskProjectsByKeyRequest{
ApiService: a,
ctx: ctx,
key: key,
}
}
// Execute executes the request
func (a *TaskAPIService) PatchTaskProjectsByKeyExecute(r TaskAPIPatchTaskProjectsByKeyRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.PatchTaskProjectsByKey")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/projects/{key}"
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", url.PathEscape(parameterValueToString(r.key, "key")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type TaskAPIPatchTaskProjectsByKeyIssuesByNumRequest struct {
ctx context.Context
ApiService *TaskAPIService
key string
num int64
taskIssueEdit *TaskIssueEdit
}
func (r TaskAPIPatchTaskProjectsByKeyIssuesByNumRequest) TaskIssueEdit(taskIssueEdit TaskIssueEdit) TaskAPIPatchTaskProjectsByKeyIssuesByNumRequest {
r.taskIssueEdit = &taskIssueEdit
return r
}
func (r TaskAPIPatchTaskProjectsByKeyIssuesByNumRequest) Execute() (*TaskIssueView, *http.Response, error) {
return r.ApiService.PatchTaskProjectsByKeyIssuesByNumExecute(r)
}
/*
PatchTaskProjectsByKeyIssuesByNum Edits a work item — rename it, rewrite it, move it to another column, re-prioritise it, hand it to somebody, or comment on it.
Edits a work item — rename it, rewrite it, move it to another
column, re-prioritise it, hand it to somebody, or comment on it. Absent fields
are left alone. An issue on GitHub is edited there.
MOVING A CARD IS A RELABEL. The column lives in the forge's label set, so the
move replaces that set rather than writing a status column here that a
forge-side change could contradict. Moving to `done` also CLOSES the issue,
because a done card and an open issue are a contradiction.
Assigning it to `agent` hands it to the coding agent: see `assignee`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param key Key is the board — the repository name, from the path.
@param num Num is the issue number on that repository, from the path.
@return TaskAPIPatchTaskProjectsByKeyIssuesByNumRequest
*/
func (a *TaskAPIService) PatchTaskProjectsByKeyIssuesByNum(ctx context.Context, key string, num int64) TaskAPIPatchTaskProjectsByKeyIssuesByNumRequest {
return TaskAPIPatchTaskProjectsByKeyIssuesByNumRequest{
ApiService: a,
ctx: ctx,
key: key,
num: num,
}
}
// Execute executes the request
//
// @return TaskIssueView
func (a *TaskAPIService) PatchTaskProjectsByKeyIssuesByNumExecute(r TaskAPIPatchTaskProjectsByKeyIssuesByNumRequest) (*TaskIssueView, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *TaskIssueView
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.PatchTaskProjectsByKeyIssuesByNum")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/projects/{key}/issues/{num}"
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", url.PathEscape(parameterValueToString(r.key, "key")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"num"+"}", url.PathEscape(parameterValueToString(r.num, "num")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.taskIssueEdit == nil {
return localVarReturnValue, nil, reportError("taskIssueEdit is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.taskIssueEdit
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type TaskAPIPostTaskProjectsRequest struct {
ctx context.Context
ApiService *TaskAPIService
}
func (r TaskAPIPostTaskProjectsRequest) Execute() (*http.Response, error) {
return r.ApiService.PostTaskProjectsExecute(r)
}
/*
PostTaskProjects Refused — a board is a repository on the forge
Answers 405. A task board IS a repository on this deployment's forge, so creating, renaming and deleting one is a FORGE operation carried out with FORGE permissions.
Offering it here would put a second endpoint on the same object, guarded by this surface instead of by the forge — a weaker guard on the same thing. So the route exists and refuses, rather than 404ing: "not this service's job" and "no such thing" are different facts, and the body names the forge so a caller knows where the job IS done.
What this surface DOES own is the work on a board: list the boards you can see, read and file their issues, move a card between columns, and read the schedule a milestone is. Those are the routes beside this one.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return TaskAPIPostTaskProjectsRequest
*/
func (a *TaskAPIService) PostTaskProjects(ctx context.Context) TaskAPIPostTaskProjectsRequest {
return TaskAPIPostTaskProjectsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
func (a *TaskAPIService) PostTaskProjectsExecute(r TaskAPIPostTaskProjectsRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.PostTaskProjects")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/projects"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type TaskAPIPostTaskProjectsByKeyIssuesRequest struct {
ctx context.Context
ApiService *TaskAPIService
key string
taskNewIssue *TaskNewIssue
}
func (r TaskAPIPostTaskProjectsByKeyIssuesRequest) TaskNewIssue(taskNewIssue TaskNewIssue) TaskAPIPostTaskProjectsByKeyIssuesRequest {
r.taskNewIssue = &taskNewIssue
return r
}
func (r TaskAPIPostTaskProjectsByKeyIssuesRequest) Execute() (*TaskIssueView, *http.Response, error) {
return r.ApiService.PostTaskProjectsByKeyIssuesExecute(r)
}
/*
PostTaskProjectsByKeyIssues Opens a work item on the board, filed as YOU, where the repository lives: an issue on the deployment's forge, or on GitHub for a repository the forge mirrors from there or does not hold at all.
Opens a work item on the board, filed as YOU, where the
repository lives: an issue on the deployment's forge, or on GitHub for a
repository the forge mirrors from there or does not hold at all. Answers 201
with the card: its `number`, its `id`, and the issue's address as `url`. A
create that cannot say what it made answers 502, never an empty 2xx.
The column and priority are written as LABELS, which is what makes the card
and the issue the same object: someone relabelling in the web UI has moved
your card.
Asked for in a chat thread, the issue is bound to that thread, and what
happens to it on GitHub is said there.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param key Key is the board — the repository name, from the path. `owner/name`, or `github.com/owner/name`, names a repository on GitHub that no board on the forge stands for.
@return TaskAPIPostTaskProjectsByKeyIssuesRequest
*/
func (a *TaskAPIService) PostTaskProjectsByKeyIssues(ctx context.Context, key string) TaskAPIPostTaskProjectsByKeyIssuesRequest {
return TaskAPIPostTaskProjectsByKeyIssuesRequest{
ApiService: a,
ctx: ctx,
key: key,
}
}
// Execute executes the request
//
// @return TaskIssueView
func (a *TaskAPIService) PostTaskProjectsByKeyIssuesExecute(r TaskAPIPostTaskProjectsByKeyIssuesRequest) (*TaskIssueView, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *TaskIssueView
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.PostTaskProjectsByKeyIssues")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/projects/{key}/issues"
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", url.PathEscape(parameterValueToString(r.key, "key")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.taskNewIssue == nil {
return localVarReturnValue, nil, reportError("taskNewIssue is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.taskNewIssue
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type TaskAPIPostTaskProjectsByKeyIssuesByNumClaimRequest struct {
ctx context.Context
ApiService *TaskAPIService
key string
num int64
}
func (r TaskAPIPostTaskProjectsByKeyIssuesByNumClaimRequest) Execute() (*TaskIssueHit, *http.Response, error) {
return r.ApiService.PostTaskProjectsByKeyIssuesByNumClaimExecute(r)
}
/*
PostTaskProjectsByKeyIssuesByNumClaim Takes an issue: it becomes yours and it moves to in_progress.
Takes an issue: it becomes yours and it moves to in_progress.
The holder is the CALLER, never an argument. "Assign this to someone else" is
a different act with different authority, and it already exists as a PATCH;
conflating them would let anyone hand work to anyone by naming them.
Claiming something already held by someone else is refused rather than
silently taken — two agents on one issue is the failure this prevents, and a
claim that quietly wins a race is worse than one that says no.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param key
@param num
@return TaskAPIPostTaskProjectsByKeyIssuesByNumClaimRequest
*/
func (a *TaskAPIService) PostTaskProjectsByKeyIssuesByNumClaim(ctx context.Context, key string, num int64) TaskAPIPostTaskProjectsByKeyIssuesByNumClaimRequest {
return TaskAPIPostTaskProjectsByKeyIssuesByNumClaimRequest{
ApiService: a,
ctx: ctx,
key: key,
num: num,
}
}
// Execute executes the request
//
// @return TaskIssueHit
func (a *TaskAPIService) PostTaskProjectsByKeyIssuesByNumClaimExecute(r TaskAPIPostTaskProjectsByKeyIssuesByNumClaimRequest) (*TaskIssueHit, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *TaskIssueHit
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskAPIService.PostTaskProjectsByKeyIssuesByNumClaim")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/task/projects/{key}/issues/{num}/claim"
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", url.PathEscape(parameterValueToString(r.key, "key")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"num"+"}", url.PathEscape(parameterValueToString(r.num, "num")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}