2023-08-30 12:21:48 +02:00

881 lines
20 KiB
Go

/*
* Bitbucket Server API
*
* Bitbucket Server API (former stash).
*
* API version: 1.0.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"encoding/json"
"net/http"
"strconv"
"strings"
"github.com/gorilla/mux"
)
func AddGroupToUser(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func AddUserToGroup(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func AddUserToGroups(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func AddUsersToGroup(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func Approve(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func AssignParticipantRole(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func CanMerge(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func ClearSenderAddress(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func ClearUserCaptchaChallenge(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func CountPullRequestTasks(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func Create(w http.ResponseWriter, r *http.Request) {
repositorySlug := mux.Vars(r)["repositorySlug"]
if strings.Compare(repositorySlug, "repo1_test1") == 0 {
HandleError(w, http.StatusBadRequest, map[string]interface{}{"errors": []interface{}{
map[string]interface{}{
"context": nil,
"message": "title must be supplied for this request",
"exceptionName": nil,
},
}})
return
} else if strings.Compare(repositorySlug, "repo1_test2") == 0 {
HandleError(w, http.StatusNotFound, map[string]interface{}{"errors": []interface{}{
map[string]interface{}{
"context": nil,
"message": "Repository \"repo1\" of project with key \"PROJ\" has no branch \"refs/heads/feature\"",
"exceptionName": "com.atlassian.bitbucket.commit.NoSuchCommitException",
},
}})
return
}
HandleRequest(w, r)
}
func CreateBranch(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func CreateComment(w http.ResponseWriter, r *http.Request) {
commit_id := mux.Vars(r)["commitId"]
if strings.Compare(commit_id, "657f55ce41710f9bfde15c374837136728fae9d9e0eca0b97cb7bfea5095af30") == 0 {
HandleError(w, http.StatusNotFound, map[string]interface{}{"errors": []interface{}{
map[string]interface{}{
"context": nil,
"message": "Commit '657f55ce41710f9bfde15c374837136728fae9d9e0eca0b97cb7bfea5095af30' does not exist in repository 'repo1'.",
"exceptionName": "com.atlassian.bitbucket.commit.NoSuchCommitException",
},
}})
return
}
HandleRequest(w, r)
}
func CreateCommentCommit(w http.ResponseWriter, r *http.Request) {
pr_id := mux.Vars(r)["pullRequestId"]
if id, err := strconv.Atoi(pr_id); err != nil {
w.WriteHeader(http.StatusBadRequest)
return
} else if id == 1 {
HandleError(w, http.StatusNotFound, map[string]interface{}{"errors": []interface{}{
map[string]interface{}{
"context": nil,
"message": "Pull request 1 does not exist in PROJ/repo1.",
"exceptionName": "com.atlassian.bitbucket.pull.NoSuchPullRequestException",
},
}})
return
}
HandleRequest(w, r)
}
func CreateGroup(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func CreateProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func CreateRepository(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func CreateTag(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func CreateTask(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func CreateUser(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func CreateWebhook(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func Decline(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func Delete(w http.ResponseWriter, r *http.Request) {
pr_id := mux.Vars(r)["pullRequestId"]
if id, err := strconv.Atoi(pr_id); err != nil {
w.WriteHeader(http.StatusBadRequest)
return
} else if id < 0 {
HandleError(w, http.StatusNotFound, map[string]interface{}{"errors": []interface{}{
map[string]interface{}{
"context": nil,
"message": "No pull request exists with ID -1 for this repository 1",
"exceptionName": "com.atlassian.bitbucket.pull.NoSuchPullRequestException",
},
}})
return
}
HandleRequest(w, r)
}
func HandleError(w http.ResponseWriter, httpStatus int, body interface{}) {
w.WriteHeader(httpStatus)
bodyData, err := json.Marshal(body)
if err == nil {
w.Write(bodyData)
}
}
func DeleteAvatar(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func DeleteComment(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func DeleteCommentCommit(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func DeleteGroup(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func DeleteMailConfig(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func DeleteProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func DeleteRepository(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func DeleteRepositoryHook(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func DeleteTask(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func DeleteUser(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func DeleteWebhook(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func DisableHook(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func DisableHookRepo(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func EditFile(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func EnableHook(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func EnableHookRepo(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func FindGroupsForUser(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func FindOtherGroupsForUser(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func FindUsersInGroup(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func FindUsersNotInGroup(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func FindWebhooks(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func ForkRepository(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func Get(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetActivities(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetApplicationProperties(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetArchive(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetAvatar(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetBranches(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetChanges(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetChangesFile(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetComment(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetCommentCommit(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetComments(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetCommentsCommit(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetCommit(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetCommits(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetCommitsPR(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetContentBrowse(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetContentFile(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetContentRepository(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetContentRepositoryPath(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetDefaultBranch(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetForkedRepositories(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetGroups(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetGroupsAdmin(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetGroupsWithAnyPermission(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetGroupsWithAnyPermissionProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetGroupsWithAnyPermissionRepository(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetGroupsWithoutAnyPermission(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetGroupsWithoutAnyPermissionProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetGroupsWithoutAnyPermissionRepository(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetInformation(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetLatestInvocation(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetLevel(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetLicense(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetMailConfig(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetMergeConfig(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetPage(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetProjectAvatar(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetProjects(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetPullRequestCount(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetPullRequestSettings(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetPullRequestSettingsSCM(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetPullRequestSuggestions(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetPullRequestTasks(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetPullRequests(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetPullRequestsInbox(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetRelatedRepositories(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetRepositories(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetRepositoriesAll(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetRepositoriesRecentlyAccessed(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetRepository(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetRepositoryHook(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetRepositoryHookSettings(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetRepositoryHooks(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetRepositoryHooksSettings(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetRootLevel(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetSenderAddress(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetSettings(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetSettingsHook(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetStatistics(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetStatisticsSummary(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetTag(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetTags(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetTask(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetUser(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetUserSettings(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetUsers(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetUsersAll(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetUsersWithAnyPermission(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetUsersWithAnyPermissionAll(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetUsersWithAnyPermissionProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetUsersWithoutAnyPermission(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetUsersWithoutPermission(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetUsersWithoutPermissionProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetWebhook(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func HasAllUserPermission(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func ListParticipants(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func Merge(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func ModifyAllUserPermission(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func Preview(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func RemoveGroupFromUser(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func RemoveUserFromGroup(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func RenameUser(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func Reopen(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func RetryCreateRepository(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func RevokePermissionsForGroup(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func RevokePermissionsForGroupAll(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func RevokePermissionsForGroupProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func RevokePermissionsForUser(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func RevokePermissionsForUserAll(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func RevokePermissionsForUserProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func Search(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetDefaultBranch(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetLevel(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetMailConfig(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetMergeConfig(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetPermissionForGroup(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetPermissionForGroups(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetPermissionForGroupsProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetPermissionForUser(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetPermissionForUsers(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetPermissionForUsersProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetRootLevel(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetSenderAddress(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetSettings(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetSettingsProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func Stream(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamChanges(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamChangesCompare(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamCommits(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamDiff(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamDiffCommit(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamDiffCommits(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamDiffCompare(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamDiffPR(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamDiffRepository(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamDiffRepositoryFile(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamFiles(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamFilesLastMofied(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func StreamFilesRepository(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func TestWebhook(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UnassignParticipantRole(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UnassignParticipantRolePR(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func Unwatch(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UnwatchPR(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func Update(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateComment(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateCommentCommit(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateLicense(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdatePullRequestSettings(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdatePullRequestSettingsSCM(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateRepository(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateSettings(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateStatus(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateTask(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateUserDetails(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateUserDetailsAll(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateUserPassword(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateUserPasswordAll(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UpdateWebhook(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UploadAvatar(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func UploadAvatarProject(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func WatchCommit(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func WatchPR(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func WithdrawApproval(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
// Build-Status API
func GetCommitStats(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetCommitStatus(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetCommitsStats(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SetCommitStatus(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func SearchCode(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}
func GetSSHKeys(w http.ResponseWriter, r *http.Request) {
HandleRequest(w, r)
}