bitbucket-api-client-lib

DownloadsApi

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

Method HTTP request Description
repositoriesWorkspaceRepoSlugDownloadsFilenameDelete DELETE /repositories/{workspace}/{repo_slug}/downloads/{filename}  
repositoriesWorkspaceRepoSlugDownloadsFilenameGet GET /repositories/{workspace}/{repo_slug}/downloads/{filename}  
repositoriesWorkspaceRepoSlugDownloadsGet GET /repositories/{workspace}/{repo_slug}/downloads  
repositoriesWorkspaceRepoSlugDownloadsPost POST /repositories/{workspace}/{repo_slug}/downloads  

repositoriesWorkspaceRepoSlugDownloadsFilenameDelete

Error repositoriesWorkspaceRepoSlugDownloadsFilenameDelete(filename, repoSlug, workspace)

Deletes the specified download artifact from the repository.

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.DownloadsApi;

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");

DownloadsApi apiInstance = new DownloadsApi();
String filename = "filename_example"; // String | 
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 {
    Error result = apiInstance.repositoriesWorkspaceRepoSlugDownloadsFilenameDelete(filename, repoSlug, workspace);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DownloadsApi#repositoriesWorkspaceRepoSlugDownloadsFilenameDelete");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
filename String    
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

Error

Authorization

api_keybasicoauth2

HTTP request headers

repositoriesWorkspaceRepoSlugDownloadsFilenameGet

Error repositoriesWorkspaceRepoSlugDownloadsFilenameGet(filename, repoSlug, workspace)

Return a redirect to the contents of a download artifact. This endpoint returns the actual file contents and not the artifact's metadata. $ curl -s -L https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads/hello.txt Hello World

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.DownloadsApi;

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");

DownloadsApi apiInstance = new DownloadsApi();
String filename = "filename_example"; // String | 
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 {
    Error result = apiInstance.repositoriesWorkspaceRepoSlugDownloadsFilenameGet(filename, repoSlug, workspace);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DownloadsApi#repositoriesWorkspaceRepoSlugDownloadsFilenameGet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
filename String    
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

Error

Authorization

api_keybasicoauth2

HTTP request headers

repositoriesWorkspaceRepoSlugDownloadsGet

Error repositoriesWorkspaceRepoSlugDownloadsGet(repoSlug, workspace)

Returns a list of download links associated with the repository.

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.DownloadsApi;

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");

DownloadsApi apiInstance = new DownloadsApi();
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 {
    Error result = apiInstance.repositoriesWorkspaceRepoSlugDownloadsGet(repoSlug, workspace);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DownloadsApi#repositoriesWorkspaceRepoSlugDownloadsGet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
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

Error

Authorization

api_keybasicoauth2

HTTP request headers

repositoriesWorkspaceRepoSlugDownloadsPost

Error repositoriesWorkspaceRepoSlugDownloadsPost(repoSlug, workspace)

Upload new download artifacts. To upload files, perform a `multipart/form-data` POST containing one or more `files` fields: $ echo Hello World > hello.txt $ curl -s -u evzijst -X POST https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads -F files=@hello.txt When a file is uploaded with the same name as an existing artifact, then the existing file will be replaced.

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.DownloadsApi;

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");

DownloadsApi apiInstance = new DownloadsApi();
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 {
    Error result = apiInstance.repositoriesWorkspaceRepoSlugDownloadsPost(repoSlug, workspace);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DownloadsApi#repositoriesWorkspaceRepoSlugDownloadsPost");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
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

Error

Authorization

api_keybasicoauth2

HTTP request headers