Skip to content

Latest commit

 

History

History
419 lines (307 loc) · 12.1 KB

ProductsApi.md

File metadata and controls

419 lines (307 loc) · 12.1 KB

IO.Swagger.Api.ProductsApi

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

Method HTTP request Description
AddProduct POST /products
DeleteProductById DELETE /products/{id}/
GetProductById GET /products/{id}/
GetProducts GET /products
UpdateProductById PUT /products/{id}/
UpdateProductById_0 PATCH /products/{id}/

AddProduct

InlineResponse2014 AddProduct (Product product)

Creates a new product 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 AddProductExample
    {
        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 ProductsApi();
            var product = new Product(); // Product | Product to add to the store

            try
            {
                InlineResponse2014 result = apiInstance.AddProduct(product);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProductsApi.AddProduct: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
product Product Product to add to the store

Return type

InlineResponse2014

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]

DeleteProductById

void DeleteProductById (long? id)

deletes a single product 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 DeleteProductByIdExample
    {
        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 ProductsApi();
            var id = 789;  // long? | ID of product to delete

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

Parameters

Name Type Description Notes
id long? ID of product 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]

GetProductById

InlineResponse2014 GetProductById (long? id, List includes, int? limit)

Returns a product based on a single ID ### Includes You can give the following values on includes parameter: brands, categories, routes, stocks

Example

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

namespace Example
{
    public class GetProductByIdExample
    {
        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 ProductsApi();
            var id = 789;  // long? | ID of product 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
            {
                InlineResponse2014 result = apiInstance.GetProductById(id, includes, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProductsApi.GetProductById: " + e.Message );
            }
        }
    }
}

Parameters

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

Return type

InlineResponse2014

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]

GetProducts

InlineResponse2006 GetProducts (List includes, int? limit, List orderBy)

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

Example

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

namespace Example
{
    public class GetProductsExample
    {
        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 ProductsApi();
            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
            {
                InlineResponse2006 result = apiInstance.GetProducts(includes, limit, orderBy);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProductsApi.GetProducts: " + 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

InlineResponse2006

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]

UpdateProductById

void UpdateProductById (long? id, Product tax)

update a single product 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 UpdateProductByIdExample
    {
        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 ProductsApi();
            var id = 789;  // long? | ID of product to update
            var tax = new Product(); // Product | Product to add to the store

            try
            {
                apiInstance.UpdateProductById(id, tax);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProductsApi.UpdateProductById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id long? ID of product to update
tax Product Product to add to the 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]

UpdateProductById_0

void UpdateProductById_0 (long? id, Product tax)

update a single product 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 UpdateProductById_0Example
    {
        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 ProductsApi();
            var id = 789;  // long? | ID of product to update
            var tax = new Product(); // Product | Product to add to the store

            try
            {
                apiInstance.UpdateProductById_0(id, tax);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProductsApi.UpdateProductById_0: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id long? ID of product to update
tax Product Product to add to the 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]