# Inventory Service - Device State - REST API

## API and SDK Documentation

Version: 1.0.0

REST API for Inventory Service

# DeviceState

# createDeviceState

Creates new Device State

    /device-states

### Usage and SDK Samples

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

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

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

    public class DeviceStateApiExample {

        public static void main(String[] args) {

            DeviceStateApi apiInstance = new DeviceStateApi();
            DeviceState body = ; // DeviceState | Device State object that needs to be created
            try {
                DeviceState result = apiInstance.createDeviceState(body);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling DeviceStateApi#createDeviceState");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.DeviceStateApi;

    public class DeviceStateApiExample {

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

    DeviceState *body = ; // Device State object that needs to be created

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

    // Creates new Device State
    [apiInstance createDeviceStateWith:body
                  completionHandler: ^(DeviceState output, NSError* error) {
                                if (output) {
                                    NSLog(@"%@", output);
                                }
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var InventoryServiceDeviceStateRestApi = require('inventory_service___device_state___rest_api');

    var api = new InventoryServiceDeviceStateRestApi.DeviceStateApi()

    var body = ; // {DeviceState} Device State 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.createDeviceState(body, callback);

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

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

                var apiInstance = new DeviceStateApi();
                var body = new DeviceState(); // DeviceState | Device State object that needs to be created

                try
                {
                    // Creates new Device State
                    DeviceState result = apiInstance.createDeviceState(body);
                    Debug.WriteLine(result);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling DeviceStateApi.createDeviceState: " + e.Message );
                }
            }
        }
    }

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

    $api_instance = new Swagger\Client\Api\DeviceStateApi();
    $body = ; // DeviceState | Device State object that needs to be created

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

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

    my $api_instance = WWW::SwaggerClient::DeviceStateApi->new();
    my $body = WWW::SwaggerClient::Object::DeviceState->new(); # DeviceState | Device State object that needs to be created

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

    try:
        # Creates new Device State
        api_response = api_instance.create_device_state(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DeviceStateApi->createDeviceState: %s\n" % e)

## Parameters

Body parameters

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

## Responses

### Status: 201 - Device State created

### Status: 405 - Invalid input

# deleteDeviceState

Deletes an Device State

    /device-states/{deviceStateId}

### Usage and SDK Samples

    curl -X DELETE "https://localhost/inventory-service/api/v1/device-states/{deviceStateId}"

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

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

    public class DeviceStateApiExample {

        public static void main(String[] args) {

            DeviceStateApi apiInstance = new DeviceStateApi();
            Long deviceStateId = 789; // Long | Device State's id
            try {
                apiInstance.deleteDeviceState(deviceStateId);
            } catch (ApiException e) {
                System.err.println("Exception when calling DeviceStateApi#deleteDeviceState");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.DeviceStateApi;

    public class DeviceStateApiExample {

        public static void main(String[] args) {
            DeviceStateApi apiInstance = new DeviceStateApi();
            Long deviceStateId = 789; // Long | Device State's id
            try {
                apiInstance.deleteDeviceState(deviceStateId);
            } catch (ApiException e) {
                System.err.println("Exception when calling DeviceStateApi#deleteDeviceState");
                e.printStackTrace();
            }
        }
    }

    Long *deviceStateId = 789; // Device State's id

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

    // Deletes an Device State
    [apiInstance deleteDeviceStateWith:deviceStateId
                  completionHandler: ^(NSError* error) {
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var InventoryServiceDeviceStateRestApi = require('inventory_service___device_state___rest_api');

    var api = new InventoryServiceDeviceStateRestApi.DeviceStateApi()

    var deviceStateId = 789; // {Long} Device State's id

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

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

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

                var apiInstance = new DeviceStateApi();
                var deviceStateId = 789;  // Long | Device State's id

                try
                {
                    // Deletes an Device State
                    apiInstance.deleteDeviceState(deviceStateId);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling DeviceStateApi.deleteDeviceState: " + e.Message );
                }
            }
        }
    }

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

    $api_instance = new Swagger\Client\Api\DeviceStateApi();
    $deviceStateId = 789; // Long | Device State's id

    try {
        $api_instance->deleteDeviceState($deviceStateId);
    } catch (Exception $e) {
        echo 'Exception when calling DeviceStateApi->deleteDeviceState: ', $e->getMessage(), PHP_EOL;
    }
    ?>

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

    my $api_instance = WWW::SwaggerClient::DeviceStateApi->new();
    my $deviceStateId = 789; # Long | Device State's id

    eval {
        $api_instance->deleteDeviceState(deviceStateId => $deviceStateId);
    };
    if ($@) {
        warn "Exception when calling DeviceStateApi->deleteDeviceState: $@\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.DeviceStateApi()
    deviceStateId = 789 # Long | Device State's id

    try:
        # Deletes an Device State
        api_instance.delete_device_state(deviceStateId)
    except ApiException as e:
        print("Exception when calling DeviceStateApi->deleteDeviceState: %s\n" % e)

## Parameters

Path parameters

Name | Description
--- | ---
deviceStateId* | Long (int64) Device State's id Required

## Responses

### Status: 200 - Device State was deleted.

### Status: 404 - Specified Device State does not exist.

# getDeviceState

Gets Device State based on deviceStateId

    /device-states/{deviceStateId}

### Usage and SDK Samples

    curl -X GET "https://localhost/inventory-service/api/v1/device-states/{deviceStateId}"

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

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

    public class DeviceStateApiExample {

        public static void main(String[] args) {

            DeviceStateApi apiInstance = new DeviceStateApi();
            Long deviceStateId = 789; // Long | Device State's id
            try {
                DeviceState result = apiInstance.getDeviceState(deviceStateId);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling DeviceStateApi#getDeviceState");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.DeviceStateApi;

    public class DeviceStateApiExample {

        public static void main(String[] args) {
            DeviceStateApi apiInstance = new DeviceStateApi();
            Long deviceStateId = 789; // Long | Device State's id
            try {
                DeviceState result = apiInstance.getDeviceState(deviceStateId);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling DeviceStateApi#getDeviceState");
                e.printStackTrace();
            }
        }
    }

    Long *deviceStateId = 789; // Device State's id

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

    // Gets Device State based on deviceStateId
    [apiInstance getDeviceStateWith:deviceStateId
                  completionHandler: ^(DeviceState output, NSError* error) {
                                if (output) {
                                    NSLog(@"%@", output);
                                }
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var InventoryServiceDeviceStateRestApi = require('inventory_service___device_state___rest_api');

    var api = new InventoryServiceDeviceStateRestApi.DeviceStateApi()

    var deviceStateId = 789; // {Long} Device State's id

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

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

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

                var apiInstance = new DeviceStateApi();
                var deviceStateId = 789;  // Long | Device State's id

                try
                {
                    // Gets Device State based on deviceStateId
                    DeviceState result = apiInstance.getDeviceState(deviceStateId);
                    Debug.WriteLine(result);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling DeviceStateApi.getDeviceState: " + e.Message );
                }
            }
        }
    }

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

    $api_instance = new Swagger\Client\Api\DeviceStateApi();
    $deviceStateId = 789; // Long | Device State's id

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

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

    my $api_instance = WWW::SwaggerClient::DeviceStateApi->new();
    my $deviceStateId = 789; # Long | Device State's id

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

    try:
        # Gets Device State based on deviceStateId
        api_response = api_instance.get_device_state(deviceStateId)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DeviceStateApi->getDeviceState: %s\n" % e)

## Parameters

Path parameters

Name | Description
--- | ---
deviceStateId* | Long (int64) Device State's id Required

## Responses

### Status: 200 - The Device State

### Status: 404 - Requested Device State does not exist.

# getDeviceStates

Gets all Device States

    /device-states

### Usage and SDK Samples

    curl -X GET "https://localhost/inventory-service/api/v1/device-states"

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

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

    public class DeviceStateApiExample {

        public static void main(String[] args) {

            DeviceStateApi apiInstance = new DeviceStateApi();
            try {
                array[DeviceState] result = apiInstance.getDeviceStates();
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling DeviceStateApi#getDeviceStates");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.DeviceStateApi;

    public class DeviceStateApiExample {

        public static void main(String[] args) {
            DeviceStateApi apiInstance = new DeviceStateApi();
            try {
                array[DeviceState] result = apiInstance.getDeviceStates();
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling DeviceStateApi#getDeviceStates");
                e.printStackTrace();
            }
        }
    }

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

    // Gets all Device States
    [apiInstance getDeviceStatesWithCompletionHandler:
                  ^(array[DeviceState] output, NSError* error) {
                                if (output) {
                                    NSLog(@"%@", output);
                                }
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var InventoryServiceDeviceStateRestApi = require('inventory_service___device_state___rest_api');

    var api = new InventoryServiceDeviceStateRestApi.DeviceStateApi()

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

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

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

                var apiInstance = new DeviceStateApi();

                try
                {
                    // Gets all Device States
                    array[DeviceState] result = apiInstance.getDeviceStates();
                    Debug.WriteLine(result);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling DeviceStateApi.getDeviceStates: " + e.Message );
                }
            }
        }
    }

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

    $api_instance = new Swagger\Client\Api\DeviceStateApi();

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

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

    my $api_instance = WWW::SwaggerClient::DeviceStateApi->new();

    eval {
        my $result = $api_instance->getDeviceStates();
        print Dumper($result);
    };
    if ($@) {
        warn "Exception when calling DeviceStateApi->getDeviceStates: $@\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.DeviceStateApi()

    try:
        # Gets all Device States
        api_response = api_instance.get_device_states()
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DeviceStateApi->getDeviceStates: %s\n" % e)

## Parameters

## Responses

### Status: 200 - All Device States

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