addLabelToPullRequest
/label/project/{projKey}/repo/{repoSlug}/pullrequest/{pullRequestId}
Usage and SDK Samples
curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: */*"\
"http://localhost:7990/bitbucket/rest/organizr/latest/label/project/{projKey}/repo/{repoSlug}/pullrequest/{pullRequestId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String projKey = projKey_example; // String |
String repoSlug = repoSlug_example; // String |
Long pullRequestId = 789; // Long |
RestLabel body = ; // RestLabel |
try {
apiInstance.addLabelToPullRequest(projKey, repoSlug, pullRequestId, body);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#addLabelToPullRequest");
e.printStackTrace();
}
}
}
import io.swagger.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String projKey = projKey_example; // String |
String repoSlug = repoSlug_example; // String |
Long pullRequestId = 789; // Long |
RestLabel body = ; // RestLabel |
try {
apiInstance.addLabelToPullRequest(projKey, repoSlug, pullRequestId, body);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#addLabelToPullRequest");
e.printStackTrace();
}
}
}
String *projKey = projKey_example; //
String *repoSlug = repoSlug_example; //
Long *pullRequestId = 789; //
RestLabel *body = ; // (optional)
DefaultApi *apiInstance = [[DefaultApi alloc] init];
[apiInstance addLabelToPullRequestWith:projKey
repoSlug:repoSlug
pullRequestId:pullRequestId
body:body
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var OrganizrRestApi = require('organizr___rest_api');
var api = new OrganizrRestApi.DefaultApi()
var projKey = projKey_example; // {{String}}
var repoSlug = repoSlug_example; // {{String}}
var pullRequestId = 789; // {{Long}}
var opts = {
'body': // {{RestLabel}}
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.addLabelToPullRequest(projKeyrepoSlugpullRequestId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class addLabelToPullRequestExample
{
public void main()
{
var apiInstance = new DefaultApi();
var projKey = projKey_example; // String |
var repoSlug = repoSlug_example; // String |
var pullRequestId = 789; // Long |
var body = new RestLabel(); // RestLabel | (optional)
try
{
apiInstance.addLabelToPullRequest(projKey, repoSlug, pullRequestId, body);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.addLabelToPullRequest: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiDefaultApi();
$projKey = projKey_example; // String |
$repoSlug = repoSlug_example; // String |
$pullRequestId = 789; // Long |
$body = ; // RestLabel |
try {
$api_instance->addLabelToPullRequest($projKey, $repoSlug, $pullRequestId, $body);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->addLabelToPullRequest: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;
my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $projKey = projKey_example; # String |
my $repoSlug = repoSlug_example; # String |
my $pullRequestId = 789; # Long |
my $body = WWW::SwaggerClient::Object::RestLabel->new(); # RestLabel |
eval {
$api_instance->addLabelToPullRequest(projKey => $projKey, repoSlug => $repoSlug, pullRequestId => $pullRequestId, body => $body);
};
if ($@) {
warn "Exception when calling DefaultApi->addLabelToPullRequest: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.DefaultApi()
projKey = projKey_example # String |
repoSlug = repoSlug_example # String |
pullRequestId = 789 # Long |
body = # RestLabel | (optional)
try:
api_instance.add_label_to_pull_request(projKey, repoSlug, pullRequestId, body=body)
except ApiException as e:
print("Exception when calling DefaultApi->addLabelToPullRequest: %s\n" % e)
Parameters
Name | Description |
---|---|
projKey* |
String
Required
|
repoSlug* |
String
Required
|
pullRequestId* |
Long
(int64)
Required
|
Name | Description |
---|---|
body |