# SwaggerJsClient.TownsApi

All URIs are relative to *https://localhost/buyborghi-api/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**townsGet**](TownsApi.md#townsGet) | **GET** /towns | Town list
[**townsPost**](TownsApi.md#townsPost) | **POST** /towns | Add town Geo-coordinates
[**townsTownIdCompaniesCompanyIdCouponsGet**](TownsApi.md#townsTownIdCompaniesCompanyIdCouponsGet) | **GET** /towns/{townId}/companies/{companyId}/coupons | Get coupons made by the company
[**townsTownIdCompaniesCompanyIdEventsGet**](TownsApi.md#townsTownIdCompaniesCompanyIdEventsGet) | **GET** /towns/{townId}/companies/{companyId}/events | Get events organized by the company
[**townsTownIdCompaniesCompanyIdGet**](TownsApi.md#townsTownIdCompaniesCompanyIdGet) | **GET** /towns/{townId}/companies/{companyId} | Get company's details
[**townsTownIdCompaniesGet**](TownsApi.md#townsTownIdCompaniesGet) | **GET** /towns/{townId}/companies | Get companies related to the town
[**townsTownIdCouponsCouponIdGet**](TownsApi.md#townsTownIdCouponsCouponIdGet) | **GET** /towns/{townId}/coupons/{couponId} | Get coupons's details
[**townsTownIdCouponsGet**](TownsApi.md#townsTownIdCouponsGet) | **GET** /towns/{townId}/coupons | Get coupons related to the town
[**townsTownIdElementsGet**](TownsApi.md#townsTownIdElementsGet) | **GET** /towns/{townId}/elements | Find elements of any type
[**townsTownIdEventsEventIdGet**](TownsApi.md#townsTownIdEventsEventIdGet) | **GET** /towns/{townId}/events/{eventId} | Get event's details
[**townsTownIdEventsGet**](TownsApi.md#townsTownIdEventsGet) | **GET** /towns/{townId}/events | Get events related to the town
[**townsTownIdGet**](TownsApi.md#townsTownIdGet) | **GET** /towns/{townId} | Get town's details
[**townsTownIdPlacesGet**](TownsApi.md#townsTownIdPlacesGet) | **GET** /towns/{townId}/places | Get places related to the town
[**townsTownIdPlacesPlaceIdGet**](TownsApi.md#townsTownIdPlacesPlaceIdGet) | **GET** /towns/{townId}/places/{placeId} | Get event's details


<a name="townsGet"></a>
# **townsGet**
> GetTownsResponse townsGet()

Town list



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

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

### Parameters
This endpoint does not need any parameter.

### Return type

[**GetTownsResponse**](GetTownsResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsPost"></a>
# **townsPost**
> GetTownsResponse townsPost(opts)

Add town Geo-coordinates



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var opts = { 
  'body': new SwaggerJsClient.Polygon() // Polygon | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Polygon**](Polygon.md)|  | [optional] 

### Return type

[**GetTownsResponse**](GetTownsResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsTownIdCompaniesCompanyIdCouponsGet"></a>
# **townsTownIdCompaniesCompanyIdCouponsGet**
> GetTownsCompaniesIdCouponsResponse townsTownIdCompaniesCompanyIdCouponsGet(townId, companyId)

Get coupons made by the company



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var townId = "townId_example"; // String | A unique identifier used to identify the town.

var companyId = "companyId_example"; // String | A unique identifier used to identify the company.


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **townId** | **String**| A unique identifier used to identify the town. | 
 **companyId** | **String**| A unique identifier used to identify the company. | 

### Return type

[**GetTownsCompaniesIdCouponsResponse**](GetTownsCompaniesIdCouponsResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsTownIdCompaniesCompanyIdEventsGet"></a>
# **townsTownIdCompaniesCompanyIdEventsGet**
> GetTownsCompaniesIdEventsResponse townsTownIdCompaniesCompanyIdEventsGet(townId, companyId)

Get events organized by the company



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var townId = "townId_example"; // String | A unique identifier used to identify the town.

var companyId = "companyId_example"; // String | A unique identifier used to identify the company.


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **townId** | **String**| A unique identifier used to identify the town. | 
 **companyId** | **String**| A unique identifier used to identify the company. | 

### Return type

[**GetTownsCompaniesIdEventsResponse**](GetTownsCompaniesIdEventsResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsTownIdCompaniesCompanyIdGet"></a>
# **townsTownIdCompaniesCompanyIdGet**
> GetTownsCompaniesIdResponse townsTownIdCompaniesCompanyIdGet(townId, companyId)

Get company's details



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var townId = "townId_example"; // String | A unique identifier used to identify the town.

var companyId = "companyId_example"; // String | A unique identifier used to identify the company.


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **townId** | **String**| A unique identifier used to identify the town. | 
 **companyId** | **String**| A unique identifier used to identify the company. | 

### Return type

[**GetTownsCompaniesIdResponse**](GetTownsCompaniesIdResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsTownIdCompaniesGet"></a>
# **townsTownIdCompaniesGet**
> GetTownsIdCompaniesResponse townsTownIdCompaniesGet(townId)

Get companies related to the town



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var townId = "townId_example"; // String | A unique identifier used to identify the town.


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **townId** | **String**| A unique identifier used to identify the town. | 

### Return type

[**GetTownsIdCompaniesResponse**](GetTownsIdCompaniesResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsTownIdCouponsCouponIdGet"></a>
# **townsTownIdCouponsCouponIdGet**
> GetTownsIdCouponsIdResponse townsTownIdCouponsCouponIdGet(townId, couponId)

Get coupons's details



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var townId = "townId_example"; // String | A unique identifier used to identify the town.

var couponId = "couponId_example"; // String | A unique identifier used to identify the coupon.


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **townId** | **String**| A unique identifier used to identify the town. | 
 **couponId** | **String**| A unique identifier used to identify the coupon. | 

### Return type

[**GetTownsIdCouponsIdResponse**](GetTownsIdCouponsIdResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsTownIdCouponsGet"></a>
# **townsTownIdCouponsGet**
> GetTownsIdCouponsResponse townsTownIdCouponsGet(townId)

Get coupons related to the town



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var townId = "townId_example"; // String | A unique identifier used to identify the town.


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **townId** | **String**| A unique identifier used to identify the town. | 

### Return type

[**GetTownsIdCouponsResponse**](GetTownsIdCouponsResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsTownIdElementsGet"></a>
# **townsTownIdElementsGet**
> GetTownsIdElementsResponse townsTownIdElementsGet(townId, text)

Find elements of any type



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var townId = "townId_example"; // String | A unique identifier used to identify the town.

var text = "text_example"; // String | Text related to the elements to find


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **townId** | **String**| A unique identifier used to identify the town. | 
 **text** | **String**| Text related to the elements to find | 

### Return type

[**GetTownsIdElementsResponse**](GetTownsIdElementsResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsTownIdEventsEventIdGet"></a>
# **townsTownIdEventsEventIdGet**
> GetTownsIdEventsIdResponse townsTownIdEventsEventIdGet(townId, eventId)

Get event's details



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var townId = "townId_example"; // String | A unique identifier used to identify the town.

var eventId = "eventId_example"; // String | A unique identifier used to identify the event.


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **townId** | **String**| A unique identifier used to identify the town. | 
 **eventId** | **String**| A unique identifier used to identify the event. | 

### Return type

[**GetTownsIdEventsIdResponse**](GetTownsIdEventsIdResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsTownIdEventsGet"></a>
# **townsTownIdEventsGet**
> GetTownsIdEventsResponse townsTownIdEventsGet(townId)

Get events related to the town



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var townId = "townId_example"; // String | A unique identifier used to identify the town.


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **townId** | **String**| A unique identifier used to identify the town. | 

### Return type

[**GetTownsIdEventsResponse**](GetTownsIdEventsResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsTownIdGet"></a>
# **townsTownIdGet**
> GetTownsIdResponse townsTownIdGet(townId)

Get town's details



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var townId = "townId_example"; // String | A unique identifier used to identify the town.


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **townId** | **String**| A unique identifier used to identify the town. | 

### Return type

[**GetTownsIdResponse**](GetTownsIdResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsTownIdPlacesGet"></a>
# **townsTownIdPlacesGet**
> GetTownsIdPlacesResponse townsTownIdPlacesGet(townId)

Get places related to the town



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var townId = "townId_example"; // String | A unique identifier used to identify the town.


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **townId** | **String**| A unique identifier used to identify the town. | 

### Return type

[**GetTownsIdPlacesResponse**](GetTownsIdPlacesResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="townsTownIdPlacesPlaceIdGet"></a>
# **townsTownIdPlacesPlaceIdGet**
> GetTownsIdPlacesIdResponse townsTownIdPlacesPlaceIdGet(townId, placeId)

Get event's details



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.TownsApi();

var townId = "townId_example"; // String | A unique identifier used to identify the town.

var placeId = "placeId_example"; // String | A unique identifier used to identify the place.


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **townId** | **String**| A unique identifier used to identify the town. | 
 **placeId** | **String**| A unique identifier used to identify the place. | 

### Return type

[**GetTownsIdPlacesIdResponse**](GetTownsIdPlacesIdResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

