Inventory API

Admins

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

Responses

Status: 201 - item created

Status: 400 - invalid input, object invalid

Status: 409 - an existing item already exists


Developers

searchInventory

searches inventory

By passing in the appropriate options, you can search for available inventory in the system


/inventory

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"https://virtserver.swaggerhub.com/Ghepes/mockapiwromo/1.0.0/inventory?searchString=&skip=&limit="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DevelopersApi;

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

public class DevelopersApiExample {

    public static void main(String[] args) {
        
        DevelopersApi apiInstance = new DevelopersApi();
        String searchString = searchString_example; // String | pass an optional search string for looking up inventory
        Integer skip = 56; // Integer | number of records to skip for pagination
        Integer limit = 56; // Integer | maximum number of records to return
        try {
            array[InventoryItem] result = apiInstance.searchInventory(searchString, skip, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevelopersApi#searchInventory");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DevelopersApi;

public class DevelopersApiExample {

    public static void main(String[] args) {
        DevelopersApi apiInstance = new DevelopersApi();
        String searchString = searchString_example; // String | pass an optional search string for looking up inventory
        Integer skip = 56; // Integer | number of records to skip for pagination
        Integer limit = 56; // Integer | maximum number of records to return
        try {
            array[InventoryItem] result = apiInstance.searchInventory(searchString, skip, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevelopersApi#searchInventory");
            e.printStackTrace();
        }
    }
}
String *searchString = searchString_example; // pass an optional search string for looking up inventory (optional)
Integer *skip = 56; // number of records to skip for pagination (optional)
Integer *limit = 56; // maximum number of records to return (optional)

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

// searches inventory
[apiInstance searchInventoryWith:searchString
    skip:skip
    limit:limit
              completionHandler: ^(array[InventoryItem] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var InventoryApi = require('inventory_api');

var api = new InventoryApi.DevelopersApi()
var opts = { 
  'searchString': searchString_example, // {{String}} pass an optional search string for looking up inventory
  'skip': 56, // {{Integer}} number of records to skip for pagination
  'limit': 56 // {{Integer}} maximum number of records to return
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.searchInventory(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class searchInventoryExample
    {
        public void main()
        {

            var apiInstance = new DevelopersApi();
            var searchString = searchString_example;  // String | pass an optional search string for looking up inventory (optional) 
            var skip = 56;  // Integer | number of records to skip for pagination (optional) 
            var limit = 56;  // Integer | maximum number of records to return (optional) 

            try
            {
                // searches inventory
                array[InventoryItem] result = apiInstance.searchInventory(searchString, skip, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DevelopersApi.searchInventory: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiDevelopersApi();
$searchString = searchString_example; // String | pass an optional search string for looking up inventory
$skip = 56; // Integer | number of records to skip for pagination
$limit = 56; // Integer | maximum number of records to return

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

my $api_instance = WWW::SwaggerClient::DevelopersApi->new();
my $searchString = searchString_example; # String | pass an optional search string for looking up inventory
my $skip = 56; # Integer | number of records to skip for pagination
my $limit = 56; # Integer | maximum number of records to return

eval { 
    my $result = $api_instance->searchInventory(searchString => $searchString, skip => $skip, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DevelopersApi->searchInventory: $@\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.DevelopersApi()
searchString = searchString_example # String | pass an optional search string for looking up inventory (optional)
skip = 56 # Integer | number of records to skip for pagination (optional)
limit = 56 # Integer | maximum number of records to return (optional)

try: 
    # searches inventory
    api_response = api_instance.search_inventory(searchString=searchString, skip=skip, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DevelopersApi->searchInventory: %s\n" % e)

Parameters

Query parameters
Name Description
searchString
String
pass an optional search string for looking up inventory
skip
Integer (int32)
number of records to skip for pagination
limit
Integer (int32)
maximum number of records to return

Responses

Status: 200 - search results matching criteria

Status: 400 - bad input parameter