# Inventory Service - Calibration - REST API

## API and SDK Documentation

Version: 1.0.0

REST API for Inventory Service

# Calibration

# createCalibration

Creates new Calibration

    /calibrations

### Usage and SDK Samples

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

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

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

    public class CalibrationApiExample {

        public static void main(String[] args) {

            CalibrationApi apiInstance = new CalibrationApi();
            DeviceCalibration body = ; // DeviceCalibration | Calibration object that needs to be created
            try {
                DeviceCalibration result = apiInstance.createCalibration(body);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling CalibrationApi#createCalibration");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.CalibrationApi;

    public class CalibrationApiExample {

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

    DeviceCalibration *body = ; // Calibration object that needs to be created

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

    // Creates new Calibration
    [apiInstance createCalibrationWith:body
                  completionHandler: ^(DeviceCalibration output, NSError* error) {
                                if (output) {
                                    NSLog(@"%@", output);
                                }
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var InventoryServiceCalibrationRestApi = require('inventory_service___calibration___rest_api');

    var api = new InventoryServiceCalibrationRestApi.CalibrationApi()

    var body = ; // {DeviceCalibration} Calibration 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.createCalibration(body, callback);

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

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

                var apiInstance = new CalibrationApi();
                var body = new DeviceCalibration(); // DeviceCalibration | Calibration object that needs to be created

                try
                {
                    // Creates new Calibration
                    DeviceCalibration result = apiInstance.createCalibration(body);
                    Debug.WriteLine(result);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling CalibrationApi.createCalibration: " + e.Message );
                }
            }
        }
    }

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

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

    try {
        $result = $api_instance->createCalibration($body);
        print_r($result);
    } catch (Exception $e) {
        echo 'Exception when calling CalibrationApi->createCalibration: ', $e->getMessage(), PHP_EOL;
    }
    ?>

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

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

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

    try:
        # Creates new Calibration
        api_response = api_instance.create_calibration(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CalibrationApi->createCalibration: %s\n" % e)

## Parameters

Body parameters

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

## Responses

### Status: 201 - Calibration created

### Status: 405 - Invalid input

# getCalibration

Gets Calibration based on calibrationId

    /calibrations/{calibrationId}

### Usage and SDK Samples

    curl -X GET "https://localhost/inventory-service/api/v1/calibrations/{calibrationId}"

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

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

    public class CalibrationApiExample {

        public static void main(String[] args) {

            CalibrationApi apiInstance = new CalibrationApi();
            Long calibrationId = 789; // Long | Calibration's id
            try {
                DeviceCalibration result = apiInstance.getCalibration(calibrationId);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling CalibrationApi#getCalibration");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.CalibrationApi;

    public class CalibrationApiExample {

        public static void main(String[] args) {
            CalibrationApi apiInstance = new CalibrationApi();
            Long calibrationId = 789; // Long | Calibration's id
            try {
                DeviceCalibration result = apiInstance.getCalibration(calibrationId);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling CalibrationApi#getCalibration");
                e.printStackTrace();
            }
        }
    }

    Long *calibrationId = 789; // Calibration's id

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

    // Gets Calibration based on calibrationId
    [apiInstance getCalibrationWith:calibrationId
                  completionHandler: ^(DeviceCalibration output, NSError* error) {
                                if (output) {
                                    NSLog(@"%@", output);
                                }
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var InventoryServiceCalibrationRestApi = require('inventory_service___calibration___rest_api');

    var api = new InventoryServiceCalibrationRestApi.CalibrationApi()

    var calibrationId = 789; // {Long} Calibration's id

    var callback = function(error, data, response) {
      if (error) {
        console.error(error);
      } else {
        console.log('API called successfully. Returned data: ' + data);
      }
    };
    api.getCalibration(calibrationId, callback);

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

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

                var apiInstance = new CalibrationApi();
                var calibrationId = 789;  // Long | Calibration's id

                try
                {
                    // Gets Calibration based on calibrationId
                    DeviceCalibration result = apiInstance.getCalibration(calibrationId);
                    Debug.WriteLine(result);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling CalibrationApi.getCalibration: " + e.Message );
                }
            }
        }
    }

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

    $api_instance = new Swagger\Client\Api\CalibrationApi();
    $calibrationId = 789; // Long | Calibration's id

    try {
        $result = $api_instance->getCalibration($calibrationId);
        print_r($result);
    } catch (Exception $e) {
        echo 'Exception when calling CalibrationApi->getCalibration: ', $e->getMessage(), PHP_EOL;
    }
    ?>

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

    my $api_instance = WWW::SwaggerClient::CalibrationApi->new();
    my $calibrationId = 789; # Long | Calibration's id

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

    try:
        # Gets Calibration based on calibrationId
        api_response = api_instance.get_calibration(calibrationId)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CalibrationApi->getCalibration: %s\n" % e)

## Parameters

Path parameters

Name | Description
--- | ---
calibrationId* | Long (int64) Calibration's id Required

## Responses

### Status: 200 - The Calibration

### Status: 404 - Requested Calibration does not exist.

# updateCalibration

Updates an Calibration based on revisionId

    /calibrations/{calibrationId}

### Usage and SDK Samples

    curl -X PUT "https://localhost/inventory-service/api/v1/calibrations/{calibrationId}"

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

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

    public class CalibrationApiExample {

        public static void main(String[] args) {

            CalibrationApi apiInstance = new CalibrationApi();
            Long calibrationId = 789; // Long | Calibration id to update
            DeviceCalibration body = ; // DeviceCalibration | Calibration object that needs to be updated
            try {
                DeviceCalibration result = apiInstance.updateCalibration(calibrationId, body);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling CalibrationApi#updateCalibration");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.CalibrationApi;

    public class CalibrationApiExample {

        public static void main(String[] args) {
            CalibrationApi apiInstance = new CalibrationApi();
            Long calibrationId = 789; // Long | Calibration id to update
            DeviceCalibration body = ; // DeviceCalibration | Calibration object that needs to be updated
            try {
                DeviceCalibration result = apiInstance.updateCalibration(calibrationId, body);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling CalibrationApi#updateCalibration");
                e.printStackTrace();
            }
        }
    }

    Long *calibrationId = 789; // Calibration id to update
    DeviceCalibration *body = ; // Calibration object that needs to be updated

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

    // Updates an Calibration based on revisionId
    [apiInstance updateCalibrationWith:calibrationId
        body:body
                  completionHandler: ^(DeviceCalibration output, NSError* error) {
                                if (output) {
                                    NSLog(@"%@", output);
                                }
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var InventoryServiceCalibrationRestApi = require('inventory_service___calibration___rest_api');

    var api = new InventoryServiceCalibrationRestApi.CalibrationApi()

    var calibrationId = 789; // {Long} Calibration id to update

    var body = ; // {DeviceCalibration} Calibration 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.updateCalibration(calibrationId, body, callback);

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

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

                var apiInstance = new CalibrationApi();
                var calibrationId = 789;  // Long | Calibration id to update
                var body = new DeviceCalibration(); // DeviceCalibration | Calibration object that needs to be updated

                try
                {
                    // Updates an Calibration based on revisionId
                    DeviceCalibration result = apiInstance.updateCalibration(calibrationId, body);
                    Debug.WriteLine(result);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling CalibrationApi.updateCalibration: " + e.Message );
                }
            }
        }
    }

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

    $api_instance = new Swagger\Client\Api\CalibrationApi();
    $calibrationId = 789; // Long | Calibration id to update
    $body = ; // DeviceCalibration | Calibration object that needs to be updated

    try {
        $result = $api_instance->updateCalibration($calibrationId, $body);
        print_r($result);
    } catch (Exception $e) {
        echo 'Exception when calling CalibrationApi->updateCalibration: ', $e->getMessage(), PHP_EOL;
    }
    ?>

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

    my $api_instance = WWW::SwaggerClient::CalibrationApi->new();
    my $calibrationId = 789; # Long | Calibration id to update
    my $body = WWW::SwaggerClient::Object::DeviceCalibration->new(); # DeviceCalibration | Calibration object that needs to be updated

    eval {
        my $result = $api_instance->updateCalibration(calibrationId => $calibrationId, body => $body);
        print Dumper($result);
    };
    if ($@) {
        warn "Exception when calling CalibrationApi->updateCalibration: $@\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.CalibrationApi()
    calibrationId = 789 # Long | Calibration id to update
    body =  # DeviceCalibration | Calibration object that needs to be updated

    try:
        # Updates an Calibration based on revisionId
        api_response = api_instance.update_calibration(calibrationId, body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CalibrationApi->updateCalibration: %s\n" % e)

## Parameters

Path parameters

Name | Description
--- | ---
calibrationId* | Long (int64) Calibration id to update Required

Body parameters

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

## Responses

### Status: 200 - Updated Calibration

### Status: 404 - Specified Calibration does not exist.

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