First commit

This commit is contained in:
gfleury 2017-12-25 23:06:33 +02:00
commit df4e6ecbbf
11 changed files with 19521 additions and 0 deletions

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
*.prof

23
.swagger-codegen-ignore Normal file
View File

@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

1
.swagger-codegen/VERSION Normal file
View File

@ -0,0 +1 @@
2.3.0

8
.travis.yml Normal file
View File

@ -0,0 +1,8 @@
language: go
install:
- go get -d -v .
script:
- go build -v ./

227
README.md Normal file
View File

@ -0,0 +1,227 @@
# Go API client for swagger
## Overview
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.
- API version:
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.GoClientCodegen
## Installation
Put the package under your project folder and add the following in import:
```
"./swagger"
```
## Documentation for API Endpoints
All URIs are relative to *http://example.com/rest/*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**AddGroupToUser**](docs/DefaultApi.md#addgrouptouser) | **Post** /api/1.0/admin/users/add-group |
*DefaultApi* | [**AddUserToGroup**](docs/DefaultApi.md#addusertogroup) | **Post** /api/1.0/admin/groups/add-user |
*DefaultApi* | [**AddUserToGroups**](docs/DefaultApi.md#addusertogroups) | **Post** /api/1.0/admin/users/add-groups |
*DefaultApi* | [**AddUsersToGroup**](docs/DefaultApi.md#adduserstogroup) | **Post** /api/1.0/admin/groups/add-users |
*DefaultApi* | [**Approve**](docs/DefaultApi.md#approve) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approve |
*DefaultApi* | [**AssignParticipantRole**](docs/DefaultApi.md#assignparticipantrole) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants |
*DefaultApi* | [**CanMerge**](docs/DefaultApi.md#canmerge) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge |
*DefaultApi* | [**ClearSenderAddress**](docs/DefaultApi.md#clearsenderaddress) | **Delete** /api/1.0/admin/mail-server/sender-address |
*DefaultApi* | [**ClearUserCaptchaChallenge**](docs/DefaultApi.md#clearusercaptchachallenge) | **Delete** /api/1.0/admin/users/captcha |
*DefaultApi* | [**CountPullRequestTasks**](docs/DefaultApi.md#countpullrequesttasks) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks/count |
*DefaultApi* | [**Create**](docs/DefaultApi.md#create) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests |
*DefaultApi* | [**CreateBranch**](docs/DefaultApi.md#createbranch) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches |
*DefaultApi* | [**CreateComment**](docs/DefaultApi.md#createcomment) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments |
*DefaultApi* | [**CreateComment_0**](docs/DefaultApi.md#createcomment_0) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments |
*DefaultApi* | [**CreateGroup**](docs/DefaultApi.md#creategroup) | **Post** /api/1.0/admin/groups |
*DefaultApi* | [**CreateProject**](docs/DefaultApi.md#createproject) | **Post** /api/1.0/projects |
*DefaultApi* | [**CreateRepository**](docs/DefaultApi.md#createrepository) | **Post** /api/1.0/projects/{projectKey}/repos |
*DefaultApi* | [**CreateTag**](docs/DefaultApi.md#createtag) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags |
*DefaultApi* | [**CreateTask**](docs/DefaultApi.md#createtask) | **Post** /api/1.0/tasks |
*DefaultApi* | [**CreateUser**](docs/DefaultApi.md#createuser) | **Post** /api/1.0/admin/users |
*DefaultApi* | [**CreateWebhook**](docs/DefaultApi.md#createwebhook) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks |
*DefaultApi* | [**Decline**](docs/DefaultApi.md#decline) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/decline |
*DefaultApi* | [**Delete**](docs/DefaultApi.md#delete) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId} |
*DefaultApi* | [**DeleteAvatar**](docs/DefaultApi.md#deleteavatar) | **Delete** /api/1.0/users/{userSlug}/avatar.png |
*DefaultApi* | [**DeleteComment**](docs/DefaultApi.md#deletecomment) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId} |
*DefaultApi* | [**DeleteComment_0**](docs/DefaultApi.md#deletecomment_0) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId} |
*DefaultApi* | [**DeleteGroup**](docs/DefaultApi.md#deletegroup) | **Delete** /api/1.0/admin/groups |
*DefaultApi* | [**DeleteMailConfig**](docs/DefaultApi.md#deletemailconfig) | **Delete** /api/1.0/admin/mail-server |
*DefaultApi* | [**DeleteProject**](docs/DefaultApi.md#deleteproject) | **Delete** /api/1.0/projects/{projectKey} |
*DefaultApi* | [**DeleteRepository**](docs/DefaultApi.md#deleterepository) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug} |
*DefaultApi* | [**DeleteRepositoryHook**](docs/DefaultApi.md#deleterepositoryhook) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey} |
*DefaultApi* | [**DeleteTask**](docs/DefaultApi.md#deletetask) | **Delete** /api/1.0/tasks/{taskId} |
*DefaultApi* | [**DeleteUser**](docs/DefaultApi.md#deleteuser) | **Delete** /api/1.0/admin/users |
*DefaultApi* | [**DeleteWebhook**](docs/DefaultApi.md#deletewebhook) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId} |
*DefaultApi* | [**DisableHook**](docs/DefaultApi.md#disablehook) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled |
*DefaultApi* | [**DisableHook_0**](docs/DefaultApi.md#disablehook_0) | **Delete** /api/1.0/projects/{projectKey}/settings/hooks/{hookKey}/enabled |
*DefaultApi* | [**EditFile**](docs/DefaultApi.md#editfile) | **Put** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/browse/{path} |
*DefaultApi* | [**EnableHook**](docs/DefaultApi.md#enablehook) | **Put** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled |
*DefaultApi* | [**EnableHook_0**](docs/DefaultApi.md#enablehook_0) | **Put** /api/1.0/projects/{projectKey}/settings/hooks/{hookKey}/enabled |
*DefaultApi* | [**FindGroupsForUser**](docs/DefaultApi.md#findgroupsforuser) | **Get** /api/1.0/admin/users/more-members |
*DefaultApi* | [**FindOtherGroupsForUser**](docs/DefaultApi.md#findothergroupsforuser) | **Get** /api/1.0/admin/users/more-non-members |
*DefaultApi* | [**FindUsersInGroup**](docs/DefaultApi.md#findusersingroup) | **Get** /api/1.0/admin/groups/more-members |
*DefaultApi* | [**FindUsersNotInGroup**](docs/DefaultApi.md#findusersnotingroup) | **Get** /api/1.0/admin/groups/more-non-members |
*DefaultApi* | [**FindWebhooks**](docs/DefaultApi.md#findwebhooks) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks |
*DefaultApi* | [**ForkRepository**](docs/DefaultApi.md#forkrepository) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug} |
*DefaultApi* | [**Get**](docs/DefaultApi.md#get) | **Get** /api/1.0/admin/license |
*DefaultApi* | [**GetActivities**](docs/DefaultApi.md#getactivities) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities |
*DefaultApi* | [**GetApplicationProperties**](docs/DefaultApi.md#getapplicationproperties) | **Get** /api/1.0/application-properties |
*DefaultApi* | [**GetArchive**](docs/DefaultApi.md#getarchive) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/archive |
*DefaultApi* | [**GetAvatar**](docs/DefaultApi.md#getavatar) | **Get** /api/1.0/hooks/{hookKey}/avatar |
*DefaultApi* | [**GetBranches**](docs/DefaultApi.md#getbranches) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches |
*DefaultApi* | [**GetChanges**](docs/DefaultApi.md#getchanges) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/changes |
*DefaultApi* | [**GetChanges_0**](docs/DefaultApi.md#getchanges_0) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/changes |
*DefaultApi* | [**GetComment**](docs/DefaultApi.md#getcomment) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId} |
*DefaultApi* | [**GetComment_0**](docs/DefaultApi.md#getcomment_0) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId} |
*DefaultApi* | [**GetComments**](docs/DefaultApi.md#getcomments) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments |
*DefaultApi* | [**GetComments_0**](docs/DefaultApi.md#getcomments_0) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments |
*DefaultApi* | [**GetCommit**](docs/DefaultApi.md#getcommit) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId} |
*DefaultApi* | [**GetCommits**](docs/DefaultApi.md#getcommits) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits |
*DefaultApi* | [**GetCommits_0**](docs/DefaultApi.md#getcommits_0) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits |
*DefaultApi* | [**GetContent**](docs/DefaultApi.md#getcontent) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/browse |
*DefaultApi* | [**GetContent_0**](docs/DefaultApi.md#getcontent_0) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/browse/{path} |
*DefaultApi* | [**GetContent_1**](docs/DefaultApi.md#getcontent_1) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/raw |
*DefaultApi* | [**GetContent_2**](docs/DefaultApi.md#getcontent_2) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/raw/{path} |
*DefaultApi* | [**GetDefaultBranch**](docs/DefaultApi.md#getdefaultbranch) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches/default |
*DefaultApi* | [**GetForkedRepositories**](docs/DefaultApi.md#getforkedrepositories) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/forks |
*DefaultApi* | [**GetGroups**](docs/DefaultApi.md#getgroups) | **Get** /api/1.0/admin/groups |
*DefaultApi* | [**GetGroupsWithAnyPermission**](docs/DefaultApi.md#getgroupswithanypermission) | **Get** /api/1.0/admin/permissions/groups |
*DefaultApi* | [**GetGroupsWithAnyPermission_0**](docs/DefaultApi.md#getgroupswithanypermission_0) | **Get** /api/1.0/projects/{projectKey}/permissions/groups |
*DefaultApi* | [**GetGroupsWithAnyPermission_1**](docs/DefaultApi.md#getgroupswithanypermission_1) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/groups |
*DefaultApi* | [**GetGroupsWithoutAnyPermission**](docs/DefaultApi.md#getgroupswithoutanypermission) | **Get** /api/1.0/admin/permissions/groups/none |
*DefaultApi* | [**GetGroupsWithoutAnyPermission_0**](docs/DefaultApi.md#getgroupswithoutanypermission_0) | **Get** /api/1.0/projects/{projectKey}/permissions/groups/none |
*DefaultApi* | [**GetGroupsWithoutAnyPermission_1**](docs/DefaultApi.md#getgroupswithoutanypermission_1) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/groups/none |
*DefaultApi* | [**GetGroups_0**](docs/DefaultApi.md#getgroups_0) | **Get** /api/1.0/groups |
*DefaultApi* | [**GetInformation**](docs/DefaultApi.md#getinformation) | **Get** /api/1.0/admin/cluster |
*DefaultApi* | [**GetLatestInvocation**](docs/DefaultApi.md#getlatestinvocation) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/latest |
*DefaultApi* | [**GetLevel**](docs/DefaultApi.md#getlevel) | **Get** /api/1.0/logs/logger/{loggerName} |
*DefaultApi* | [**GetMailConfig**](docs/DefaultApi.md#getmailconfig) | **Get** /api/1.0/admin/mail-server |
*DefaultApi* | [**GetMergeConfig**](docs/DefaultApi.md#getmergeconfig) | **Get** /api/1.0/admin/pull-requests/{scmId} |
*DefaultApi* | [**GetPage**](docs/DefaultApi.md#getpage) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests |
*DefaultApi* | [**GetProject**](docs/DefaultApi.md#getproject) | **Get** /api/1.0/projects/{projectKey} |
*DefaultApi* | [**GetProjectAvatar**](docs/DefaultApi.md#getprojectavatar) | **Get** /api/1.0/projects/{projectKey}/avatar.png |
*DefaultApi* | [**GetProjects**](docs/DefaultApi.md#getprojects) | **Get** /api/1.0/projects |
*DefaultApi* | [**GetPullRequestCount**](docs/DefaultApi.md#getpullrequestcount) | **Get** /api/1.0/inbox/pull-requests/count |
*DefaultApi* | [**GetPullRequestSettings**](docs/DefaultApi.md#getpullrequestsettings) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests |
*DefaultApi* | [**GetPullRequestSettings_0**](docs/DefaultApi.md#getpullrequestsettings_0) | **Get** /api/1.0/projects/{projectKey}/settings/pull-requests/{scmId} |
*DefaultApi* | [**GetPullRequestSuggestions**](docs/DefaultApi.md#getpullrequestsuggestions) | **Get** /api/1.0/dashboard/pull-request-suggestions |
*DefaultApi* | [**GetPullRequestTasks**](docs/DefaultApi.md#getpullrequesttasks) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks |
*DefaultApi* | [**GetPullRequests**](docs/DefaultApi.md#getpullrequests) | **Get** /api/1.0/dashboard/pull-requests |
*DefaultApi* | [**GetPullRequests_0**](docs/DefaultApi.md#getpullrequests_0) | **Get** /api/1.0/inbox/pull-requests |
*DefaultApi* | [**GetRelatedRepositories**](docs/DefaultApi.md#getrelatedrepositories) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/related |
*DefaultApi* | [**GetRepositories**](docs/DefaultApi.md#getrepositories) | **Get** /api/1.0/projects/{projectKey}/repos |
*DefaultApi* | [**GetRepositoriesRecentlyAccessed**](docs/DefaultApi.md#getrepositoriesrecentlyaccessed) | **Get** /api/1.0/profile/recent/repos |
*DefaultApi* | [**GetRepositories_0**](docs/DefaultApi.md#getrepositories_0) | **Get** /api/1.0/repos |
*DefaultApi* | [**GetRepository**](docs/DefaultApi.md#getrepository) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug} |
*DefaultApi* | [**GetRepositoryHook**](docs/DefaultApi.md#getrepositoryhook) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey} |
*DefaultApi* | [**GetRepositoryHook_0**](docs/DefaultApi.md#getrepositoryhook_0) | **Get** /api/1.0/projects/{projectKey}/settings/hooks/{hookKey} |
*DefaultApi* | [**GetRepositoryHooks**](docs/DefaultApi.md#getrepositoryhooks) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks |
*DefaultApi* | [**GetRepositoryHooks_0**](docs/DefaultApi.md#getrepositoryhooks_0) | **Get** /api/1.0/projects/{projectKey}/settings/hooks |
*DefaultApi* | [**GetRootLevel**](docs/DefaultApi.md#getrootlevel) | **Get** /api/1.0/logs/rootLogger |
*DefaultApi* | [**GetSenderAddress**](docs/DefaultApi.md#getsenderaddress) | **Get** /api/1.0/admin/mail-server/sender-address |
*DefaultApi* | [**GetSettings**](docs/DefaultApi.md#getsettings) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings |
*DefaultApi* | [**GetSettings_0**](docs/DefaultApi.md#getsettings_0) | **Get** /api/1.0/projects/{projectKey}/settings/hooks/{hookKey}/settings |
*DefaultApi* | [**GetStatistics**](docs/DefaultApi.md#getstatistics) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics |
*DefaultApi* | [**GetStatisticsSummary**](docs/DefaultApi.md#getstatisticssummary) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics/summary |
*DefaultApi* | [**GetTag**](docs/DefaultApi.md#gettag) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags/{name} |
*DefaultApi* | [**GetTags**](docs/DefaultApi.md#gettags) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags |
*DefaultApi* | [**GetTask**](docs/DefaultApi.md#gettask) | **Get** /api/1.0/tasks/{taskId} |
*DefaultApi* | [**GetUser**](docs/DefaultApi.md#getuser) | **Get** /api/1.0/users/{userSlug} |
*DefaultApi* | [**GetUserSettings**](docs/DefaultApi.md#getusersettings) | **Get** /api/1.0/users/{userSlug}/settings |
*DefaultApi* | [**GetUsers**](docs/DefaultApi.md#getusers) | **Get** /api/1.0/admin/users |
*DefaultApi* | [**GetUsersWithAnyPermission**](docs/DefaultApi.md#getuserswithanypermission) | **Get** /api/1.0/admin/permissions/users |
*DefaultApi* | [**GetUsersWithAnyPermission_0**](docs/DefaultApi.md#getuserswithanypermission_0) | **Get** /api/1.0/projects/{projectKey}/permissions/users |
*DefaultApi* | [**GetUsersWithAnyPermission_1**](docs/DefaultApi.md#getuserswithanypermission_1) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/users |
*DefaultApi* | [**GetUsersWithoutAnyPermission**](docs/DefaultApi.md#getuserswithoutanypermission) | **Get** /api/1.0/admin/permissions/users/none |
*DefaultApi* | [**GetUsersWithoutPermission**](docs/DefaultApi.md#getuserswithoutpermission) | **Get** /api/1.0/projects/{projectKey}/permissions/users/none |
*DefaultApi* | [**GetUsersWithoutPermission_0**](docs/DefaultApi.md#getuserswithoutpermission_0) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/users/none |
*DefaultApi* | [**GetUsers_0**](docs/DefaultApi.md#getusers_0) | **Get** /api/1.0/users |
*DefaultApi* | [**GetWebhook**](docs/DefaultApi.md#getwebhook) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId} |
*DefaultApi* | [**Get_0**](docs/DefaultApi.md#get_0) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId} |
*DefaultApi* | [**HasAllUserPermission**](docs/DefaultApi.md#hasalluserpermission) | **Get** /api/1.0/projects/{projectKey}/permissions/{permission}/all |
*DefaultApi* | [**ListParticipants**](docs/DefaultApi.md#listparticipants) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants |
*DefaultApi* | [**Merge**](docs/DefaultApi.md#merge) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge |
*DefaultApi* | [**ModifyAllUserPermission**](docs/DefaultApi.md#modifyalluserpermission) | **Post** /api/1.0/projects/{projectKey}/permissions/{permission}/all |
*DefaultApi* | [**Preview**](docs/DefaultApi.md#preview) | **Post** /api/1.0/markup/preview |
*DefaultApi* | [**RemoveGroupFromUser**](docs/DefaultApi.md#removegroupfromuser) | **Post** /api/1.0/admin/users/remove-group |
*DefaultApi* | [**RemoveUserFromGroup**](docs/DefaultApi.md#removeuserfromgroup) | **Post** /api/1.0/admin/groups/remove-user |
*DefaultApi* | [**RenameUser**](docs/DefaultApi.md#renameuser) | **Post** /api/1.0/admin/users/rename |
*DefaultApi* | [**Reopen**](docs/DefaultApi.md#reopen) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reopen |
*DefaultApi* | [**RetryCreateRepository**](docs/DefaultApi.md#retrycreaterepository) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/recreate |
*DefaultApi* | [**RevokePermissionsForGroup**](docs/DefaultApi.md#revokepermissionsforgroup) | **Delete** /api/1.0/admin/permissions/groups |
*DefaultApi* | [**RevokePermissionsForGroup_0**](docs/DefaultApi.md#revokepermissionsforgroup_0) | **Delete** /api/1.0/projects/{projectKey}/permissions/groups |
*DefaultApi* | [**RevokePermissionsForGroup_1**](docs/DefaultApi.md#revokepermissionsforgroup_1) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/groups |
*DefaultApi* | [**RevokePermissionsForUser**](docs/DefaultApi.md#revokepermissionsforuser) | **Delete** /api/1.0/admin/permissions/users |
*DefaultApi* | [**RevokePermissionsForUser_0**](docs/DefaultApi.md#revokepermissionsforuser_0) | **Delete** /api/1.0/projects/{projectKey}/permissions/users |
*DefaultApi* | [**RevokePermissionsForUser_1**](docs/DefaultApi.md#revokepermissionsforuser_1) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/users |
*DefaultApi* | [**Search**](docs/DefaultApi.md#search) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/participants |
*DefaultApi* | [**SetDefaultBranch**](docs/DefaultApi.md#setdefaultbranch) | **Put** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches/default |
*DefaultApi* | [**SetLevel**](docs/DefaultApi.md#setlevel) | **Put** /api/1.0/logs/logger/{loggerName}/{levelName} |
*DefaultApi* | [**SetMailConfig**](docs/DefaultApi.md#setmailconfig) | **Put** /api/1.0/admin/mail-server |
*DefaultApi* | [**SetMergeConfig**](docs/DefaultApi.md#setmergeconfig) | **Post** /api/1.0/admin/pull-requests/{scmId} |
*DefaultApi* | [**SetPermissionForGroup**](docs/DefaultApi.md#setpermissionforgroup) | **Put** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/groups |
*DefaultApi* | [**SetPermissionForGroups**](docs/DefaultApi.md#setpermissionforgroups) | **Put** /api/1.0/admin/permissions/groups |
*DefaultApi* | [**SetPermissionForGroups_0**](docs/DefaultApi.md#setpermissionforgroups_0) | **Put** /api/1.0/projects/{projectKey}/permissions/groups |
*DefaultApi* | [**SetPermissionForUser**](docs/DefaultApi.md#setpermissionforuser) | **Put** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/users |
*DefaultApi* | [**SetPermissionForUsers**](docs/DefaultApi.md#setpermissionforusers) | **Put** /api/1.0/admin/permissions/users |
*DefaultApi* | [**SetPermissionForUsers_0**](docs/DefaultApi.md#setpermissionforusers_0) | **Put** /api/1.0/projects/{projectKey}/permissions/users |
*DefaultApi* | [**SetRootLevel**](docs/DefaultApi.md#setrootlevel) | **Put** /api/1.0/logs/rootLogger/{levelName} |
*DefaultApi* | [**SetSenderAddress**](docs/DefaultApi.md#setsenderaddress) | **Put** /api/1.0/admin/mail-server/sender-address |
*DefaultApi* | [**SetSettings**](docs/DefaultApi.md#setsettings) | **Put** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings |
*DefaultApi* | [**SetSettings_0**](docs/DefaultApi.md#setsettings_0) | **Put** /api/1.0/projects/{projectKey}/settings/hooks/{hookKey}/settings |
*DefaultApi* | [**Stream**](docs/DefaultApi.md#stream) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/last-modified |
*DefaultApi* | [**StreamChanges**](docs/DefaultApi.md#streamchanges) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/compare/changes |
*DefaultApi* | [**StreamChanges_0**](docs/DefaultApi.md#streamchanges_0) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changes |
*DefaultApi* | [**StreamCommits**](docs/DefaultApi.md#streamcommits) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/compare/commits |
*DefaultApi* | [**StreamDiff**](docs/DefaultApi.md#streamdiff) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff |
*DefaultApi* | [**StreamDiff_0**](docs/DefaultApi.md#streamdiff_0) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff/{path} |
*DefaultApi* | [**StreamDiff_1**](docs/DefaultApi.md#streamdiff_1) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/compare/diff{path} |
*DefaultApi* | [**StreamDiff_2**](docs/DefaultApi.md#streamdiff_2) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/diff |
*DefaultApi* | [**StreamDiff_3**](docs/DefaultApi.md#streamdiff_3) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/diff/{path} |
*DefaultApi* | [**StreamDiff_4**](docs/DefaultApi.md#streamdiff_4) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff |
*DefaultApi* | [**StreamDiff_5**](docs/DefaultApi.md#streamdiff_5) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff/{path} |
*DefaultApi* | [**StreamFiles**](docs/DefaultApi.md#streamfiles) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/files |
*DefaultApi* | [**StreamFiles_0**](docs/DefaultApi.md#streamfiles_0) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/files/{path} |
*DefaultApi* | [**Stream_0**](docs/DefaultApi.md#stream_0) | **Get** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/last-modified/{path} |
*DefaultApi* | [**TestWebhook**](docs/DefaultApi.md#testwebhook) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/test |
*DefaultApi* | [**UnassignParticipantRole**](docs/DefaultApi.md#unassignparticipantrole) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants |
*DefaultApi* | [**UnassignParticipantRole_0**](docs/DefaultApi.md#unassignparticipantrole_0) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug} |
*DefaultApi* | [**Unwatch**](docs/DefaultApi.md#unwatch) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch |
*DefaultApi* | [**Unwatch_0**](docs/DefaultApi.md#unwatch_0) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch |
*DefaultApi* | [**Update**](docs/DefaultApi.md#update) | **Post** /api/1.0/admin/license |
*DefaultApi* | [**UpdateComment**](docs/DefaultApi.md#updatecomment) | **Put** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId} |
*DefaultApi* | [**UpdateComment_0**](docs/DefaultApi.md#updatecomment_0) | **Put** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId} |
*DefaultApi* | [**UpdateProject**](docs/DefaultApi.md#updateproject) | **Put** /api/1.0/projects/{projectKey} |
*DefaultApi* | [**UpdatePullRequestSettings**](docs/DefaultApi.md#updatepullrequestsettings) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests |
*DefaultApi* | [**UpdatePullRequestSettings_0**](docs/DefaultApi.md#updatepullrequestsettings_0) | **Post** /api/1.0/projects/{projectKey}/settings/pull-requests/{scmId} |
*DefaultApi* | [**UpdateRepository**](docs/DefaultApi.md#updaterepository) | **Put** /api/1.0/projects/{projectKey}/repos/{repositorySlug} |
*DefaultApi* | [**UpdateSettings**](docs/DefaultApi.md#updatesettings) | **Post** /api/1.0/users/{userSlug}/settings |
*DefaultApi* | [**UpdateStatus**](docs/DefaultApi.md#updatestatus) | **Put** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug} |
*DefaultApi* | [**UpdateTask**](docs/DefaultApi.md#updatetask) | **Put** /api/1.0/tasks/{taskId} |
*DefaultApi* | [**UpdateUserDetails**](docs/DefaultApi.md#updateuserdetails) | **Put** /api/1.0/admin/users |
*DefaultApi* | [**UpdateUserDetails_0**](docs/DefaultApi.md#updateuserdetails_0) | **Put** /api/1.0/users |
*DefaultApi* | [**UpdateUserPassword**](docs/DefaultApi.md#updateuserpassword) | **Put** /api/1.0/admin/users/credentials |
*DefaultApi* | [**UpdateUserPassword_0**](docs/DefaultApi.md#updateuserpassword_0) | **Put** /api/1.0/users/credentials |
*DefaultApi* | [**UpdateWebhook**](docs/DefaultApi.md#updatewebhook) | **Put** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId} |
*DefaultApi* | [**Update_0**](docs/DefaultApi.md#update_0) | **Put** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId} |
*DefaultApi* | [**UploadAvatar**](docs/DefaultApi.md#uploadavatar) | **Post** /api/1.0/projects/{projectKey}/avatar.png |
*DefaultApi* | [**UploadAvatar_0**](docs/DefaultApi.md#uploadavatar_0) | **Post** /api/1.0/users/{userSlug}/avatar.png |
*DefaultApi* | [**Watch**](docs/DefaultApi.md#watch) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch |
*DefaultApi* | [**Watch_0**](docs/DefaultApi.md#watch_0) | **Post** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch |
*DefaultApi* | [**WithdrawApproval**](docs/DefaultApi.md#withdrawapproval) | **Delete** /api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approve |
## Documentation For Models
## Documentation For Authorization
Endpoints do not require authorization.
## Author

423
api_client.go Normal file
View File

@ -0,0 +1,423 @@
/*
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"bytes"
"encoding/json"
"encoding/xml"
"fmt"
"errors"
"io"
"mime/multipart"
"golang.org/x/oauth2"
"golang.org/x/net/context"
"net/http"
"net/url"
"time"
"os"
"path/filepath"
"reflect"
"regexp"
"strings"
"unicode/utf8"
"strconv"
)
var (
jsonCheck = regexp.MustCompile("(?i:[application|text]/json)")
xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)")
)
// APIClient manages communication with the API v
// In most cases there should be only one, shared, APIClient.
type APIClient struct {
cfg *Configuration
common service // Reuse a single struct instead of allocating one for each service on the heap.
// API Services
DefaultApi *DefaultApiService
}
type service struct {
client *APIClient
}
// NewAPIClient creates a new API client. Requires a userAgent string describing your application.
// optionally a custom http.Client to allow for advanced features such as caching.
func NewAPIClient(cfg *Configuration) *APIClient {
if cfg.HTTPClient == nil {
cfg.HTTPClient = http.DefaultClient
}
c := &APIClient{}
c.cfg = cfg
c.common.client = c
// API Services
c.DefaultApi = (*DefaultApiService)(&c.common)
return c
}
func atoi(in string) (int, error) {
return strconv.Atoi(in)
}
// selectHeaderContentType select a content type from the available list.
func selectHeaderContentType(contentTypes []string) string {
if len(contentTypes) == 0 {
return ""
}
if contains(contentTypes, "application/json") {
return "application/json"
}
return contentTypes[0] // use the first content type specified in 'consumes'
}
// selectHeaderAccept join all accept types and return
func selectHeaderAccept(accepts []string) string {
if len(accepts) == 0 {
return ""
}
if contains(accepts, "application/json") {
return "application/json"
}
return strings.Join(accepts, ",")
}
// contains is a case insenstive match, finding needle in a haystack
func contains(haystack []string, needle string) bool {
for _, a := range haystack {
if strings.ToLower(a) == strings.ToLower(needle) {
return true
}
}
return false
}
// Verify optional parameters are of the correct type.
func typeCheckParameter(obj interface{}, expected string, name string) error {
// Make sure there is an object.
if obj == nil {
return nil
}
// Check the type is as expected.
if reflect.TypeOf(obj).String() != expected {
return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String())
}
return nil
}
// parameterToString convert interface{} parameters to string, using a delimiter if format is provided.
func parameterToString(obj interface{}, collectionFormat string) string {
var delimiter string
switch collectionFormat {
case "pipes":
delimiter = "|"
case "ssv":
delimiter = " "
case "tsv":
delimiter = "\t"
case "csv":
delimiter = ","
}
if reflect.TypeOf(obj).Kind() == reflect.Slice {
return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]")
}
return fmt.Sprintf("%v", obj)
}
// callAPI do the request.
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
return c.cfg.HTTPClient.Do(request)
}
// Change base path to allow switching to mocks
func (c *APIClient) ChangeBasePath (path string) {
c.cfg.BasePath = path
}
// prepareRequest build the request
func (c *APIClient) prepareRequest (
ctx context.Context,
path string, method string,
postBody interface{},
headerParams map[string]string,
queryParams url.Values,
formParams url.Values,
fileName string,
fileBytes []byte) (localVarRequest *http.Request, err error) {
var body *bytes.Buffer
// Detect postBody type and post.
if postBody != nil {
contentType := headerParams["Content-Type"]
if contentType == "" {
contentType = detectContentType(postBody)
headerParams["Content-Type"] = contentType
}
body, err = setBody(postBody, contentType)
if err != nil {
return nil, err
}
}
// add form parameters and file if available.
if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") {
if body != nil {
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
}
body = &bytes.Buffer{}
w := multipart.NewWriter(body)
for k, v := range formParams {
for _, iv := range v {
if strings.HasPrefix(k, "@") { // file
err = addFile(w, k[1:], iv)
if err != nil {
return nil, err
}
} else { // form value
w.WriteField(k, iv)
}
}
}
if len(fileBytes) > 0 && fileName != "" {
w.Boundary()
//_, fileNm := filepath.Split(fileName)
part, err := w.CreateFormFile("file", filepath.Base(fileName))
if err != nil {
return nil, err
}
_, err = part.Write(fileBytes)
if err != nil {
return nil, err
}
// Set the Boundary in the Content-Type
headerParams["Content-Type"] = w.FormDataContentType()
}
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
w.Close()
}
// Setup path and query parameters
url, err := url.Parse(path)
if err != nil {
return nil, err
}
// Adding Query Param
query := url.Query()
for k, v := range queryParams {
for _, iv := range v {
query.Add(k, iv)
}
}
// Encode the parameters.
url.RawQuery = query.Encode()
// Generate a new request
if body != nil {
localVarRequest, err = http.NewRequest(method, url.String(), body)
} else {
localVarRequest, err = http.NewRequest(method, url.String(), nil)
}
if err != nil {
return nil, err
}
// add header parameters, if any
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers.Set(h, v)
}
localVarRequest.Header = headers
}
// Override request host, if applicable
if c.cfg.Host != "" {
localVarRequest.Host = c.cfg.Host
}
// Add the user agent to the request.
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
if ctx != nil {
// add context to the request
localVarRequest = localVarRequest.WithContext(ctx)
// Walk through any authentication.
// OAuth2 authentication
if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok {
// We were able to grab an oauth2 token from the context
var latestToken *oauth2.Token
if latestToken, err = tok.Token(); err != nil {
return nil, err
}
latestToken.SetAuthHeader(localVarRequest)
}
// Basic HTTP Authentication
if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok {
localVarRequest.SetBasicAuth(auth.UserName, auth.Password)
}
// AccessToken Authentication
if auth, ok := ctx.Value(ContextAccessToken).(string); ok {
localVarRequest.Header.Add("Authorization", "Bearer " + auth)
}
}
for header, value := range c.cfg.DefaultHeader {
localVarRequest.Header.Add(header, value)
}
return localVarRequest, nil
}
// Add a file to the multipart request
func addFile(w *multipart.Writer, fieldName, path string) error {
file, err := os.Open(path)
if err != nil {
return err
}
defer file.Close()
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
if err != nil {
return err
}
_, err = io.Copy(part, file)
return err
}
// Prevent trying to import "fmt"
func reportError(format string, a ...interface{}) (error) {
return fmt.Errorf(format, a...)
}
// Set request body from an interface{}
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
if bodyBuf == nil {
bodyBuf = &bytes.Buffer{}
}
if reader, ok := body.(io.Reader); ok {
_, err = bodyBuf.ReadFrom(reader)
} else if b, ok := body.([]byte); ok {
_, err = bodyBuf.Write(b)
} else if s, ok := body.(string); ok {
_, err = bodyBuf.WriteString(s)
} else if jsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if xmlCheck.MatchString(contentType) {
xml.NewEncoder(bodyBuf).Encode(body)
}
if err != nil {
return nil, err
}
if bodyBuf.Len() == 0 {
err = fmt.Errorf("Invalid body type %s\n", contentType)
return nil, err
}
return bodyBuf, nil
}
// detectContentType method is used to figure out `Request.Body` content type for request header
func detectContentType(body interface{}) string {
contentType := "text/plain; charset=utf-8"
kind := reflect.TypeOf(body).Kind()
switch kind {
case reflect.Struct, reflect.Map, reflect.Ptr:
contentType = "application/json; charset=utf-8"
case reflect.String:
contentType = "text/plain; charset=utf-8"
default:
if b, ok := body.([]byte); ok {
contentType = http.DetectContentType(b)
} else if kind == reflect.Slice {
contentType = "application/json; charset=utf-8"
}
}
return contentType
}
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
type cacheControl map[string]string
func parseCacheControl(headers http.Header) cacheControl {
cc := cacheControl{}
ccHeader := headers.Get("Cache-Control")
for _, part := range strings.Split(ccHeader, ",") {
part = strings.Trim(part, " ")
if part == "" {
continue
}
if strings.ContainsRune(part, '=') {
keyval := strings.Split(part, "=")
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
} else {
cc[part] = ""
}
}
return cc
}
// CacheExpires helper function to determine remaining time before repeating a request.
func CacheExpires(r *http.Response) (time.Time) {
// Figure out when the cache expires.
var expires time.Time
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
if err != nil {
return time.Now()
}
respCacheControl := parseCacheControl(r.Header)
if maxAge, ok := respCacheControl["max-age"]; ok {
lifetime, err := time.ParseDuration(maxAge + "s")
if err != nil {
expires = now
}
expires = now.Add(lifetime)
} else {
expiresHeader := r.Header.Get("Expires")
if expiresHeader != "" {
expires, err = time.Parse(time.RFC1123, expiresHeader)
if err != nil {
expires = now
}
}
}
return expires
}
func strlen(s string) (int) {
return utf8.RuneCountInString(s)
}

38
api_response.go Normal file
View File

@ -0,0 +1,38 @@
/*
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"net/http"
)
type APIResponse struct {
*http.Response `json:"-"`
Message string `json:"message,omitempty"`
// Operation is the name of the swagger operation.
Operation string `json:"operation,omitempty"`
// RequestURL is the request URL. This value is always available, even if the
// embedded *http.Response is nil.
RequestURL string `json:"url,omitempty"`
// Method is the HTTP method used for the request. This value is always
// available, even if the embedded *http.Response is nil.
Method string `json:"method,omitempty"`
// Payload holds the contents of the response body (which may be nil or empty).
// This is provided here as the raw response.Body() reader will have already
// been drained.
Payload []byte `json:"-"`
}
func NewAPIResponse(r *http.Response) *APIResponse {
response := &APIResponse{Response: r}
return response
}
func NewAPIResponseWithError(errorMessage string) *APIResponse {
response := &APIResponse{Message: errorMessage}
return response
}

67
configuration.go Normal file
View File

@ -0,0 +1,67 @@
/*
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"net/http"
)
// contextKeys are used to identify the type of value in the context.
// Since these are string, it is possible to get a short description of the
// context key for logging and debugging using key.String().
type contextKey string
func (c contextKey) String() string {
return "auth " + string(c)
}
var (
// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
ContextOAuth2 = contextKey("token")
// ContextBasicAuth takes BasicAuth as authentication for the request.
ContextBasicAuth = contextKey("basic")
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAccessToken = contextKey("accesstoken")
// ContextAPIKey takes an APIKey as authentication for the request
ContextAPIKey = contextKey("apikey")
)
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type BasicAuth struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
}
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIKey struct {
Key string
Prefix string
}
type Configuration struct {
BasePath string `json:"basePath,omitempty"`
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
HTTPClient *http.Client
}
func NewConfiguration() *Configuration {
cfg := &Configuration{
BasePath: "http://example.com/rest/",
DefaultHeader: make(map[string]string),
UserAgent: "Swagger-Codegen/1.0.0/go",
}
return cfg
}
func (c *Configuration) AddDefaultHeader(key string, value string) {
c.DefaultHeader[key] = value
}

12454
default_api.go Normal file

File diff suppressed because it is too large Load Diff

6204
docs/DefaultApi.md Normal file

File diff suppressed because it is too large Load Diff

52
git_push.sh Normal file
View File

@ -0,0 +1,52 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'