Commit graph

215 commits

Author SHA1 Message Date
6543
83da05b95f Milestone Functions accept name to identify (#418)
do not use interface for sdk ...

url.PathEscape()

add Tests

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/418
Reviewed-by: mrsdizzie <info@mrsdizzie.com>
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
2020-09-15 16:29:24 +00:00
6543
51d1bddc8a Make http requests with context (#417)
Functional Options dont have a reason for an error (at the moment)

fix test & code comment

md format

add SetSudo

always use Context

Add Migration Docu

Use Functional Options fo NewClient

Merge branch 'master' into with-ctx

optional exec http requests with context

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/417
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
2020-09-15 16:21:40 +00:00
6543
688ee1978e All Function return http responce (#416)
Add Docs on how to deal with this breaking change

doResponse should return responce in all cases, to prosses things manualy if wanted

helper func return http response

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/416
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-09-14 02:37:09 +00:00
6543
99768b87a7 Migration Api Changed (#392)
better code comments

comment out not-supported-git-services

Update MigrateRepoOption and add fallback

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/392
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
2020-09-12 13:58:08 +00:00
6543
b0d91b2b9e DeleteToken Accept Names too (#394)
DeleteAccessToken: accept string too

Co-authored-by: lafriks <lafriks@noreply.gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/394
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
2020-09-10 12:34:32 +00:00
6543
dd1ecd4b3d TrackedTime API >= 1.11.x needed (#415)
Merge branch 'master' into more-version-checks

TrackedTime API >= 1.11.x needed

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/415
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-09-10 01:37:55 +00:00
6543
87f7b1866d Add GetGlobalAttachmentSettings (#414)
Add GetGlobalAttachmentSettings

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/414
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-09-07 22:19:38 +00:00
6543
5b418aa8c6 Add CreateBranch (#407)
Add CreateBranch

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/407
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-09-07 04:24:59 +00:00
6543
fb7de7ecb8 Add Admin CronTask functions (#406)
Add Admin CronTask functions

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/406
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-09-07 04:11:39 +00:00
6543
18f39029e9 Pull : Add a Fallback for GetPullRequestDiff/Patch (#399)
add VersionCheck and fallback for old instance

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/399
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-09-07 03:17:54 +00:00
6543
6594bf0b20 Add GetGlobalAPISettings Function (#404)
Get Global Limitation Settings

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/404
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-09-07 03:09:10 +00:00
6543
88552ee13a Remove opts from ListPullReviewComments (#411)
Remove ListPullReviewsCommentsOptions as ListPullReviewComments has no options

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/411
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Gary Kim <gary@garykim.dev>
2020-09-07 03:00:26 +00:00
6543
595ceb32ff Add GetArchive (#413)
Add GetArchive

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/413
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-09-06 22:14:39 +00:00
6543
4f53f33ebf Update Milestone struct (#410)
Update Milestone struct
add Created and Updated

source: https://github.com/go-gitea/gitea/pull/12662

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/410
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-09-06 17:31:04 +00:00
6543
5904d8e622 Add GetRepoLanguages (#412)
Add GetRepoLanguages

Add Migration Language Tests

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/412
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-09-06 17:20:00 +00:00
6543
1a3d9bf20c Use enum AccessMode for OrgTeam and Collaborator functions (#408)
add docu for breaking change

Use enum AccessMode for OrgTeam and Collaborator functions
and update Team structs

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/408
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-09-06 13:24:45 +00:00
6543
a6cca9eec1 Update ListMilestoneOption struct (#393)
Update ListMilestoneOption struct

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/393
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-09-05 06:27:44 +00:00
abayer
c2f232c130 Add .diff and .patch endpoints for pull requests (#398)
Add .diff and .patch endpoints for pull requests

fixes #364

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>

Co-authored-by: Andrew Bayer <andrew.bayer@gmail.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/398
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: 6543 <6543@noreply.gitea.io>
2020-09-04 19:21:05 +00:00
6543
9e280adb4d CreateOrgOption rename UserName to Name (#386)
add docu

CreateOrgOption rename UserName to Name
since it is the name of the new Organisation and not some User

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/386
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-07-30 19:46:18 +00:00
6543
f67cf3c5d0 Extend Notification Functions (#381)
add info about vararg

use fake vararg as per @zeripath

Merge branch 'master' into extend-list-notification

nit

fix

extend notification functions - handle pinned ones

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/381
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-07-21 12:28:16 +00:00
6543
b04ccca570 Refactor Visibletype Orgs (#382)
refactor VisibleType

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/382
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-07-16 02:17:33 +00:00
6543
1026b1014c Refactor RepoSearch to be easy usable (#346)
Allow EdgeCases

Transform Uggly API to Prity Search Function

Update & add description of SearchRepoOptions

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/346
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
2020-07-11 19:54:57 +00:00
6543
27b4fdd986 Impruve Error Handling (#351)
ajust test for new gitea responce

dedub

Merge branch 'master' into impruve-error-handling

Merge branch 'master' into impruve-error-handling

Merge branch 'master' into impruve-error-handling

if 500 error has ErrMsg return this else return request witch was made

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/351
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
2020-07-08 17:21:40 +00:00
6543
c388803b68 Update GetGlobalSettings Functions (#376)
extend Test

Update GetGlobalSettings functions

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/376
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Gary Kim <gary@garykim.dev>
2020-06-30 20:29:09 +00:00
6543
316d2391df Allow Creating Closed Milestones (#373)
Allow Creating Closed Milestones

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/373
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-06-19 04:49:31 +00:00
6543
5d880baff1 Add Validate func for Create/Edit Options (#370)
add TestLabels TEST

fix ...

impruve CreatePullReviewOptions Validate

some code refactor & reformat

add Validate functions where it make sence

add Validate() for CreateLabelOption

rm ToDo - not needed

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/370
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-06-09 10:47:55 +00:00
6543
7f50d48c01 File Create/Update/Delete detect DefaultBranch if Branch not set for old Versions (#352)
Gitea >= 1.12.0 Use DefaultBranch on "", mimic this for older versions

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/352
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-06-09 10:11:14 +00:00
6543
6a00d39ee1 CreateLabel correct Color if needed for old versions (#365)
Merge branch 'master' into CreateLabel_correct-format-for-old-intances

CreateLabel correct Color if needed for old versions

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/365
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-06-09 07:51:37 +00:00
6543
9be8754fec Add Function to get GetGlobalSettings and GetSettingAllowedReactions (#359)
Add Function to get GetGlobalSettings and GetSettingAllowedReactions

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/359
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-06-09 00:19:14 +00:00
6543
c5211db2e7 EditMilestoneOption also use StateType (#350)
Merge branch 'master' into EditMilestone_also-use-StateType

Merge branch 'master' into EditMilestone_also-use-StateType

fix test

Merge branch 'master' into EditMilestone_also-use-StateType

EditMilestoneOption also use StateType

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/350
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-06-04 09:19:02 +00:00
6543
8829e1fe6f Issue/Pull add IsLocked Property (#357)
Merge branch 'master' into issue-pull_add_IsLocked

Issue/Pull add IsLocked Property

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/357
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-06-04 01:01:13 +00:00
blaggacao
98cfcfe13b Update EditPullRequestOption Add Base (#353)
Follow https://github.com/go-gitea/gitea/pull/11666

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/353
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
2020-06-03 17:54:19 +00:00
6543
e7c56d8f50 fix ineffassign in Tests & set Version v0.13.0 (#345)
increment version

fix ineffassign

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/345
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-05-27 13:04:51 +00:00
6543
057518ef80 Add PullReview functions (#338)
add TESTS

better name

First Version

Add Structs & function placeholders

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/338
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-05-21 18:04:48 +00:00
6543
2e81813c45 Add BranchProtection functions (#341)
Merge branch 'master' into branch-protection

Merge branch 'master' into branch-protection

Merge branch 'master' into branch-protection

Merge branch 'master' into branch-protection

Merge branch 'master' into branch-protection

fix + add TESTS

first draft

Add structs and placeholder

Update Branch struct

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/341
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-05-21 17:52:51 +00:00
6543
3c36bd251b Copy DeleteFileOptions struct fields into UpdateFileOptions struct (#330) 2020-05-21 10:13:32 +00:00
6543
b4696d5416 PullMerge: use enum for MergeStyle (#328)
Its already Breaking ... make struct look nice

Signed-off-by: 6543 <6543@obermui.de>

PullMerge: use enum for MergeStyle

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/328
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
2020-05-20 22:41:21 +00:00
6543
2cc36f912f Check if gitea is able to squash-merge via API (#336)
Check if gitea is able to squash-merge via API

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/336
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: CirnoT <cirnot@noreply.gitea.io>
2020-05-20 13:01:06 +00:00
6543
bb6248f50d Add paggination to ListNotification functions (#339)
Merge branch 'master' into update-notifications

Merge branch 'master' into update-notifications

rm nonesence - dont know why i put it there

add paggination to ListNotification functions

refactor

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/339
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-05-20 08:26:47 +00:00
6543
f224b4e50c ListIssues: add milestones filter (#327)
use string.Join

Code Format

add test case

add Milestones to ListIssueOption

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/327
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-05-20 06:48:06 +00:00
6543
70863f4458 Support 2FA for basic auth & refactor Token functions (#335)
BREAKING: Token functions: remove username&passwd param - use default client auth way

refactor

add otp Field

refacotr ...

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/335
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-05-19 22:16:37 +00:00
6543
93087537ff Corect test Title: TestIssueSubscription (#326)
Corect test Title: TestIssueSubscription

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/326
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-05-19 06:33:05 +00:00
6543
2883376503 Revert "API split for: to get single commit via SHA and Ref (#319)" (#324)
Merge branch 'master' into revert-commit-api-split

Revert "API split for: to get single commit via SHA and Ref (#319)"

This reverts commit 36d2964230.

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/324
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-05-11 19:03:14 +00:00
6543
fb7355a186 IssueUn-/Subscription take care of new 200 status (#325)
IssueUn-/Subscription handle 200 status

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/325
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
2020-05-11 15:28:10 +00:00
6543
36d2964230 API split for: to get single commit via SHA and Ref (#319)
Split API

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/319
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-04-27 16:29:43 +00:00
6543
50560273b9 Add Branch Deletion (#317)
add TEST for branches

dont return empty branch on error

add DeleteBranch func

Co-authored-by: lafriks <lafriks@noreply.gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/317
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
2020-04-24 15:39:40 +00:00
6543
7dfa25bb30 Add Issue Subscription Check & Fix DeleteIssueSubscription (#318)
add subscription tests

make createTestIssue reusable

Add CheckIssueSubscription

fix

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/318
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
2020-04-24 14:37:28 +00:00
6543
79665cae15 Fix MergePullRequest & extend Tests (#278)
rm MergePullRequestResponse

Fix MergePullRequest

Extend Tests

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/278
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-04-23 12:51:36 +00:00
Dan
0cf676d9f9 Add Get/Update for oauth2 apps (#311)
Update Documentation for Oauth2 Application delete

also fix variable names to be similar to existing functions

Signed-off-by: Dan Molik <dan@danmolik.com>

Add Get/Update for oauth2 apps

  Add a get by id function for oauth applications, and add an update
  function, also ensuring the oauth2 update regenerates the client
  secret.

Signed-off-by: Dan Molik <dan@danmolik.com>

Co-authored-by: Dan Molik <dan@danmolik.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/311
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-04-20 13:17:57 +00:00
6543
50efd911c8 Tune CheckNotifications for api change (#308)
notification Check now always return json

make fmt relicts

CheckNotifications: one api call is enouth

add getResponseWithStatus to handle Response customized based on Status

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/308
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-04-14 13:29:44 +00:00