Inventory Service - Department - REST API

Department

createDepartment

Creates new Department


/departments

Usage and SDK Samples

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

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

public class DepartmentApiExample {

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

public class DepartmentApiExample {

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

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

// Creates new Department
[apiInstance createDepartmentWith:body
              completionHandler: ^(Department output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var InventoryServiceDepartmentRestApi = require('inventory_service___department___rest_api');

var api = new InventoryServiceDepartmentRestApi.DepartmentApi()

var body = ; // {Department} Department 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.createDepartment(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createDepartmentExample
    {
        public void main()
        {
            
            var apiInstance = new DepartmentApi();
            var body = new Department(); // Department | Department object that needs to be created

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

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

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

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

eval { 
    my $result = $api_instance->createDepartment(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DepartmentApi->createDepartment: $@\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.DepartmentApi()
body =  # Department | Department object that needs to be created

try: 
    # Creates new Department
    api_response = api_instance.create_department(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DepartmentApi->createDepartment: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 201 - Department created

Status: 405 - Invalid input


deleteDepartment

Deletes an Department


/departments/{departmentId}

Usage and SDK Samples

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

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

public class DepartmentApiExample {

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

public class DepartmentApiExample {

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

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

// Deletes an Department
[apiInstance deleteDepartmentWith:departmentId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var InventoryServiceDepartmentRestApi = require('inventory_service___department___rest_api');

var api = new InventoryServiceDepartmentRestApi.DepartmentApi()

var departmentId = 789; // {Long} Department's id


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

namespace Example
{
    public class deleteDepartmentExample
    {
        public void main()
        {
            
            var apiInstance = new DepartmentApi();
            var departmentId = 789;  // Long | Department's id

            try
            {
                // Deletes an Department
                apiInstance.deleteDepartment(departmentId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DepartmentApi.deleteDepartment: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\DepartmentApi();
$departmentId = 789; // Long | Department's id

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

my $api_instance = WWW::SwaggerClient::DepartmentApi->new();
my $departmentId = 789; # Long | Department's id

eval { 
    $api_instance->deleteDepartment(departmentId => $departmentId);
};
if ($@) {
    warn "Exception when calling DepartmentApi->deleteDepartment: $@\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.DepartmentApi()
departmentId = 789 # Long | Department's id

try: 
    # Deletes an Department
    api_instance.delete_department(departmentId)
except ApiException as e:
    print("Exception when calling DepartmentApi->deleteDepartment: %s\n" % e)

Parameters

Path parameters
Name Description
departmentId*
Long (int64)
Department's id
Required

Responses

Status: 200 - Department was deleted.

Status: 404 - Specified Department does not exist.


getDepartment

Gets Department based on departmentId


/departments/{departmentId}

Usage and SDK Samples

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

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

public class DepartmentApiExample {

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

public class DepartmentApiExample {

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

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

// Gets Department based on departmentId
[apiInstance getDepartmentWith:departmentId
              completionHandler: ^(Department output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var InventoryServiceDepartmentRestApi = require('inventory_service___department___rest_api');

var api = new InventoryServiceDepartmentRestApi.DepartmentApi()

var departmentId = 789; // {Long} Department's id


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

namespace Example
{
    public class getDepartmentExample
    {
        public void main()
        {
            
            var apiInstance = new DepartmentApi();
            var departmentId = 789;  // Long | Department's id

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

$api_instance = new Swagger\Client\Api\DepartmentApi();
$departmentId = 789; // Long | Department's id

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

my $api_instance = WWW::SwaggerClient::DepartmentApi->new();
my $departmentId = 789; # Long | Department's id

eval { 
    my $result = $api_instance->getDepartment(departmentId => $departmentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DepartmentApi->getDepartment: $@\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.DepartmentApi()
departmentId = 789 # Long | Department's id

try: 
    # Gets Department based on departmentId
    api_response = api_instance.get_department(departmentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DepartmentApi->getDepartment: %s\n" % e)

Parameters

Path parameters
Name Description
departmentId*
Long (int64)
Department's id
Required

Responses

Status: 200 - The Department

Status: 404 - Requested Department does not exist.


getDepartments

Gets all Departments


/departments

Usage and SDK Samples

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

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

public class DepartmentApiExample {

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

public class DepartmentApiExample {

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

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

// Gets all Departments
[apiInstance getDepartmentsWithCompletionHandler: 
              ^(array[Department] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var InventoryServiceDepartmentRestApi = require('inventory_service___department___rest_api');

var api = new InventoryServiceDepartmentRestApi.DepartmentApi()

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

namespace Example
{
    public class getDepartmentsExample
    {
        public void main()
        {
            
            var apiInstance = new DepartmentApi();

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

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

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

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

eval { 
    my $result = $api_instance->getDepartments();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DepartmentApi->getDepartments: $@\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.DepartmentApi()

try: 
    # Gets all Departments
    api_response = api_instance.get_departments()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DepartmentApi->getDepartments: %s\n" % e)

Parameters

Responses

Status: 200 - All Departments


updateDepartment

Updates Department based on departmentId


/departments/{departmentId}

Usage and SDK Samples

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

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

public class DepartmentApiExample {

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

public class DepartmentApiExample {

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

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

// Updates Department based on departmentId
[apiInstance updateDepartmentWith:departmentId
    body:body
              completionHandler: ^(Department output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var InventoryServiceDepartmentRestApi = require('inventory_service___department___rest_api');

var api = new InventoryServiceDepartmentRestApi.DepartmentApi()

var departmentId = 789; // {Long} Department's id

var body = ; // {Department} Department 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.updateDepartment(departmentId, body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateDepartmentExample
    {
        public void main()
        {
            
            var apiInstance = new DepartmentApi();
            var departmentId = 789;  // Long | Department's id
            var body = new Department(); // Department | Department object that needs to be updated

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

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

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

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

eval { 
    my $result = $api_instance->updateDepartment(departmentId => $departmentId, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DepartmentApi->updateDepartment: $@\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.DepartmentApi()
departmentId = 789 # Long | Department's id
body =  # Department | Department object that needs to be updated

try: 
    # Updates Department based on departmentId
    api_response = api_instance.update_department(departmentId, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DepartmentApi->updateDepartment: %s\n" % e)

Parameters

Path parameters
Name Description
departmentId*
Long (int64)
Department's id
Required
Body parameters
Name Description
body *

Responses

Status: 200 - The Department

Status: 404 - Requested Company Owner does not exist.


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