Inventory Service - Supplier - REST API

Supplier

createSupplier

Creates new Supplier


/suppliers

Usage and SDK Samples

curl -X POST "https://localhost/inventory-service/api/v1/suppliers"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SupplierApi;

import java.io.File;
import java.util.*;

public class SupplierApiExample {

    public static void main(String[] args) {
        
        SupplierApi apiInstance = new SupplierApi();
        Supplier body = ; // Supplier | Supplier object that needs to be created
        try {
            Supplier result = apiInstance.createSupplier(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SupplierApi#createSupplier");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SupplierApi;

public class SupplierApiExample {

    public static void main(String[] args) {
        SupplierApi apiInstance = new SupplierApi();
        Supplier body = ; // Supplier | Supplier object that needs to be created
        try {
            Supplier result = apiInstance.createSupplier(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SupplierApi#createSupplier");
            e.printStackTrace();
        }
    }
}
Supplier *body = ; // Supplier object that needs to be created

SupplierApi *apiInstance = [[SupplierApi alloc] init];

// Creates new Supplier
[apiInstance createSupplierWith:body
              completionHandler: ^(Supplier output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var InventoryServiceSupplierRestApi = require('inventory_service___supplier___rest_api');

var api = new InventoryServiceSupplierRestApi.SupplierApi()

var body = ; // {Supplier} Supplier object that needs to be created


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createSupplier(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createSupplierExample
    {
        public void main()
        {
            
            var apiInstance = new SupplierApi();
            var body = new Supplier(); // Supplier | Supplier object that needs to be created

            try
            {
                // Creates new Supplier
                Supplier result = apiInstance.createSupplier(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SupplierApi.createSupplier: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SupplierApi();
$body = ; // Supplier | Supplier object that needs to be created

try {
    $result = $api_instance->createSupplier($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SupplierApi->createSupplier: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SupplierApi;

my $api_instance = WWW::SwaggerClient::SupplierApi->new();
my $body = WWW::SwaggerClient::Object::Supplier->new(); # Supplier | Supplier object that needs to be created

eval { 
    my $result = $api_instance->createSupplier(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SupplierApi->createSupplier: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.SupplierApi()
body =  # Supplier | Supplier object that needs to be created

try: 
    # Creates new Supplier
    api_response = api_instance.create_supplier(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SupplierApi->createSupplier: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 201 - Supplier created

Status: 405 - Invalid input


deleteSupplier

Deletes an Supplier


/suppliers/{supplierId}

Usage and SDK Samples

curl -X DELETE "https://localhost/inventory-service/api/v1/suppliers/{supplierId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SupplierApi;

import java.io.File;
import java.util.*;

public class SupplierApiExample {

    public static void main(String[] args) {
        
        SupplierApi apiInstance = new SupplierApi();
        Long supplierId = 789; // Long | Supplier's id
        try {
            apiInstance.deleteSupplier(supplierId);
        } catch (ApiException e) {
            System.err.println("Exception when calling SupplierApi#deleteSupplier");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SupplierApi;

public class SupplierApiExample {

    public static void main(String[] args) {
        SupplierApi apiInstance = new SupplierApi();
        Long supplierId = 789; // Long | Supplier's id
        try {
            apiInstance.deleteSupplier(supplierId);
        } catch (ApiException e) {
            System.err.println("Exception when calling SupplierApi#deleteSupplier");
            e.printStackTrace();
        }
    }
}
Long *supplierId = 789; // Supplier's id

SupplierApi *apiInstance = [[SupplierApi alloc] init];

// Deletes an Supplier
[apiInstance deleteSupplierWith:supplierId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var InventoryServiceSupplierRestApi = require('inventory_service___supplier___rest_api');

var api = new InventoryServiceSupplierRestApi.SupplierApi()

var supplierId = 789; // {Long} Supplier's id


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteSupplier(supplierId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteSupplierExample
    {
        public void main()
        {
            
            var apiInstance = new SupplierApi();
            var supplierId = 789;  // Long | Supplier's id

            try
            {
                // Deletes an Supplier
                apiInstance.deleteSupplier(supplierId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SupplierApi.deleteSupplier: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SupplierApi();
$supplierId = 789; // Long | Supplier's id

try {
    $api_instance->deleteSupplier($supplierId);
} catch (Exception $e) {
    echo 'Exception when calling SupplierApi->deleteSupplier: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SupplierApi;

my $api_instance = WWW::SwaggerClient::SupplierApi->new();
my $supplierId = 789; # Long | Supplier's id

eval { 
    $api_instance->deleteSupplier(supplierId => $supplierId);
};
if ($@) {
    warn "Exception when calling SupplierApi->deleteSupplier: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.SupplierApi()
supplierId = 789 # Long | Supplier's id

try: 
    # Deletes an Supplier
    api_instance.delete_supplier(supplierId)
except ApiException as e:
    print("Exception when calling SupplierApi->deleteSupplier: %s\n" % e)

Parameters

Path parameters
Name Description
supplierId*
Long (int64)
Supplier's id
Required

Responses

Status: 200 - Supplier was deleted.

Status: 404 - Specified Supplier does not exist.


getSupplier

Gets Supplier based on supplierId


/suppliers/{supplierId}

Usage and SDK Samples

curl -X GET "https://localhost/inventory-service/api/v1/suppliers/{supplierId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SupplierApi;

import java.io.File;
import java.util.*;

public class SupplierApiExample {

    public static void main(String[] args) {
        
        SupplierApi apiInstance = new SupplierApi();
        Long supplierId = 789; // Long | Supplier's id
        try {
            Supplier result = apiInstance.getSupplier(supplierId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SupplierApi#getSupplier");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SupplierApi;

public class SupplierApiExample {

    public static void main(String[] args) {
        SupplierApi apiInstance = new SupplierApi();
        Long supplierId = 789; // Long | Supplier's id
        try {
            Supplier result = apiInstance.getSupplier(supplierId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SupplierApi#getSupplier");
            e.printStackTrace();
        }
    }
}
Long *supplierId = 789; // Supplier's id

SupplierApi *apiInstance = [[SupplierApi alloc] init];

// Gets Supplier based on supplierId
[apiInstance getSupplierWith:supplierId
              completionHandler: ^(Supplier output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var InventoryServiceSupplierRestApi = require('inventory_service___supplier___rest_api');

var api = new InventoryServiceSupplierRestApi.SupplierApi()

var supplierId = 789; // {Long} Supplier's id


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getSupplier(supplierId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getSupplierExample
    {
        public void main()
        {
            
            var apiInstance = new SupplierApi();
            var supplierId = 789;  // Long | Supplier's id

            try
            {
                // Gets Supplier based on supplierId
                Supplier result = apiInstance.getSupplier(supplierId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SupplierApi.getSupplier: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SupplierApi();
$supplierId = 789; // Long | Supplier's id

try {
    $result = $api_instance->getSupplier($supplierId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SupplierApi->getSupplier: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SupplierApi;

my $api_instance = WWW::SwaggerClient::SupplierApi->new();
my $supplierId = 789; # Long | Supplier's id

eval { 
    my $result = $api_instance->getSupplier(supplierId => $supplierId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SupplierApi->getSupplier: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.SupplierApi()
supplierId = 789 # Long | Supplier's id

try: 
    # Gets Supplier based on supplierId
    api_response = api_instance.get_supplier(supplierId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SupplierApi->getSupplier: %s\n" % e)

Parameters

Path parameters
Name Description
supplierId*
Long (int64)
Supplier's id
Required

Responses

Status: 200 - The Supplier

Status: 404 - Requested Supplier does not exist.


getSuppliers

Gets all Suppliers


/suppliers

Usage and SDK Samples

curl -X GET "https://localhost/inventory-service/api/v1/suppliers"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SupplierApi;

import java.io.File;
import java.util.*;

public class SupplierApiExample {

    public static void main(String[] args) {
        
        SupplierApi apiInstance = new SupplierApi();
        try {
            array[Supplier] result = apiInstance.getSuppliers();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SupplierApi#getSuppliers");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SupplierApi;

public class SupplierApiExample {

    public static void main(String[] args) {
        SupplierApi apiInstance = new SupplierApi();
        try {
            array[Supplier] result = apiInstance.getSuppliers();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SupplierApi#getSuppliers");
            e.printStackTrace();
        }
    }
}

SupplierApi *apiInstance = [[SupplierApi alloc] init];

// Gets all Suppliers
[apiInstance getSuppliersWithCompletionHandler: 
              ^(array[Supplier] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var InventoryServiceSupplierRestApi = require('inventory_service___supplier___rest_api');

var api = new InventoryServiceSupplierRestApi.SupplierApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getSuppliers(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getSuppliersExample
    {
        public void main()
        {
            
            var apiInstance = new SupplierApi();

            try
            {
                // Gets all Suppliers
                array[Supplier] result = apiInstance.getSuppliers();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SupplierApi.getSuppliers: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SupplierApi();

try {
    $result = $api_instance->getSuppliers();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SupplierApi->getSuppliers: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SupplierApi;

my $api_instance = WWW::SwaggerClient::SupplierApi->new();

eval { 
    my $result = $api_instance->getSuppliers();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SupplierApi->getSuppliers: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.SupplierApi()

try: 
    # Gets all Suppliers
    api_response = api_instance.get_suppliers()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SupplierApi->getSuppliers: %s\n" % e)

Parameters

Responses

Status: 200 - All Suppliers


updateSupplier

Updates Supplier based on supplierId


/suppliers/{supplierId}

Usage and SDK Samples

curl -X PUT "https://localhost/inventory-service/api/v1/suppliers/{supplierId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SupplierApi;

import java.io.File;
import java.util.*;

public class SupplierApiExample {

    public static void main(String[] args) {
        
        SupplierApi apiInstance = new SupplierApi();
        Long supplierId = 789; // Long | Supplier's id
        Supplier body = ; // Supplier | Supplier object that needs to be updated
        try {
            Supplier result = apiInstance.updateSupplier(supplierId, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SupplierApi#updateSupplier");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SupplierApi;

public class SupplierApiExample {

    public static void main(String[] args) {
        SupplierApi apiInstance = new SupplierApi();
        Long supplierId = 789; // Long | Supplier's id
        Supplier body = ; // Supplier | Supplier object that needs to be updated
        try {
            Supplier result = apiInstance.updateSupplier(supplierId, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SupplierApi#updateSupplier");
            e.printStackTrace();
        }
    }
}
Long *supplierId = 789; // Supplier's id
Supplier *body = ; // Supplier object that needs to be updated

SupplierApi *apiInstance = [[SupplierApi alloc] init];

// Updates Supplier based on supplierId
[apiInstance updateSupplierWith:supplierId
    body:body
              completionHandler: ^(Supplier output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var InventoryServiceSupplierRestApi = require('inventory_service___supplier___rest_api');

var api = new InventoryServiceSupplierRestApi.SupplierApi()

var supplierId = 789; // {Long} Supplier's id

var body = ; // {Supplier} Supplier object that needs to be updated


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateSupplier(supplierId, body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateSupplierExample
    {
        public void main()
        {
            
            var apiInstance = new SupplierApi();
            var supplierId = 789;  // Long | Supplier's id
            var body = new Supplier(); // Supplier | Supplier object that needs to be updated

            try
            {
                // Updates Supplier based on supplierId
                Supplier result = apiInstance.updateSupplier(supplierId, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SupplierApi.updateSupplier: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SupplierApi();
$supplierId = 789; // Long | Supplier's id
$body = ; // Supplier | Supplier object that needs to be updated

try {
    $result = $api_instance->updateSupplier($supplierId, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SupplierApi->updateSupplier: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SupplierApi;

my $api_instance = WWW::SwaggerClient::SupplierApi->new();
my $supplierId = 789; # Long | Supplier's id
my $body = WWW::SwaggerClient::Object::Supplier->new(); # Supplier | Supplier object that needs to be updated

eval { 
    my $result = $api_instance->updateSupplier(supplierId => $supplierId, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SupplierApi->updateSupplier: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.SupplierApi()
supplierId = 789 # Long | Supplier's id
body =  # Supplier | Supplier object that needs to be updated

try: 
    # Updates Supplier based on supplierId
    api_response = api_instance.update_supplier(supplierId, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SupplierApi->updateSupplier: %s\n" % e)

Parameters

Path parameters
Name Description
supplierId*
Long (int64)
Supplier's id
Required
Body parameters
Name Description
body *

Responses

Status: 200 - The Supplier

Status: 404 - Requested Company Owner does not exist.


Generated 2018-12-11T17:24:07.670+01:00