Skip to content

Latest commit

 

History

History
336 lines (252 loc) · 10.6 KB

File metadata and controls

336 lines (252 loc) · 10.6 KB

WebhooksApi

All URIs are relative to https://api.cloudsmith.io

Method HTTP request Description
webhooksCreate POST /webhooks/{owner}/{repo}/ Create a specific webhook in a repository.
webhooksDelete DELETE /webhooks/{owner}/{repo}/{identifier}/ Delete a specific webhook in a repository.
webhooksList GET /webhooks/{owner}/{repo}/ Get a list of all webhooks in a repository.
webhooksPartialUpdate PATCH /webhooks/{owner}/{repo}/{identifier}/ Update a specific webhook in a repository.
webhooksRead GET /webhooks/{owner}/{repo}/{identifier}/ Views for working with repository webhooks.

webhooksCreate

RepositoryWebhook webhooksCreate(owner, repo, data)

Create a specific webhook in a repository.

Create a specific webhook in a repository.

Example

// Import classes:
//import io.cloudsmith.api.ApiClient;
//import io.cloudsmith.api.ApiException;
//import io.cloudsmith.api.Configuration;
//import io.cloudsmith.api.auth.*;
//import io.cloudsmith.api.apis.WebhooksApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apikey
ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey");
apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

WebhooksApi apiInstance = new WebhooksApi();
String owner = "owner_example"; // String | 
String repo = "repo_example"; // String | 
RepositoryWebhookRequest data = new RepositoryWebhookRequest(); // RepositoryWebhookRequest | 
try {
    RepositoryWebhook result = apiInstance.webhooksCreate(owner, repo, data);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling WebhooksApi#webhooksCreate");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
owner String
repo String
data RepositoryWebhookRequest [optional]

Return type

RepositoryWebhook

Authorization

apikey, basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

webhooksDelete

webhooksDelete(owner, repo, identifier)

Delete a specific webhook in a repository.

Delete a specific webhook in a repository.

Example

// Import classes:
//import io.cloudsmith.api.ApiClient;
//import io.cloudsmith.api.ApiException;
//import io.cloudsmith.api.Configuration;
//import io.cloudsmith.api.auth.*;
//import io.cloudsmith.api.apis.WebhooksApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apikey
ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey");
apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

WebhooksApi apiInstance = new WebhooksApi();
String owner = "owner_example"; // String | 
String repo = "repo_example"; // String | 
String identifier = "identifier_example"; // String | 
try {
    apiInstance.webhooksDelete(owner, repo, identifier);
} catch (ApiException e) {
    System.err.println("Exception when calling WebhooksApi#webhooksDelete");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
owner String
repo String
identifier String

Return type

null (empty response body)

Authorization

apikey, basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

webhooksList

List<RepositoryWebhook> webhooksList(owner, repo, page, pageSize)

Get a list of all webhooks in a repository.

Get a list of all webhooks in a repository.

Example

// Import classes:
//import io.cloudsmith.api.ApiClient;
//import io.cloudsmith.api.ApiException;
//import io.cloudsmith.api.Configuration;
//import io.cloudsmith.api.auth.*;
//import io.cloudsmith.api.apis.WebhooksApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apikey
ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey");
apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

WebhooksApi apiInstance = new WebhooksApi();
String owner = "owner_example"; // String | 
String repo = "repo_example"; // String | 
java.math.BigInteger page = new java.math.BigInteger(); // java.math.BigInteger | A page number within the paginated result set.
java.math.BigInteger pageSize = new java.math.BigInteger(); // java.math.BigInteger | Number of results to return per page.
try {
    List<RepositoryWebhook> result = apiInstance.webhooksList(owner, repo, page, pageSize);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling WebhooksApi#webhooksList");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
owner String
repo String
page java.math.BigInteger A page number within the paginated result set. [optional]
pageSize java.math.BigInteger Number of results to return per page. [optional]

Return type

List<RepositoryWebhook>

Authorization

apikey, basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

webhooksPartialUpdate

RepositoryWebhook webhooksPartialUpdate(owner, repo, identifier, data)

Update a specific webhook in a repository.

Update a specific webhook in a repository.

Example

// Import classes:
//import io.cloudsmith.api.ApiClient;
//import io.cloudsmith.api.ApiException;
//import io.cloudsmith.api.Configuration;
//import io.cloudsmith.api.auth.*;
//import io.cloudsmith.api.apis.WebhooksApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apikey
ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey");
apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

WebhooksApi apiInstance = new WebhooksApi();
String owner = "owner_example"; // String | 
String repo = "repo_example"; // String | 
String identifier = "identifier_example"; // String | 
RepositoryWebhookRequestPatch data = new RepositoryWebhookRequestPatch(); // RepositoryWebhookRequestPatch | 
try {
    RepositoryWebhook result = apiInstance.webhooksPartialUpdate(owner, repo, identifier, data);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling WebhooksApi#webhooksPartialUpdate");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
owner String
repo String
identifier String
data RepositoryWebhookRequestPatch [optional]

Return type

RepositoryWebhook

Authorization

apikey, basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

webhooksRead

RepositoryWebhook webhooksRead(owner, repo, identifier)

Views for working with repository webhooks.

Views for working with repository webhooks.

Example

// Import classes:
//import io.cloudsmith.api.ApiClient;
//import io.cloudsmith.api.ApiException;
//import io.cloudsmith.api.Configuration;
//import io.cloudsmith.api.auth.*;
//import io.cloudsmith.api.apis.WebhooksApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apikey
ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey");
apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

WebhooksApi apiInstance = new WebhooksApi();
String owner = "owner_example"; // String | 
String repo = "repo_example"; // String | 
String identifier = "identifier_example"; // String | 
try {
    RepositoryWebhook result = apiInstance.webhooksRead(owner, repo, identifier);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling WebhooksApi#webhooksRead");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
owner String
repo String
identifier String

Return type

RepositoryWebhook

Authorization

apikey, basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json