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 * |