bitbucket-api-client-lib

CommitstatusesApi

All URIs are relative to https://api.bitbucket.org/2.0

Method HTTP request Description
repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyGet GET /repositories/{workspace}/{repo_slug}/commit/{node}/statuses/build/{key}  
repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyPut PUT /repositories/{workspace}/{repo_slug}/commit/{node}/statuses/build/{key}  
repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildPost POST /repositories/{workspace}/{repo_slug}/commit/{node}/statuses/build  
repositoriesWorkspaceRepoSlugCommitNodeStatusesGet GET /repositories/{workspace}/{repo_slug}/commit/{node}/statuses  
repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statuses  

repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyGet

Commitstatus repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyGet(key, node, repoSlug, workspace)

Returns the specified build status for a commit.

Example

// Import classes:
//import com.rappi.bitbucket.client.invoker.ApiClient;
//import com.rappi.bitbucket.client.invoker.ApiException;
//import com.rappi.bitbucket.client.invoker.Configuration;
//import com.rappi.bitbucket.client.invoker.auth.*;
//import com.rappi.bitbucket.client.api.CommitstatusesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");

CommitstatusesApi apiInstance = new CommitstatusesApi();
String key = "key_example"; // String | The build status' unique key
String node = "node_example"; // String | The commit's SHA1.
String repoSlug = "repoSlug_example"; // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
String workspace = "workspace_example"; // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. 
try {
    Commitstatus result = apiInstance.repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyGet(key, node, repoSlug, workspace);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommitstatusesApi#repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyGet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
key String The build status' unique key  
node String The commit's SHA1.  
repoSlug String This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.  
workspace String This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.  

Return type

Commitstatus

Authorization

api_keybasicoauth2

HTTP request headers

repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyPut

Commitstatus repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyPut(key, node, repoSlug, workspace, body)

Used to update the current status of a build status object on the specific commit. This operation can also be used to change other properties of the build status: * `state` * `name` * `description` * `url` * `refname` The `key` cannot be changed.

Example

// Import classes:
//import com.rappi.bitbucket.client.invoker.ApiClient;
//import com.rappi.bitbucket.client.invoker.ApiException;
//import com.rappi.bitbucket.client.invoker.Configuration;
//import com.rappi.bitbucket.client.invoker.auth.*;
//import com.rappi.bitbucket.client.api.CommitstatusesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");

CommitstatusesApi apiInstance = new CommitstatusesApi();
String key = "key_example"; // String | The build status' unique key
String node = "node_example"; // String | The commit's SHA1.
String repoSlug = "repoSlug_example"; // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
String workspace = "workspace_example"; // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. 
Commitstatus body = new Commitstatus(); // Commitstatus | The updated build status object
try {
    Commitstatus result = apiInstance.repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyPut(key, node, repoSlug, workspace, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommitstatusesApi#repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyPut");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
key String The build status' unique key  
node String The commit's SHA1.  
repoSlug String This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.  
workspace String This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.  
body Commitstatus The updated build status object [optional]

Return type

Commitstatus

Authorization

api_keybasicoauth2

HTTP request headers

repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildPost

Commitstatus repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildPost(node, repoSlug, workspace, body)

Creates a new build status against the specified commit. If the specified key already exists, the existing status object will be overwritten. Example: ``` curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/ -X POST -u jdoe -H 'Content-Type: application/json' -d '{ \"key\": \"MY-BUILD\", \"state\": \"SUCCESSFUL\", \"description\": \"42 tests passed\", \"url\": \"https://www.example.org/my-build-result\" }' ``` When creating a new commit status, you can use a URI template for the URL. Templates are URLs that contain variable names that Bitbucket will evaluate at runtime whenever the URL is displayed anywhere similar to parameter substitution in Bitbucket Connect. For example, one could use `https://foo.com/builds/{repository.full_name}` which Bitbucket will turn into `https://foo.com/builds/foo/bar` at render time. The context variables available are `repository` and `commit`.

Example

// Import classes:
//import com.rappi.bitbucket.client.invoker.ApiClient;
//import com.rappi.bitbucket.client.invoker.ApiException;
//import com.rappi.bitbucket.client.invoker.Configuration;
//import com.rappi.bitbucket.client.invoker.auth.*;
//import com.rappi.bitbucket.client.api.CommitstatusesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");

CommitstatusesApi apiInstance = new CommitstatusesApi();
String node = "node_example"; // String | The commit's SHA1.
String repoSlug = "repoSlug_example"; // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
String workspace = "workspace_example"; // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. 
Commitstatus body = new Commitstatus(); // Commitstatus | The new commit status object.
try {
    Commitstatus result = apiInstance.repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildPost(node, repoSlug, workspace, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommitstatusesApi#repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildPost");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
node String The commit's SHA1.  
repoSlug String This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.  
workspace String This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.  
body Commitstatus The new commit status object. [optional]

Return type

Commitstatus

Authorization

api_keybasicoauth2

HTTP request headers

repositoriesWorkspaceRepoSlugCommitNodeStatusesGet

PaginatedCommitstatuses repositoriesWorkspaceRepoSlugCommitNodeStatusesGet(node, repoSlug, workspace, q, sort)

Returns all statuses (e.g. build results) for a specific commit.

Example

// Import classes:
//import com.rappi.bitbucket.client.invoker.ApiClient;
//import com.rappi.bitbucket.client.invoker.ApiException;
//import com.rappi.bitbucket.client.invoker.Configuration;
//import com.rappi.bitbucket.client.invoker.auth.*;
//import com.rappi.bitbucket.client.api.CommitstatusesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");

CommitstatusesApi apiInstance = new CommitstatusesApi();
String node = "node_example"; // String | The commit's SHA1.
String repoSlug = "repoSlug_example"; // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
String workspace = "workspace_example"; // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. 
String q = "q_example"; // String | Query string to narrow down the response as per [filtering and sorting](../../../../../../meta/filtering). 
String sort = "sort_example"; // String | Field by which the results should be sorted as per [filtering and sorting](../../../../../../meta/filtering). Defaults to `created_on`. 
try {
    PaginatedCommitstatuses result = apiInstance.repositoriesWorkspaceRepoSlugCommitNodeStatusesGet(node, repoSlug, workspace, q, sort);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommitstatusesApi#repositoriesWorkspaceRepoSlugCommitNodeStatusesGet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
node String The commit's SHA1.  
repoSlug String This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.  
workspace String This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.  
q String Query string to narrow down the response as per filtering and sorting. [optional]
sort String Field by which the results should be sorted as per filtering and sorting. Defaults to `created_on`. [optional]

Return type

PaginatedCommitstatuses

Authorization

api_keybasicoauth2

HTTP request headers

repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet

PaginatedCommitstatuses repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet(pullRequestId, repoSlug, workspace, q, sort)

Returns all statuses (e.g. build results) for the given pull request.

Example

// Import classes:
//import com.rappi.bitbucket.client.invoker.ApiClient;
//import com.rappi.bitbucket.client.invoker.ApiException;
//import com.rappi.bitbucket.client.invoker.Configuration;
//import com.rappi.bitbucket.client.invoker.auth.*;
//import com.rappi.bitbucket.client.api.CommitstatusesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");

CommitstatusesApi apiInstance = new CommitstatusesApi();
Integer pullRequestId = 56; // Integer | The id of the pull request.
String repoSlug = "repoSlug_example"; // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
String workspace = "workspace_example"; // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. 
String q = "q_example"; // String | Query string to narrow down the response as per [filtering and sorting](../../../../../../meta/filtering). 
String sort = "sort_example"; // String | Field by which the results should be sorted as per [filtering and sorting](../../../../../../meta/filtering). Defaults to `created_on`. 
try {
    PaginatedCommitstatuses result = apiInstance.repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet(pullRequestId, repoSlug, workspace, q, sort);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommitstatusesApi#repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
pullRequestId Integer The id of the pull request.  
repoSlug String This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.  
workspace String This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.  
q String Query string to narrow down the response as per filtering and sorting. [optional]
sort String Field by which the results should be sorted as per filtering and sorting. Defaults to `created_on`. [optional]

Return type

PaginatedCommitstatuses

Authorization

api_keybasicoauth2

HTTP request headers