# Inventory Service - Borrowing - REST API

## API and SDK Documentation

Version: 1.0.0

REST API for Inventory Service

# Borrow

# borrowReturnDevice

Handles borrowing or returning of a device

    /borrow

### Usage and SDK Samples

    curl -X POST "https://localhost/inventory-service/api/v1/borrow"

    import io.swagger.client.*;
    import io.swagger.client.auth.*;
    import io.swagger.client.model.*;
    import io.swagger.client.api.BorrowApi;

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

    public class BorrowApiExample {

        public static void main(String[] args) {

            BorrowApi apiInstance = new BorrowApi();
            BorrowReturn body = ; // BorrowReturn | Object that contains information about borrowing/returning of device
            try {
                apiInstance.borrowReturnDevice(body);
            } catch (ApiException e) {
                System.err.println("Exception when calling BorrowApi#borrowReturnDevice");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.BorrowApi;

    public class BorrowApiExample {

        public static void main(String[] args) {
            BorrowApi apiInstance = new BorrowApi();
            BorrowReturn body = ; // BorrowReturn | Object that contains information about borrowing/returning of device
            try {
                apiInstance.borrowReturnDevice(body);
            } catch (ApiException e) {
                System.err.println("Exception when calling BorrowApi#borrowReturnDevice");
                e.printStackTrace();
            }
        }
    }

    BorrowReturn *body = ; // Object that contains information about borrowing/returning of device

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

    // Handles borrowing or returning of a device
    [apiInstance borrowReturnDeviceWith:body
                  completionHandler: ^(NSError* error) {
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var InventoryServiceBorrowingRestApi = require('inventory_service___borrowing___rest_api');

    var api = new InventoryServiceBorrowingRestApi.BorrowApi()

    var body = ; // {BorrowReturn} Object that contains information about borrowing/returning of device

    var callback = function(error, data, response) {
      if (error) {
        console.error(error);
      } else {
        console.log('API called successfully.');
      }
    };
    api.borrowReturnDevice(body, callback);

    using System;
    using System.Diagnostics;
    using IO.Swagger.Api;
    using IO.Swagger.Client;
    using IO.Swagger.Model;

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

                var apiInstance = new BorrowApi();
                var body = new BorrowReturn(); // BorrowReturn | Object that contains information about borrowing/returning of device

                try
                {
                    // Handles borrowing or returning of a device
                    apiInstance.borrowReturnDevice(body);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling BorrowApi.borrowReturnDevice: " + e.Message );
                }
            }
        }
    }

    <?php
    require_once(__DIR__ . '/vendor/autoload.php');

    $api_instance = new Swagger\Client\Api\BorrowApi();
    $body = ; // BorrowReturn | Object that contains information about borrowing/returning of device

    try {
        $api_instance->borrowReturnDevice($body);
    } catch (Exception $e) {
        echo 'Exception when calling BorrowApi->borrowReturnDevice: ', $e->getMessage(), PHP_EOL;
    }
    ?>

    use Data::Dumper;
    use WWW::SwaggerClient::Configuration;
    use WWW::SwaggerClient::BorrowApi;

    my $api_instance = WWW::SwaggerClient::BorrowApi->new();
    my $body = WWW::SwaggerClient::Object::BorrowReturn->new(); # BorrowReturn | Object that contains information about borrowing/returning of device

    eval {
        $api_instance->borrowReturnDevice(body => $body);
    };
    if ($@) {
        warn "Exception when calling BorrowApi->borrowReturnDevice: $@\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.BorrowApi()
    body =  # BorrowReturn | Object that contains information about borrowing/returning of device

    try:
        # Handles borrowing or returning of a device
        api_instance.borrow_return_device(body)
    except ApiException as e:
        print("Exception when calling BorrowApi->borrowReturnDevice: %s\n" % e)

## Parameters

Body parameters

Name | Description
--- | ---
body * |

## Responses

### Status: 201 - Operation successful

Generated 2018-12-11T17:23:58.686+01:00