# ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationApi

All URIs are relative to *http://localhost/gemini-web/rest*

Method | HTTP request | Description
------------- | ------------- | -------------
[**createLocation**](LocationApi.md#createLocation) | **POST** /location/locations | insert resource
[**deleteLocation**](LocationApi.md#deleteLocation) | **DELETE** /location/locations/{id} | delete resource
[**fullUpdateLocation**](LocationApi.md#fullUpdateLocation) | **PUT** /location/locations/{id} | update resource
[**getAllCountries**](LocationApi.md#getAllCountries) | **GET** /location/countries | get list of resources
[**getAllLocations**](LocationApi.md#getAllLocations) | **GET** /location/locations | get list of resources
[**getChildrenOf**](LocationApi.md#getChildrenOf) | **GET** /location/locations/{id}/sublocations | Get sub-locations
[**getParent**](LocationApi.md#getParent) | **GET** /location/locations/{id}/parent | Get the parent location of a location
[**getRoots**](LocationApi.md#getRoots) | **GET** /location/locations/roots | Get root locations
[**getSingleCountry**](LocationApi.md#getSingleCountry) | **GET** /location/countries/{id} | get resource
[**getSingleLocation**](LocationApi.md#getSingleLocation) | **GET** /location/locations/{id} | get resource
[**updateLocation**](LocationApi.md#updateLocation) | **POST** /location/locations/{id} | perform a partial update of the resource


<a name="createLocation"></a>
# **createLocation**
> LocationJson createLocation(body, opts)

insert resource

Inserts a single resource.

### Example
```javascript
var ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail = require('this_is_the_documentation_of_the_rest_interfaces_provided_by_nts_retail');
var defaultClient = ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.ApiClient.instance;

// Configure OAuth2 access token for authorization: gemini_auth
var gemini_auth = defaultClient.authentications['gemini_auth'];
gemini_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationApi();

var body = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationJson(); // LocationJson | The location to insert

var opts = { 
  'transactionId': "transactionId_example", // String | A unique transaction ID used for idempotent inserts.
  'expand': "expand_example", // String | Expandable properties:parent
  'shortToken': "shortToken_example" // String | A temporary short token which can be used as an alternative to the JWT.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createLocation(body, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**LocationJson**](LocationJson.md)| The location to insert | 
 **transactionId** | **String**| A unique transaction ID used for idempotent inserts. | [optional] 
 **expand** | **String**| Expandable properties:parent | [optional] 
 **shortToken** | **String**| A temporary short token which can be used as an alternative to the JWT. | [optional] 

### Return type

[**LocationJson**](LocationJson.md)

### Authorization

[gemini_auth](../README.md#gemini_auth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: Not defined

<a name="deleteLocation"></a>
# **deleteLocation**
> deleteLocation(id, cascade, opts)

delete resource

Deletes a single resource.

### Example
```javascript
var ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail = require('this_is_the_documentation_of_the_rest_interfaces_provided_by_nts_retail');
var defaultClient = ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.ApiClient.instance;

// Configure OAuth2 access token for authorization: gemini_auth
var gemini_auth = defaultClient.authentications['gemini_auth'];
gemini_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationApi();

var id = 789; // Number | The ID of the location to delete.

var cascade = false; // Boolean | Indicates whether sub-locations should be deleted. If false, an exception will be thrown if sub-locations exist.

var opts = { 
  'shortToken': "shortToken_example" // String | A temporary short token which can be used as an alternative to the JWT.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteLocation(id, cascade, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **Number**| The ID of the location to delete. | 
 **cascade** | **Boolean**| Indicates whether sub-locations should be deleted. If false, an exception will be thrown if sub-locations exist. | [default to false]
 **shortToken** | **String**| A temporary short token which can be used as an alternative to the JWT. | [optional] 

### Return type

null (empty response body)

### Authorization

[gemini_auth](../README.md#gemini_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="fullUpdateLocation"></a>
# **fullUpdateLocation**
> fullUpdateLocation(id, body, opts)

update resource

Updates an item with the given ID. The request body has to contain the whole data-object since this is a full update operation.

### Example
```javascript
var ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail = require('this_is_the_documentation_of_the_rest_interfaces_provided_by_nts_retail');
var defaultClient = ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.ApiClient.instance;

// Configure OAuth2 access token for authorization: gemini_auth
var gemini_auth = defaultClient.authentications['gemini_auth'];
gemini_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationApi();

var id = 789; // Number | The ID of the resource.

var body = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationJson(); // LocationJson | The resource to update.

var opts = { 
  'shortToken': "shortToken_example" // String | A temporary short token which can be used as an alternative to the JWT.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.fullUpdateLocation(id, body, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **Number**| The ID of the resource. | 
 **body** | [**LocationJson**](LocationJson.md)| The resource to update. | 
 **shortToken** | **String**| A temporary short token which can be used as an alternative to the JWT. | [optional] 

### Return type

null (empty response body)

### Authorization

[gemini_auth](../README.md#gemini_auth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: Not defined

<a name="getAllCountries"></a>
# **getAllCountries**
> CountryRestResultPage getAllCountries(opts)

get list of resources

Gets a list of resources.

### Example
```javascript
var ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail = require('this_is_the_documentation_of_the_rest_interfaces_provided_by_nts_retail');
var defaultClient = ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.ApiClient.instance;

// Configure OAuth2 access token for authorization: gemini_auth
var gemini_auth = defaultClient.authentications['gemini_auth'];
gemini_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationApi();

var opts = { 
  'limit': 56, // Number | An integer which is the limit (max number) of returned records (used for pagination).
  'offset': 56, // Number | An integer (< list-size-1) that is the offset of the first record to transmit (used for pagination).
  'page': 56, // Number | An integer that designates the pagenumber of the first record to transmit (used for pagination).
  'msisdnCountryCode': 56, // Number | A (1-3 digits) number representing the MSISDN country code.
  'alpha2Code': "alpha2Code_example", // String | Two characters representing the unique Alpha-2 code.
  'alpha3Code': "alpha3Code_example", // String | Three characters representing the unique Alpha-3 code.
  'numCode': 56, // Number | A (1-3 digits) number representing the numeric country code.
  'name': "name_example", // String | The country name.
  'shortToken': "shortToken_example" // String | A temporary short token which can be used as an alternative to the JWT.
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **limit** | **Number**| An integer which is the limit (max number) of returned records (used for pagination). | [optional] 
 **offset** | **Number**| An integer (&lt; list-size-1) that is the offset of the first record to transmit (used for pagination). | [optional] 
 **page** | **Number**| An integer that designates the pagenumber of the first record to transmit (used for pagination). | [optional] 
 **msisdnCountryCode** | **Number**| A (1-3 digits) number representing the MSISDN country code. | [optional] 
 **alpha2Code** | **String**| Two characters representing the unique Alpha-2 code. | [optional] 
 **alpha3Code** | **String**| Three characters representing the unique Alpha-3 code. | [optional] 
 **numCode** | **Number**| A (1-3 digits) number representing the numeric country code. | [optional] 
 **name** | **String**| The country name. | [optional] 
 **shortToken** | **String**| A temporary short token which can be used as an alternative to the JWT. | [optional] 

### Return type

[**CountryRestResultPage**](CountryRestResultPage.md)

### Authorization

[gemini_auth](../README.md#gemini_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="getAllLocations"></a>
# **getAllLocations**
> LocationRestResultPage getAllLocations(opts)

get list of resources

Gets a list of resources.

### Example
```javascript
var ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail = require('this_is_the_documentation_of_the_rest_interfaces_provided_by_nts_retail');
var defaultClient = ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.ApiClient.instance;

// Configure OAuth2 access token for authorization: gemini_auth
var gemini_auth = defaultClient.authentications['gemini_auth'];
gemini_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationApi();

var opts = { 
  'limit': 56, // Number | An integer which is the limit (max number) of returned records (used for pagination).
  'offset': 56, // Number | An integer (< list-size-1) that is the offset of the first record to transmit (used for pagination).
  'page': 56, // Number | An integer that designates the pagenumber of the first record to transmit (used for pagination).
  'name': "name_example", // String | A case-insensitive part of the location name.
  'locationIds': [3.4], // [Number] | The location IDs to get.
  'includeDescendants': true, // Boolean | If set to true, include descendants.
  'locationType': "locationType_example", // String | Identifies the type of locations to be returned.
  'expand': "expand_example", // String | Expandable properties:parent
  'shortToken': "shortToken_example" // String | A temporary short token which can be used as an alternative to the JWT.
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **limit** | **Number**| An integer which is the limit (max number) of returned records (used for pagination). | [optional] 
 **offset** | **Number**| An integer (&lt; list-size-1) that is the offset of the first record to transmit (used for pagination). | [optional] 
 **page** | **Number**| An integer that designates the pagenumber of the first record to transmit (used for pagination). | [optional] 
 **name** | **String**| A case-insensitive part of the location name. | [optional] 
 **locationIds** | [**[Number]**](Number.md)| The location IDs to get. | [optional] 
 **includeDescendants** | **Boolean**| If set to true, include descendants. | [optional] 
 **locationType** | **String**| Identifies the type of locations to be returned. | [optional] 
 **expand** | **String**| Expandable properties:parent | [optional] 
 **shortToken** | **String**| A temporary short token which can be used as an alternative to the JWT. | [optional] 

### Return type

[**LocationRestResultPage**](LocationRestResultPage.md)

### Authorization

[gemini_auth](../README.md#gemini_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="getChildrenOf"></a>
# **getChildrenOf**
> LocationRestResultPage getChildrenOf(id, opts)

Get sub-locations

Get all children of the location with the given id.

### Example
```javascript
var ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail = require('this_is_the_documentation_of_the_rest_interfaces_provided_by_nts_retail');
var defaultClient = ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.ApiClient.instance;

// Configure OAuth2 access token for authorization: gemini_auth
var gemini_auth = defaultClient.authentications['gemini_auth'];
gemini_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationApi();

var id = 789; // Number | The ID of the parent location

var opts = { 
  'limit': 56, // Number | An integer which is the limit (max number) of returned records (used for pagination).
  'offset': 56, // Number | An integer (< list-size-1) that is the offset of the first record to transmit (used for pagination).
  'page': 56, // Number | An integer that designates the pagenumber of the first record to transmit (used for pagination).
  'expand': "expand_example", // String | Expandable properties:parent
  'shortToken': "shortToken_example" // String | A temporary short token which can be used as an alternative to the JWT.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getChildrenOf(id, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **Number**| The ID of the parent location | 
 **limit** | **Number**| An integer which is the limit (max number) of returned records (used for pagination). | [optional] 
 **offset** | **Number**| An integer (&lt; list-size-1) that is the offset of the first record to transmit (used for pagination). | [optional] 
 **page** | **Number**| An integer that designates the pagenumber of the first record to transmit (used for pagination). | [optional] 
 **expand** | **String**| Expandable properties:parent | [optional] 
 **shortToken** | **String**| A temporary short token which can be used as an alternative to the JWT. | [optional] 

### Return type

[**LocationRestResultPage**](LocationRestResultPage.md)

### Authorization

[gemini_auth](../README.md#gemini_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="getParent"></a>
# **getParent**
> LocationJson getParent(id, opts)

Get the parent location of a location

Get the parent location of a location with a given ID if such a parent exists.

### Example
```javascript
var ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail = require('this_is_the_documentation_of_the_rest_interfaces_provided_by_nts_retail');
var defaultClient = ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.ApiClient.instance;

// Configure OAuth2 access token for authorization: gemini_auth
var gemini_auth = defaultClient.authentications['gemini_auth'];
gemini_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationApi();

var id = 789; // Number | The ID of the location.

var opts = { 
  'expand': "expand_example", // String | Expandable properties:parent
  'shortToken': "shortToken_example" // String | A temporary short token which can be used as an alternative to the JWT.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getParent(id, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **Number**| The ID of the location. | 
 **expand** | **String**| Expandable properties:parent | [optional] 
 **shortToken** | **String**| A temporary short token which can be used as an alternative to the JWT. | [optional] 

### Return type

[**LocationJson**](LocationJson.md)

### Authorization

[gemini_auth](../README.md#gemini_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="getRoots"></a>
# **getRoots**
> LocationRestResultPage getRoots(opts)

Get root locations

Get all root locations

### Example
```javascript
var ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail = require('this_is_the_documentation_of_the_rest_interfaces_provided_by_nts_retail');
var defaultClient = ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.ApiClient.instance;

// Configure OAuth2 access token for authorization: gemini_auth
var gemini_auth = defaultClient.authentications['gemini_auth'];
gemini_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationApi();

var opts = { 
  'limit': 56, // Number | An integer which is the limit (max number) of returned records (used for pagination).
  'offset': 56, // Number | An integer (< list-size-1) that is the offset of the first record to transmit (used for pagination).
  'page': 56, // Number | An integer that designates the pagenumber of the first record to transmit (used for pagination).
  'expand': "expand_example", // String | Expandable properties:parent
  'shortToken': "shortToken_example" // String | A temporary short token which can be used as an alternative to the JWT.
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **limit** | **Number**| An integer which is the limit (max number) of returned records (used for pagination). | [optional] 
 **offset** | **Number**| An integer (&lt; list-size-1) that is the offset of the first record to transmit (used for pagination). | [optional] 
 **page** | **Number**| An integer that designates the pagenumber of the first record to transmit (used for pagination). | [optional] 
 **expand** | **String**| Expandable properties:parent | [optional] 
 **shortToken** | **String**| A temporary short token which can be used as an alternative to the JWT. | [optional] 

### Return type

[**LocationRestResultPage**](LocationRestResultPage.md)

### Authorization

[gemini_auth](../README.md#gemini_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="getSingleCountry"></a>
# **getSingleCountry**
> CountryJson getSingleCountry(id, opts)

get resource

Gets a single resource.

### Example
```javascript
var ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail = require('this_is_the_documentation_of_the_rest_interfaces_provided_by_nts_retail');
var defaultClient = ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.ApiClient.instance;

// Configure OAuth2 access token for authorization: gemini_auth
var gemini_auth = defaultClient.authentications['gemini_auth'];
gemini_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationApi();

var id = 789; // Number | The ID of the resource.

var opts = { 
  'shortToken': "shortToken_example" // String | A temporary short token which can be used as an alternative to the JWT.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getSingleCountry(id, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **Number**| The ID of the resource. | 
 **shortToken** | **String**| A temporary short token which can be used as an alternative to the JWT. | [optional] 

### Return type

[**CountryJson**](CountryJson.md)

### Authorization

[gemini_auth](../README.md#gemini_auth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getSingleLocation"></a>
# **getSingleLocation**
> LocationJson getSingleLocation(id, opts)

get resource

Gets a single resource.

### Example
```javascript
var ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail = require('this_is_the_documentation_of_the_rest_interfaces_provided_by_nts_retail');
var defaultClient = ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.ApiClient.instance;

// Configure OAuth2 access token for authorization: gemini_auth
var gemini_auth = defaultClient.authentications['gemini_auth'];
gemini_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationApi();

var id = 789; // Number | The ID of the location.

var opts = { 
  'expand': "expand_example", // String | Expandable properties:parent
  'shortToken': "shortToken_example" // String | A temporary short token which can be used as an alternative to the JWT.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getSingleLocation(id, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **Number**| The ID of the location. | 
 **expand** | **String**| Expandable properties:parent | [optional] 
 **shortToken** | **String**| A temporary short token which can be used as an alternative to the JWT. | [optional] 

### Return type

[**LocationJson**](LocationJson.md)

### Authorization

[gemini_auth](../README.md#gemini_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="updateLocation"></a>
# **updateLocation**
> updateLocation(id, body, opts)

perform a partial update of the resource

Updates only the given values of an existing resource.

### Example
```javascript
var ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail = require('this_is_the_documentation_of_the_rest_interfaces_provided_by_nts_retail');
var defaultClient = ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.ApiClient.instance;

// Configure OAuth2 access token for authorization: gemini_auth
var gemini_auth = defaultClient.authentications['gemini_auth'];
gemini_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.LocationApi();

var id = 789; // Number | The ID of the location

var body = new ThisIsTheDocumentationOfTheRestInterfacesProvidedByNtsRetail.JsonNode(); // JsonNode | The location to update

var opts = { 
  'shortToken': "shortToken_example" // String | A temporary short token which can be used as an alternative to the JWT.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.updateLocation(id, body, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **Number**| The ID of the location | 
 **body** | [**JsonNode**](JsonNode.md)| The location to update | 
 **shortToken** | **String**| A temporary short token which can be used as an alternative to the JWT. | [optional] 

### Return type

null (empty response body)

### Authorization

[gemini_auth](../README.md#gemini_auth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: Not defined

