api

package
v0.0.0-...-1fa52ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: Apache-2.0, BSD-2-Clause, ISC, + 1 more Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteConnection

func DeleteConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

@Summary delete a github connection @Description Delete a github connection @Tags plugins/github @Success 200 {object} models.GithubConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 409 {object} srvhelper.DsRefs "References exist to this connection" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/github/connections/{connectionId} [DELETE]

func DeleteScope

DeleteScope delete plugin data associated with the scope and optionally the scope itself @Summary delete plugin data associated with the scope and optionally the scope itself @Description delete data associated with plugin scope @Tags plugins/github @Param connectionId path int true "connection ID" @Param scopeId path int true "scope ID" @Param delete_data_only query bool false "Only delete the scope data, not the scope itself" @Success 200 {object} models.GithubRepo @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 409 {object} srvhelper.DsRefs "References exist to this scope" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scopes/{scopeId} [DELETE]

func DeleteScopeConfig

func DeleteScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

DeleteScopeConfig delete a scope config @Summary delete a scope config @Description delete a scope config @Tags plugins/github @Param id path int true "id" @Param connectionId path int true "connectionId" @Success 200 @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scope-configs/{id} [DELETE]

func GetConnection

func GetConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

@Summary get github connection detail @Description Get github connection detail @Tags plugins/github @Success 200 {object} models.GithubConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/github/connections/{connectionId} [GET]

func GetScope

GetScope get one Github repo @Summary get one Github repo @Description get one Github repo @Tags plugins/github @Param connectionId path int true "connection ID" @Param scopeId path int true "scope ID" @Param blueprints query bool false "also return blueprints using these scopes as part of the payload" @Success 200 {object} ScopeDetail @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scopes/{scopeId} [GET]

func GetScopeConfig

func GetScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

GetScopeConfig return one scope config @Summary return one scope config @Description return one scope config @Tags plugins/github @Param id path int true "id" @Param connectionId path int true "connectionId" @Success 200 {object} models.GithubScopeConfig @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scope-configs/{id} [GET]

func GetScopeConfigList

func GetScopeConfigList(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

GetScopeConfigList return all scope configs @Summary return all scope configs @Description return all scope configs @Tags plugins/github @Param pageSize query int false "page size, default 50" @Param page query int false "page size, default 1" @Param connectionId path int true "connectionId" @Success 200 {object} []models.GithubScopeConfig @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scope-configs [GET]

func GetScopeLatestSyncState

func GetScopeLatestSyncState(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

GetScopeLatestSyncState get one GitHub repo's latest sync state @Summary get one GitHub repo's latest sync state @Description get one GitHub repo's latest sync state @Tags plugins/github @Param connectionId path int true "connection ID" @Param scopeId path int true "scope ID" @Success 200 {object} []models.LatestSyncState @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scopes/{scopeId}/latest-sync-state [GET]

func GetScopes

GetScopeList get Github repos @Summary get Github repos @Description get Github repos @Tags plugins/github @Param connectionId path int true "connection ID" @Param searchTerm query string false "search term for scope name" @Param pageSize query int false "page size, default 50" @Param page query int false "page size, default 1" @Param blueprints query bool false "also return blueprints using these scopes as part of the payload" @Success 200 {object} []ScopeDetail @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scopes [GET]

func Init

func Init(br context.BasicRes, p plugin.PluginMeta)

func ListConnections

func ListConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

@Summary get all github connections @Description Get all github connections @Tags plugins/github @Success 200 {object} []models.GithubConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/github/connections [GET]

func MakeDataSourcePipelinePlanV200

func MakeDataSourcePipelinePlanV200(
	subtaskMetas []plugin.SubTaskMeta,
	connectionId uint64,
	bpScopes []*coreModels.BlueprintScope,
) (coreModels.PipelinePlan, []plugin.Scope, errors.Error)

func MemorizedGetApiRepo

func MemorizedGetApiRepo(
	repo *tasks.GithubApiRepo,
	op *tasks.GithubOptions, apiClient plugin.ApiClient,
) (*tasks.GithubApiRepo, errors.Error)

func PatchConnection

func PatchConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

@Summary patch github connection @Description Patch github connection @Tags plugins/github @Param body body models.GithubConnection true "json body" @Success 200 {object} models.GithubConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/github/connections/{connectionId} [PATCH]

func PatchScope

UpdateScope patch to github repo @Summary patch to github repo @Description patch to github repo @Tags plugins/github @Accept application/json @Param connectionId path int true "connection ID" @Param scopeId path int true "scope ID" @Param scope body models.GithubRepo true "json" @Success 200 {object} models.GithubRepo @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scopes/{scopeId} [PATCH]

func PatchScopeConfig

func PatchScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

PatchScopeConfig update scope config for Github @Summary update scope config for Github @Description update scope config for Github @Tags plugins/github @Accept application/json @Param id path int true "id" @Param connectionId path int true "connectionId" @Param scopeConfig body models.GithubScopeConfig true "scope config" @Success 200 {object} models.GithubScopeConfig @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scope-configs/{id} [PATCH]

func PostConnections

func PostConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

@Summary create github connection @Description Create github connection @Tags plugins/github @Param body body models.GithubConnection true "json body" @Success 200 {object} models.GithubConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/github/connections [POST]

func PostScopeConfig

func PostScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

PostScopeConfig create scope config for Github @Summary create scope config for Github @Description create scope config for Github @Tags plugins/github @Accept application/json @Param connectionId path int true "connectionId" @Param scopeConfig body models.GithubScopeConfig true "scope config" @Success 200 {object} models.GithubScopeConfig @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scope-configs [POST]

func Proxy

@Summary Remote server API proxy @Description Forward API requests to the specified remote server @Param connectionId path int true "connection ID" @Param path path string true "path to a API endpoint" @Tags plugins/github @Router /plugins/github/connections/{connectionId}/proxy/{path} [GET]

func PutScopes

PutScope create or update github repo @Summary create or update github repo @Description Create or update github repo @Tags plugins/github @Accept application/json @Param connectionId path int true "connection ID" @Param scope body PutScopesReqBody true "json" @Success 200 {object} []models.GithubRepo @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scopes [PUT]

func RemoteScopes

RemoteScopes list all available scopes on the remote server @Summary list all available scopes on the remote server @Description list all available scopes on the remote server @Accept application/json @Param connectionId path int false "connection ID" @Param groupId query string false "group ID" @Param pageToken query string false "page Token" @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Success 200 {object} dsmodels.DsRemoteApiScopeList[models.GithubRepo] @Tags plugins/github @Router /plugins/github/connections/{connectionId}/remote-scopes [GET]

func SearchRemoteScopes

func SearchRemoteScopes(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

SearchRemoteScopes searches scopes on the remote server @Summary searches scopes on the remote server @Description searches scopes on the remote server @Accept application/json @Param connectionId path int false "connection ID" @Param search query string false "search" @Param page query int false "page number" @Param pageSize query int false "page size per page" @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Success 200 {object} dsmodels.DsRemoteApiScopeList[models.GithubRepo] "the parentIds are always null" @Tags plugins/github @Router /plugins/github/connections/{connectionId}/search-remote-scopes [GET]

func TestConnection

func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

TestConnection test github connection @Summary test github connection @Description Test github Connection @Tags plugins/github @Param body body models.GithubConn true "json body" @Success 200 {object} GithubTestConnResponse @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/github/test [POST]

func TestExistingConnection

func TestExistingConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

TestExistingConnection test github connection options @Summary test github connection @Description Test github Connection @Tags plugins/github @Param connectionId path int true "connection ID" @Success 200 {object} GithubMultiTestConnResponse @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/github/connections/{connectionId}/test [POST]

Types

type GitHubTestConnResult

type GitHubTestConnResult struct {
	AuthMethod string `json:"auth_method"`

	// AppKey
	AppId          string `json:"appId,omitempty"`
	InstallationID int    `json:"installationId,omitempty"`

	// AccessToken
	Token string `json:"token,omitempty"`

	Success       bool                           `json:"success"`
	Message       string                         `json:"message,omitempty"`
	Login         string                         `json:"login"`
	Warning       bool                           `json:"warning"`
	Installations []models.GithubAppInstallation `json:"installations,omitempty"`
}

type GithubAppRepo

type GithubAppRepo struct {
	TotalCount   int `json:"total_count"`
	Repositories []struct {
		ID       int    `json:"id"`
		NodeID   string `json:"node_id"`
		Name     string `json:"name"`
		FullName string `json:"full_name"`
		Owner    struct {
			Login             string `json:"login"`
			ID                int    `json:"id"`
			NodeID            string `json:"node_id"`
			AvatarURL         string `json:"avatar_url"`
			GravatarID        string `json:"gravatar_id"`
			URL               string `json:"url"`
			HTMLURL           string `json:"html_url"`
			FollowersURL      string `json:"followers_url"`
			FollowingURL      string `json:"following_url"`
			GistsURL          string `json:"gists_url"`
			StarredURL        string `json:"starred_url"`
			SubscriptionsURL  string `json:"subscriptions_url"`
			OrganizationsURL  string `json:"organizations_url"`
			ReposURL          string `json:"repos_url"`
			EventsURL         string `json:"events_url"`
			ReceivedEventsURL string `json:"received_events_url"`
			Type              string `json:"type"`
			SiteAdmin         bool   `json:"site_admin"`
		} `json:"owner"`
		Private             bool      `json:"private"`
		HTMLURL             string    `json:"html_url"`
		Description         string    `json:"description"`
		Fork                bool      `json:"fork"`
		URL                 string    `json:"url"`
		ArchiveURL          string    `json:"archive_url"`
		AssigneesURL        string    `json:"assignees_url"`
		BlobsURL            string    `json:"blobs_url"`
		BranchesURL         string    `json:"branches_url"`
		CollaboratorsURL    string    `json:"collaborators_url"`
		CommentsURL         string    `json:"comments_url"`
		CommitsURL          string    `json:"commits_url"`
		CompareURL          string    `json:"compare_url"`
		ContentsURL         string    `json:"contents_url"`
		ContributorsURL     string    `json:"contributors_url"`
		DeploymentsURL      string    `json:"deployments_url"`
		DownloadsURL        string    `json:"downloads_url"`
		EventsURL           string    `json:"events_url"`
		ForksURL            string    `json:"forks_url"`
		GitCommitsURL       string    `json:"git_commits_url"`
		GitRefsURL          string    `json:"git_refs_url"`
		GitTagsURL          string    `json:"git_tags_url"`
		GitURL              string    `json:"git_url"`
		IssueCommentURL     string    `json:"issue_comment_url"`
		IssueEventsURL      string    `json:"issue_events_url"`
		IssuesURL           string    `json:"issues_url"`
		KeysURL             string    `json:"keys_url"`
		LabelsURL           string    `json:"labels_url"`
		LanguagesURL        string    `json:"languages_url"`
		MergesURL           string    `json:"merges_url"`
		MilestonesURL       string    `json:"milestones_url"`
		NotificationsURL    string    `json:"notifications_url"`
		PullsURL            string    `json:"pulls_url"`
		ReleasesURL         string    `json:"releases_url"`
		SSHURL              string    `json:"ssh_url"`
		StargazersURL       string    `json:"stargazers_url"`
		StatusesURL         string    `json:"statuses_url"`
		SubscribersURL      string    `json:"subscribers_url"`
		SubscriptionURL     string    `json:"subscription_url"`
		TagsURL             string    `json:"tags_url"`
		TeamsURL            string    `json:"teams_url"`
		TreesURL            string    `json:"trees_url"`
		CloneURL            string    `json:"clone_url"`
		MirrorURL           string    `json:"mirror_url"`
		HooksURL            string    `json:"hooks_url"`
		SvnURL              string    `json:"svn_url"`
		Homepage            string    `json:"homepage"`
		Language            any       `json:"language"`
		ForksCount          int       `json:"forks_count"`
		StargazersCount     int       `json:"stargazers_count"`
		WatchersCount       int       `json:"watchers_count"`
		Size                int       `json:"size"`
		DefaultBranch       string    `json:"default_branch"`
		OpenIssuesCount     int       `json:"open_issues_count"`
		IsTemplate          bool      `json:"is_template"`
		Topics              []string  `json:"topics"`
		HasIssues           bool      `json:"has_issues"`
		HasProjects         bool      `json:"has_projects"`
		HasWiki             bool      `json:"has_wiki"`
		HasPages            bool      `json:"has_pages"`
		HasDownloads        bool      `json:"has_downloads"`
		Archived            bool      `json:"archived"`
		Disabled            bool      `json:"disabled"`
		Visibility          string    `json:"visibility"`
		PushedAt            time.Time `json:"pushed_at"`
		CreatedAt           time.Time `json:"created_at"`
		UpdatedAt           time.Time `json:"updated_at"`
		AllowRebaseMerge    bool      `json:"allow_rebase_merge"`
		TemplateRepository  any       `json:"template_repository"`
		TempCloneToken      string    `json:"temp_clone_token"`
		AllowSquashMerge    bool      `json:"allow_squash_merge"`
		AllowAutoMerge      bool      `json:"allow_auto_merge"`
		DeleteBranchOnMerge bool      `json:"delete_branch_on_merge"`
		AllowMergeCommit    bool      `json:"allow_merge_commit"`
		SubscribersCount    int       `json:"subscribers_count"`
		NetworkCount        int       `json:"network_count"`
		License             struct {
			Key     string `json:"key"`
			Name    string `json:"name"`
			URL     string `json:"url"`
			SpdxID  string `json:"spdx_id"`
			NodeID  string `json:"node_id"`
			HTMLURL string `json:"html_url"`
		} `json:"license"`
		Forks      int `json:"forks"`
		OpenIssues int `json:"open_issues"`
		Watchers   int `json:"watchers"`
	} `json:"repositories"`
}

type GithubMultiTestConnResponse

type GithubMultiTestConnResponse struct {
	shared.ApiBody
	Tokens []*GitHubTestConnResult `json:"tokens"`
}

type GithubRemotePagination

type GithubRemotePagination struct {
	Page    int `json:"page"`
	PerPage int `json:"per_page"`
}

type GithubTaskOptions

type GithubTaskOptions tasks.GithubOptions

type GithubTestConnResponse

type GithubTestConnResponse struct {
	shared.ApiBody
	Login         string                         `json:"login"`
	Warning       bool                           `json:"warning"`
	Installations []models.GithubAppInstallation `json:"installations"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL