addInventory
adds an inventory item
Adds an item to the system
/inventory
Usage and SDK Samples
curl -X POST\
-H "Content-Type: application/json"\
"https://virtserver.swaggerhub.com/Ghepes/mockapiwromo/1.0.0/inventory"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdminsApi;
import java.io.File;
import java.util.*;
public class AdminsApiExample {
public static void main(String[] args) {
AdminsApi apiInstance = new AdminsApi();
InventoryItem body = ; // InventoryItem | Inventory item to add
try {
apiInstance.addInventory(body);
} catch (ApiException e) {
System.err.println("Exception when calling AdminsApi#addInventory");
e.printStackTrace();
}
}
}
import io.swagger.client.api.AdminsApi;
public class AdminsApiExample {
public static void main(String[] args) {
AdminsApi apiInstance = new AdminsApi();
InventoryItem body = ; // InventoryItem | Inventory item to add
try {
apiInstance.addInventory(body);
} catch (ApiException e) {
System.err.println("Exception when calling AdminsApi#addInventory");
e.printStackTrace();
}
}
}
InventoryItem *body = ; // Inventory item to add (optional)
AdminsApi *apiInstance = [[AdminsApi alloc] init];
// adds an inventory item
[apiInstance addInventoryWith:body
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var InventoryApi = require('inventory_api');
var api = new InventoryApi.AdminsApi()
var opts = {
'body': // {{InventoryItem}} Inventory item to add
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.addInventory(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class addInventoryExample
{
public void main()
{
var apiInstance = new AdminsApi();
var body = new InventoryItem(); // InventoryItem | Inventory item to add (optional)
try
{
// adds an inventory item
apiInstance.addInventory(body);
}
catch (Exception e)
{
Debug.Print("Exception when calling AdminsApi.addInventory: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiAdminsApi();
$body = ; // InventoryItem | Inventory item to add
try {
$api_instance->addInventory($body);
} catch (Exception $e) {
echo 'Exception when calling AdminsApi->addInventory: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdminsApi;
my $api_instance = WWW::SwaggerClient::AdminsApi->new();
my $body = WWW::SwaggerClient::Object::InventoryItem->new(); # InventoryItem | Inventory item to add
eval {
$api_instance->addInventory(body => $body);
};
if ($@) {
warn "Exception when calling AdminsApi->addInventory: $@\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.AdminsApi()
body = # InventoryItem | Inventory item to add (optional)
try:
# adds an inventory item
api_instance.add_inventory(body=body)
except ApiException as e:
print("Exception when calling AdminsApi->addInventory: %s\n" % e)
Parameters
Body parameters
Name | Description |
---|---|
body |