# Siemens Inventory REST API

## API and SDK Documentation

Version: 1.0.0

REST API for Inventory Service

# User

# getCurrentUser

Gets currentl logged in user based on authentication

    /users/me

### Usage and SDK Samples

    curl -X GET "https://localhost/inventory-service/api/v1/users/me"

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

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

    public class UserApiExample {

        public static void main(String[] args) {

            UserApi apiInstance = new UserApi();
            try {
                User result = apiInstance.getCurrentUser();
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling UserApi#getCurrentUser");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.UserApi;

    public class UserApiExample {

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

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

    // Gets currentl logged in user based on authentication
    [apiInstance getCurrentUserWithCompletionHandler:
                  ^(User output, NSError* error) {
                                if (output) {
                                    NSLog(@"%@", output);
                                }
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var SiemensInventoryRestApi = require('siemens_inventory_rest_api');

    var api = new SiemensInventoryRestApi.UserApi()

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

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

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

                var apiInstance = new UserApi();

                try
                {
                    // Gets currentl logged in user based on authentication
                    User result = apiInstance.getCurrentUser();
                    Debug.WriteLine(result);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling UserApi.getCurrentUser: " + e.Message );
                }
            }
        }
    }

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

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

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

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

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

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

    try:
        # Gets currentl logged in user based on authentication
        api_response = api_instance.get_current_user()
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling UserApi->getCurrentUser: %s\n" % e)

## Parameters

## Responses

### Status: 200 - Current User

# getUser

Gets User based on userId

    /users/{userId}

### Usage and SDK Samples

    curl -X GET "https://localhost/inventory-service/api/v1/users/{userId}"

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

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

    public class UserApiExample {

        public static void main(String[] args) {

            UserApi apiInstance = new UserApi();
            Long userId = 789; // Long | User id to get
            try {
                User result = apiInstance.getUser(userId);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling UserApi#getUser");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.UserApi;

    public class UserApiExample {

        public static void main(String[] args) {
            UserApi apiInstance = new UserApi();
            Long userId = 789; // Long | User id to get
            try {
                User result = apiInstance.getUser(userId);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling UserApi#getUser");
                e.printStackTrace();
            }
        }
    }

    Long *userId = 789; // User id to get

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

    // Gets User based on userId
    [apiInstance getUserWith:userId
                  completionHandler: ^(User output, NSError* error) {
                                if (output) {
                                    NSLog(@"%@", output);
                                }
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var SiemensInventoryRestApi = require('siemens_inventory_rest_api');

    var api = new SiemensInventoryRestApi.UserApi()

    var userId = 789; // {Long} User id to get

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

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

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

                var apiInstance = new UserApi();
                var userId = 789;  // Long | User id to get

                try
                {
                    // Gets User based on userId
                    User result = apiInstance.getUser(userId);
                    Debug.WriteLine(result);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling UserApi.getUser: " + e.Message );
                }
            }
        }
    }

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

    $api_instance = new Swagger\Client\Api\UserApi();
    $userId = 789; // Long | User id to get

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

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

    my $api_instance = WWW::SwaggerClient::UserApi->new();
    my $userId = 789; # Long | User id to get

    eval {
        my $result = $api_instance->getUser(userId => $userId);
        print Dumper($result);
    };
    if ($@) {
        warn "Exception when calling UserApi->getUser: $@\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.UserApi()
    userId = 789 # Long | User id to get

    try:
        # Gets User based on userId
        api_response = api_instance.get_user(userId)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling UserApi->getUser: %s\n" % e)

## Parameters

Path parameters

Name | Description
--- | ---
userId* | Long (int64) User id to get Required

## Responses

### Status: 200 - The User

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

# getUsers

Gets all Users

    /users

### Usage and SDK Samples

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

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

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

    public class UserApiExample {

        public static void main(String[] args) {

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

    import io.swagger.client.api.UserApi;

    public class UserApiExample {

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

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

    // Gets all Users
    [apiInstance getUsersWithCompletionHandler:
                  ^(array[User] output, NSError* error) {
                                if (output) {
                                    NSLog(@"%@", output);
                                }
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var SiemensInventoryRestApi = require('siemens_inventory_rest_api');

    var api = new SiemensInventoryRestApi.UserApi()

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

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

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

                var apiInstance = new UserApi();

                try
                {
                    // Gets all Users
                    array[User] result = apiInstance.getUsers();
                    Debug.WriteLine(result);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling UserApi.getUsers: " + e.Message );
                }
            }
        }
    }

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

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

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

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

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

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

    try:
        # Gets all Users
        api_response = api_instance.get_users()
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling UserApi->getUsers: %s\n" % e)

## Parameters

## Responses

### Status: 200 - All Users

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