# IiiDispatch.TaxiApi

All URIs are relative to *http://localhost/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addTaxi**](TaxiApi.md#addTaxi) | **POST** /taxi | 新增車輛
[**deleteTaxi**](TaxiApi.md#deleteTaxi) | **DELETE** /taxi/{taxiId} | Deletes a taxi
[**findTaxiByStatus**](TaxiApi.md#findTaxiByStatus) | **GET** /taxi/findByStatus | Finds Taxi by status
[**getTaxiById**](TaxiApi.md#getTaxiById) | **GET** /taxi/{taxiId} | 以ID連結車輛資料
[**updateTaxi**](TaxiApi.md#updateTaxi) | **PUT** /taxi | 更新車輛資料
[**updateTaxiWithForm**](TaxiApi.md#updateTaxiWithForm) | **POST** /taxi/{taxiId} | 更新ID指定之車輛資料


<a name="addTaxi"></a>
# **addTaxi**
> addTaxi(body)

新增車輛



### Example
```javascript
var IiiDispatch = require('iii_dispatch');
var defaultClient = IiiDispatch.ApiClient.instance;

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

var apiInstance = new IiiDispatch.TaxiApi();

var body = new IiiDispatch.Taxi(); // Taxi | 新增派遣車輛


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Taxi**](Taxi.md)| 新增派遣車輛 | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="deleteTaxi"></a>
# **deleteTaxi**
> deleteTaxi(taxiId, opts)

Deletes a taxi



### Example
```javascript
var IiiDispatch = require('iii_dispatch');
var defaultClient = IiiDispatch.ApiClient.instance;

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

var apiInstance = new IiiDispatch.TaxiApi();

var taxiId = 789; // Number | Taxi id to delete

var opts = { 
  'apiKey': "apiKey_example" // String | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **taxiId** | **Number**| Taxi id to delete | 
 **apiKey** | **String**|  | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="findTaxiByStatus"></a>
# **findTaxiByStatus**
> [Taxi] findTaxiByStatus(status)

Finds Taxi by status

### Example
```javascript
var IiiDispatch = require('iii_dispatch');
var defaultClient = IiiDispatch.ApiClient.instance;

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

var apiInstance = new IiiDispatch.TaxiApi();

var status = "on_duty"; // String | Status values that need to be considered for filter


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **status** | **String**| Status values that need to be considered for filter | [default to on_duty]

### Return type

[**[Taxi]**](Taxi.md)

### Authorization

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

### HTTP request headers

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

<a name="getTaxiById"></a>
# **getTaxiById**
> Taxi getTaxiById(taxiId)

以ID連結車輛資料

回傳單筆車輛資料

### Example
```javascript
var IiiDispatch = require('iii_dispatch');
var defaultClient = IiiDispatch.ApiClient.instance;

// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new IiiDispatch.TaxiApi();

var taxiId = 789; // Number | ID of taxi to return


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **taxiId** | **Number**| ID of taxi to return | 

### Return type

[**Taxi**](Taxi.md)

### Authorization

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

### HTTP request headers

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

<a name="updateTaxi"></a>
# **updateTaxi**
> updateTaxi(body)

更新車輛資料



### Example
```javascript
var IiiDispatch = require('iii_dispatch');
var defaultClient = IiiDispatch.ApiClient.instance;

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

var apiInstance = new IiiDispatch.TaxiApi();

var body = new IiiDispatch.Taxi(); // Taxi | 更新車輛資料


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Taxi**](Taxi.md)| 更新車輛資料 | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="updateTaxiWithForm"></a>
# **updateTaxiWithForm**
> updateTaxiWithForm(taxiId, opts)

更新ID指定之車輛資料

更新單筆車輛資料

### Example
```javascript
var IiiDispatch = require('iii_dispatch');
var defaultClient = IiiDispatch.ApiClient.instance;

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

var apiInstance = new IiiDispatch.TaxiApi();

var taxiId = 789; // Number | ID of taxi that needs to be updated

var opts = { 
  'licensePlate': "licensePlate_example", // String | Updated license plate of the taxi
  'driver': 789, // Number | Updated driver of the taxi
  'status': "status_example", // String | Updated status of the taxi
  'longitude': 8.14, // Number | Updated longitude of the taxi
  'latitude': 8.14 // Number | Updated longitude of the taxi
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **taxiId** | **Number**| ID of taxi that needs to be updated | 
 **licensePlate** | **String**| Updated license plate of the taxi | [optional] 
 **driver** | **Number**| Updated driver of the taxi | [optional] 
 **status** | **String**| Updated status of the taxi | [optional] 
 **longitude** | **Number**| Updated longitude of the taxi | [optional] 
 **latitude** | **Number**| Updated longitude of the taxi | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/xml, application/json

