-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from rhyskoedijk/feature/expand-api-version-com…
…patibility Lower minimum server API version to 5.0 for greater compatibility
- Loading branch information
Showing
5 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { IVssRestClientOptions } from 'azure-devops-extension-api/Common'; | ||
import { RestClientBase } from 'azure-devops-extension-api/Common/RestClientBase'; | ||
|
||
import * as Build from 'azure-devops-extension-api/Build'; | ||
|
||
export class BuildRestClient extends RestClientBase { | ||
constructor(options: IVssRestClientOptions) { | ||
super(options); | ||
} | ||
|
||
public static readonly API_VERSION = '5.0'; | ||
|
||
/** | ||
* Gets the list of attachments of a specific type that are associated with a build. | ||
* | ||
* @param project - Project ID or project name | ||
* @param buildId - The ID of the build. | ||
* @param type - The type of attachment. | ||
*/ | ||
public async getAttachments(project: string, buildId: number, type: string): Promise<Build.Attachment[]> { | ||
return this.beginRequest<Build.Attachment[]>({ | ||
apiVersion: BuildRestClient.API_VERSION, | ||
routeTemplate: '{project}/_apis/build/builds/{buildId}/attachments/{type}', | ||
routeValues: { | ||
project: project, | ||
buildId: buildId, | ||
type: type, | ||
}, | ||
}); | ||
} | ||
|
||
/** | ||
* Gets a specific attachment. | ||
* | ||
* @param project - Project ID or project name | ||
* @param buildId - The ID of the build. | ||
* @param timelineId - The ID of the timeline. | ||
* @param recordId - The ID of the timeline record. | ||
* @param type - The type of the attachment. | ||
* @param name - The name of the attachment. | ||
*/ | ||
public async getAttachment( | ||
project: string, | ||
buildId: number, | ||
timelineId: string, | ||
recordId: string, | ||
type: string, | ||
name: string, | ||
): Promise<ArrayBuffer> { | ||
return this.beginRequest<ArrayBuffer>({ | ||
apiVersion: BuildRestClient.API_VERSION, | ||
httpResponseType: 'application/octet-stream', | ||
routeTemplate: '{project}/_apis/build/builds/{buildId}/{timelineId}/{recordId}/attachments/{type}/{name}', | ||
routeValues: { | ||
project: project, | ||
buildId: buildId, | ||
timelineId: timelineId, | ||
recordId: recordId, | ||
type: type, | ||
name: name, | ||
}, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters