Skip to content

Latest commit

 

History

History
126 lines (91 loc) · 3.42 KB

File metadata and controls

126 lines (91 loc) · 3.42 KB

FormatsApi

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

Method HTTP request Description
formatsList GET /formats/ Get a list of all supported package formats.
formatsRead GET /formats/{slug}/ Get a specific supported package format.

formatsList

List<Format> formatsList()

Get a list of all supported package formats.

Get a list of all supported package formats.

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

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

FormatsApi apiInstance = new FormatsApi();
try {
    List<Format> result = apiInstance.formatsList();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling FormatsApi#formatsList");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

List<Format>

Authorization

apikey, basic

HTTP request headers

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

formatsRead

Format formatsRead(slug)

Get a specific supported package format.

Get a specific supported package format.

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

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

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

Parameters

Name Type Description Notes
slug String

Return type

Format

Authorization

apikey, basic

HTTP request headers

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