Skip to content

Latest commit

 

History

History
353 lines (253 loc) · 10.4 KB

BrandsApi.md

File metadata and controls

353 lines (253 loc) · 10.4 KB

BrandsApi

All URIs are relative to https://api.facestore.local/v1

Method HTTP request Description
addBrands POST /brands
deleteBrandById DELETE /brands/{id}/
getBrandById GET /brands/{id}/
getBrands GET /brands
updateCategoryById PUT /brands/{id}/
updateCategoryById_0 PATCH /brands/{id}/

addBrands

InlineResponse201 addBrands(brand)

Creates a new brand in the store.

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.BrandsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

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

BrandsApi apiInstance = new BrandsApi();
Brand brand = new Brand(); // Brand | Brand to add to the store
try {
    InlineResponse201 result = apiInstance.addBrands(brand);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling BrandsApi#addBrands");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
brand Brand Brand to add to the store

Return type

InlineResponse201

Authorization

APIKeyHeader

HTTP request headers

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

deleteBrandById

deleteBrandById(id)

Deletes a single brand based on the ID supplied

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.BrandsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

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

BrandsApi apiInstance = new BrandsApi();
Long id = 789L; // Long | ID of brand to delete
try {
    apiInstance.deleteBrandById(id);
} catch (ApiException e) {
    System.err.println("Exception when calling BrandsApi#deleteBrandById");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long ID of brand to delete

Return type

null (empty response body)

Authorization

APIKeyHeader

HTTP request headers

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

getBrandById

InlineResponse201 getBrandById(id, includes, limit)

Returns a brand based on a single ID ### Includes You can give the following values on includea parameter: `routes, products`

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.BrandsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

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

BrandsApi apiInstance = new BrandsApi();
Long id = 789L; // Long | ID of brand to fetch
List<String> includes = Arrays.asList("includes_example"); // List<String> | Include associated objects within response
Integer limit = 56; // Integer | max records to return
try {
    InlineResponse201 result = apiInstance.getBrandById(id, includes, limit);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling BrandsApi#getBrandById");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long ID of brand to fetch
includes List<String> Include associated objects within response [optional]
limit Integer max records to return [optional]

Return type

InlineResponse201

Authorization

APIKeyHeader

HTTP request headers

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

getBrands

InlineResponse200 getBrands(includes, limit, orderBy)

Returns all brands from the system that the user has access to ### Includes You can give the following values on includes parameter: `routes, products`

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.BrandsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

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

BrandsApi apiInstance = new BrandsApi();
List<String> includes = Arrays.asList("includes_example"); // List<String> | Include associated objects within response
Integer limit = 56; // Integer | max records to return
List<String> orderBy = Arrays.asList("orderBy_example"); // List<String> | Specify the field to be sorted, examples:  - `?order_by=id|desc` - `?order_by=updated_at|desc,position|asc` 
try {
    InlineResponse200 result = apiInstance.getBrands(includes, limit, orderBy);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling BrandsApi#getBrands");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
includes List<String> Include associated objects within response [optional]
limit Integer max records to return [optional]
orderBy List<String> Specify the field to be sorted, examples: - `?order_by=id desc` - `?order_by=updated_at

Return type

InlineResponse200

Authorization

APIKeyHeader

HTTP request headers

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

updateCategoryById

updateCategoryById(id, brand)

Update a single brand based on the ID supplied

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.BrandsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

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

BrandsApi apiInstance = new BrandsApi();
Long id = 789L; // Long | ID of brand to update
Object brand = null; // Object | Brand to update in store
try {
    apiInstance.updateCategoryById(id, brand);
} catch (ApiException e) {
    System.err.println("Exception when calling BrandsApi#updateCategoryById");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long ID of brand to update
brand Object Brand to update in store

Return type

null (empty response body)

Authorization

APIKeyHeader

HTTP request headers

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

updateCategoryById_0

updateCategoryById_0(id, brand)

Update a single brand based on the ID supplied

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.BrandsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

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

BrandsApi apiInstance = new BrandsApi();
Long id = 789L; // Long | ID of brand to update
Object brand = null; // Object | Brand to update in store
try {
    apiInstance.updateCategoryById_0(id, brand);
} catch (ApiException e) {
    System.err.println("Exception when calling BrandsApi#updateCategoryById_0");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long ID of brand to update
brand Object Brand to update in store

Return type

null (empty response body)

Authorization

APIKeyHeader

HTTP request headers

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