package
2.0.0-alpha+incompatible
Repository: https://github.com/samkreter/vsts-goclient.git
Documentation: pkg.go.dev

# README

Go API client for swagger

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 5.0-preview
  • 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:

import "./swagger"

Documentation for API Endpoints

All URIs are relative to https://fabrikam-fiber-inc.visualstudio.com

ClassMethodHTTP requestDescription
AnnotatedTagsApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/annotatedtags
AnnotatedTagsApiGetGet /{project}/_apis/git/repositories/{repositoryId}/annotatedtags/{objectId}
BlobsApiGetBlobGet /{project}/_apis/git/repositories/{repositoryId}/blobs/{sha1}
BlobsApiGetBlobsZipPost /{project}/_apis/git/repositories/{repositoryId}/blobs
CherryPicksApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/cherryPicks
CherryPicksApiGetCherryPickGet /{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}
CherryPicksApiGetCherryPickForRefNameGet /{project}/_apis/git/repositories/{repositoryId}/cherryPicks
CommitsApiGetGet /{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}
CommitsApiGetChangesGet /{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/changes
CommitsApiGetCommitsBatchPost /{project}/_apis/git/repositories/{repositoryId}/commitsbatch
CommitsApiGetPushCommitsGet /{project}/_apis/git/repositories/{repositoryId}/commits
DiffsApiGetGet /{project}/_apis/git/repositories/{repositoryId}/diffs/commits
ForksApiCreatePost /{project}/_apis/git/repositories/{repositoryNameOrId}/forkSyncRequests
ForksApiGetGet /{project}/_apis/git/repositories/{repositoryNameOrId}/forkSyncRequests/{forkSyncOperationId}
ForksApiGetForkSyncRequestsGet /{project}/_apis/git/repositories/{repositoryNameOrId}/forkSyncRequests
ForksApiListGet /{project}/_apis/git/repositories/{repositoryNameOrId}/forks/{collectionId}
ImportRequestsApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/importRequests
ImportRequestsApiGetGet /{project}/_apis/git/repositories/{repositoryId}/importRequests/{importRequestId}
ImportRequestsApiQueryGet /{project}/_apis/git/repositories/{repositoryId}/importRequests
ImportRequestsApiUpdatePatch /{project}/_apis/git/repositories/{repositoryId}/importRequests/{importRequestId}
ItemsApiGetItemsBatchPost /{project}/_apis/git/repositories/{repositoryId}/itemsbatch
ItemsApiListGet /{project}/_apis/git/repositories/{repositoryId}/items
MergeBasesApiListGet /{project}/_apis/git/repositories/{repositoryNameOrId}/commits/{commitId}/mergebases
PolicyConfigurationsApiListGet /{project}/_apis/git/policy/configurations
PullRequestAttachmentsApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}
PullRequestAttachmentsApiDeleteDelete /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}
PullRequestAttachmentsApiGetGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}
PullRequestAttachmentsApiListGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments
PullRequestCommentLikesApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}/likes
PullRequestCommentLikesApiDeleteDelete /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}/likes
PullRequestCommentLikesApiListGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}/likes
PullRequestCommitsApiGetPullRequestCommitsGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/commits
PullRequestCommitsApiGetPullRequestIterationCommitsGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/commits
PullRequestIterationChangesApiGetGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/changes
PullRequestIterationStatusesApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses
PullRequestIterationStatusesApiDeleteDelete /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses/{statusId}
PullRequestIterationStatusesApiGetGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses/{statusId}
PullRequestIterationStatusesApiListGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses
PullRequestIterationStatusesApiUpdatePatch /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses
PullRequestIterationsApiGetGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}
PullRequestIterationsApiListGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations
PullRequestLabelsApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/labels
PullRequestLabelsApiDeleteDelete /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/labels/{labelIdOrName}
PullRequestLabelsApiGetGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/labels/{labelIdOrName}
PullRequestLabelsApiListGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/labels
PullRequestPropertiesApiListGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/properties
PullRequestPropertiesApiUpdatePatch /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/properties
PullRequestQueryApiGetPost /{project}/_apis/git/repositories/{repositoryId}/pullrequestquery
PullRequestReviewersApiCreatePullRequestReviewerPut /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}
PullRequestReviewersApiCreatePullRequestReviewersPost /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers
PullRequestReviewersApiDeleteDelete /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}
PullRequestReviewersApiGetGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}
PullRequestReviewersApiListGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers
PullRequestReviewersApiUpdatePatch /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers
PullRequestShareApiSharePullRequestPost /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/share
PullRequestStatusesApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses
PullRequestStatusesApiDeleteDelete /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}
PullRequestStatusesApiGetGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}
PullRequestStatusesApiListGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses
PullRequestStatusesApiUpdatePatch /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses
PullRequestThreadCommentsApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments
PullRequestThreadCommentsApiDeleteDelete /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}
PullRequestThreadCommentsApiGetGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}
PullRequestThreadCommentsApiListGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments
PullRequestThreadCommentsApiUpdatePatch /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}
PullRequestThreadsApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads
PullRequestThreadsApiGetGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}
PullRequestThreadsApiListGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads
PullRequestThreadsApiUpdatePatch /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}
PullRequestWorkItemsApiListGet /{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/workitems
PullRequestsApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/pullrequests
PullRequestsApiGetPullRequestGet /{project}/_apis/git/repositories/{repositoryId}/pullrequests/{pullRequestId}
PullRequestsApiGetPullRequestByIdGet /{project}/_apis/git/pullrequests/{pullRequestId}
PullRequestsApiGetPullRequestsGet /{project}/_apis/git/repositories/{repositoryId}/pullrequests
PullRequestsApiGetPullRequestsByProjectGet /{project}/_apis/git/pullrequests
PullRequestsApiUpdatePatch /{project}/_apis/git/repositories/{repositoryId}/pullrequests/{pullRequestId}
PushesApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/pushes
PushesApiGetGet /{project}/_apis/git/repositories/{repositoryId}/pushes/{pushId}
PushesApiListGet /{project}/_apis/git/repositories/{repositoryId}/pushes
RefsApiListGet /{project}/_apis/git/repositories/{repositoryId}/refs
RefsApiUpdateRefPatch /{project}/_apis/git/repositories/{repositoryId}/refs
RefsApiUpdateRefsPost /{project}/_apis/git/repositories/{repositoryId}/refs
RefsFavoritesApiCreatePost /{project}/_apis/git/favorites/refs
RefsFavoritesApiDeleteDelete /{project}/_apis/git/favorites/refs/{favoriteId}
RefsFavoritesApiGetGet /{project}/_apis/git/favorites/refs/{favoriteId}
RefsFavoritesApiListGet /{project}/_apis/git/favorites/refs
RepositoriesApiCreatePost /{project}/_apis/git/repositories
RepositoriesApiDeleteDelete /{project}/_apis/git/repositories/{repositoryId}
RepositoriesApiDeleteRepositoryFromRecycleBinDelete /{project}/_apis/git/recycleBin/repositories/{repositoryId}
RepositoriesApiGetDeletedRepositoriesGet /{project}/_apis/git/deletedrepositories
RepositoriesApiGetRecycleBinRepositoriesGet /{project}/_apis/git/recycleBin/repositories
RepositoriesApiGetRepositoryGet /{project}/_apis/git/repositories/{repositoryId}
RepositoriesApiListGet /{project}/_apis/git/repositories
RepositoriesApiRestoreRepositoryFromRecycleBinPatch /{project}/_apis/git/recycleBin/repositories/{repositoryId}
RepositoriesApiUpdatePatch /{project}/_apis/git/repositories/{repositoryId}
RevertsApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/reverts
RevertsApiGetRevertGet /{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}
RevertsApiGetRevertForRefNameGet /{project}/_apis/git/repositories/{repositoryId}/reverts
StatsApiListGet /{project}/_apis/git/repositories/{repositoryId}/stats/branches
StatusesApiCreatePost /{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/statuses
StatusesApiListGet /{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/statuses
SuggestionsApiListGet /{project}/_apis/git/repositories/{repositoryId}/suggestions
TreesApiGetGet /{project}/_apis/git/repositories/{repositoryId}/trees/{sha1}

Documentation For Models

Documentation For Authorization

accessToken

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
	UserName: "username",
	Password: "password",
})
r, err := client.Service.Operation(auth, args)

oauth2

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
  • Scopes:
  • vso.code: Grants the ability to read source code and metadata about commits, changesets, branches, and other version control artifacts. Also grants the ability to search code and get notified about version control events via service hooks.
  • vso.code_manage: Grants the ability to read, update, and delete source code, access metadata about commits, changesets, branches, and other version control artifacts. Also grants the ability to create and manage code repositories, create and manage pull requests and code reviews, and to receive notifications about version control events via service hooks.
  • vso.code_write: Grants the ability to read, update, and delete source code, access metadata about commits, changesets, branches, and other version control artifacts. Also grants the ability to create and manage pull requests and code reviews and to receive notifications about version control events via service hooks.
  • vso.code_status: Grants the ability to read and write commit and pull request status.

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Author

[email protected]