Skip to content

Latest commit

 

History

History
132 lines (96 loc) · 4.08 KB

File metadata and controls

132 lines (96 loc) · 4.08 KB

NamespacesApi

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

Method HTTP request Description
namespacesList GET /namespaces/ Get a list of all namespaces the user belongs to.
namespacesRead GET /namespaces/{slug}/ Get a specific namespace that the user belongs to.

namespacesList

List<Namespace> namespacesList(page, pageSize)

Get a list of all namespaces the user belongs to.

Get a list of all namespaces the user belongs to.

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

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

NamespacesApi apiInstance = new NamespacesApi();
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<Namespace> result = apiInstance.namespacesList(page, pageSize);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling NamespacesApi#namespacesList");
    e.printStackTrace();
}

Parameters

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

Authorization

apikey, basic

HTTP request headers

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

namespacesRead

Namespace namespacesRead(slug)

Get a specific namespace that the user belongs to.

Get a specific namespace that the user belongs to.

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

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

NamespacesApi apiInstance = new NamespacesApi();
String slug = "slug_example"; // String | 
try {
    Namespace result = apiInstance.namespacesRead(slug);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling NamespacesApi#namespacesRead");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
slug String

Return type

Namespace

Authorization

apikey, basic

HTTP request headers

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