Skip to content

Latest commit

 

History

History
351 lines (257 loc) · 10.3 KB

CategoriesApi.md

File metadata and controls

351 lines (257 loc) · 10.3 KB

IO.Swagger.Api.CategoriesApi

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

Method HTTP request Description
AddCategories POST /categories
DeleteCategoryById DELETE /categories/{id}/
GetCategories GET /categories
GetCategoryById GET /categories/{id}/
UpdateCategoryById PUT /categories/{id}/

AddCategories

InlineResponse2011 AddCategories (Category category)

Creates a new category in the store.

Example

using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class AddCategoriesExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("APIToken", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("APIToken", "Bearer");

            var apiInstance = new CategoriesApi();
            var category = new Category(); // Category | Category to add to the store

            try
            {
                InlineResponse2011 result = apiInstance.AddCategories(category);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CategoriesApi.AddCategories: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
category Category Category to add to the store

Return type

InlineResponse2011

Authorization

APIKeyHeader

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteCategoryById

void DeleteCategoryById (long? id)

deletes a single category based on the ID supplied

Example

using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class DeleteCategoryByIdExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("APIToken", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("APIToken", "Bearer");

            var apiInstance = new CategoriesApi();
            var id = 789;  // long? | ID of category to delete

            try
            {
                apiInstance.DeleteCategoryById(id);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CategoriesApi.DeleteCategoryById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id long? ID of category to delete

Return type

void (empty response body)

Authorization

APIKeyHeader

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetCategories

InlineResponse2001 GetCategories (List includes, int? limit, List orderBy)

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

Example

using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class GetCategoriesExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("APIToken", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("APIToken", "Bearer");

            var apiInstance = new CategoriesApi();
            var includes = new List<string>(); // List<string> | Include associated objects within response (optional) 
            var limit = 56;  // int? | max records to return (optional) 
            var orderBy = new List<string>(); // List<string> | Specify the field to be sorted, examples:  - `?order_by=id|desc` - `?order_by=updated_at|desc,position|asc`  (optional) 

            try
            {
                InlineResponse2001 result = apiInstance.GetCategories(includes, limit, orderBy);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CategoriesApi.GetCategories: " + e.Message );
            }
        }
    }
}

Parameters

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

Return type

InlineResponse2001

Authorization

APIKeyHeader

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetCategoryById

InlineResponse2011 GetCategoryById (long? id, List includes, int? limit)

Returns a category based on a single ID ### Includes You can give the following values on includes parameter: routes, products

Example

using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class GetCategoryByIdExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("APIToken", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("APIToken", "Bearer");

            var apiInstance = new CategoriesApi();
            var id = 789;  // long? | ID of category to fetch
            var includes = new List<string>(); // List<string> | Include associated objects within response (optional) 
            var limit = 56;  // int? | max records to return (optional) 

            try
            {
                InlineResponse2011 result = apiInstance.GetCategoryById(id, includes, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CategoriesApi.GetCategoryById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id long? ID of category to fetch
includes List Include associated objects within response [optional]
limit int? max records to return [optional]

Return type

InlineResponse2011

Authorization

APIKeyHeader

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateCategoryById

void UpdateCategoryById (long? id, Object category)

update a single category based on the ID supplied

Example

using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class UpdateCategoryByIdExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("APIToken", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("APIToken", "Bearer");

            var apiInstance = new CategoriesApi();
            var id = 789;  // long? | ID of category to update
            var category = ;  // Object | Category to update in store

            try
            {
                apiInstance.UpdateCategoryById(id, category);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CategoriesApi.UpdateCategoryById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id long? ID of category to update
category Object Category to update in store

Return type

void (empty response body)

Authorization

APIKeyHeader

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]