Skip to content

Latest commit

 

History

History
387 lines (281 loc) · 14 KB

VehiclesApi.md

File metadata and controls

387 lines (281 loc) · 14 KB

knowgo.api.VehiclesApi

Load the API package

import 'package:knowgo/api.dart';

All URIs are relative to https://api.adaptant.io/v1

Method HTTP request Description
addAuto POST /autos Add a new auto
deleteAuto DELETE /autos/{autoId} Deletes an Auto
getAutoById GET /autos/{autoId} Find auto by ID
listVehicles GET /vehicles Return a list of vehicles available for a specific user
listVehiclesByUserId GET /users/{userId}/vehicles Return a list of vehicles available for a specific user
updateAuto PUT /autos Update an existing auto
updateAutoWithForm POST /autos/{autoId} Updates an auto with form data

addAuto

Auto addAuto(auto)

Add a new auto

Adds a new Auto to the system. The AutoID as input is ignored, as it is dynamically allocated at insertion time. Auto details may be as complete or as incomplete as needed, with later updates possible via the PUT method. The complete new Auto record with allocated AutoID are returned upon successful record creation.

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = VehiclesApi();
var auto = Auto(); // Auto | Auto object to operate on

try { 
    var result = api_instance.addAuto(auto);
    print(result);
} catch (e) {
    print("Exception when calling VehiclesApi->addAuto: $e\n");
}

Parameters

Name Type Description Notes
auto Auto Auto object to operate on

Return type

Auto

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteAuto

deleteAuto(autoId)

Deletes an Auto

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = VehiclesApi();
var autoId = 789; // int | Auto id to delete

try { 
    api_instance.deleteAuto(autoId);
} catch (e) {
    print("Exception when calling VehiclesApi->deleteAuto: $e\n");
}

Parameters

Name Type Description Notes
autoId int Auto id to delete [default to null]

Return type

void (empty response body)

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getAutoById

Auto getAutoById(autoId)

Find auto by ID

Returns a single auto

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = VehiclesApi();
var autoId = 789; // int | ID of auto to return

try { 
    var result = api_instance.getAutoById(autoId);
    print(result);
} catch (e) {
    print("Exception when calling VehiclesApi->getAutoById: $e\n");
}

Parameters

Name Type Description Notes
autoId int ID of auto to return [default to null]

Return type

Auto

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listVehicles

List listVehicles()

Return a list of vehicles available for a specific user

Given an authenticated user, return a list of vehicles that are available to them.

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = VehiclesApi();

try { 
    var result = api_instance.listVehicles();
    print(result);
} catch (e) {
    print("Exception when calling VehiclesApi->listVehicles: $e\n");
}

Parameters

This endpoint does not need any parameter.

Return type

List

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listVehiclesByUserId

List listVehiclesByUserId(userId)

Return a list of vehicles available for a specific user

Given an authenticated user, return a list of vehicles that are available to them.

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = VehiclesApi();
var userId = 789; // int | ID of user that needs to be fetched

try { 
    var result = api_instance.listVehiclesByUserId(userId);
    print(result);
} catch (e) {
    print("Exception when calling VehiclesApi->listVehiclesByUserId: $e\n");
}

Parameters

Name Type Description Notes
userId int ID of user that needs to be fetched [default to null]

Return type

List

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateAuto

updateAuto(auto)

Update an existing auto

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = VehiclesApi();
var auto = Auto(); // Auto | Auto object to operate on

try { 
    api_instance.updateAuto(auto);
} catch (e) {
    print("Exception when calling VehiclesApi->updateAuto: $e\n");
}

Parameters

Name Type Description Notes
auto Auto Auto object to operate on

Return type

void (empty response body)

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateAutoWithForm

updateAutoWithForm(autoId, auto)

Updates an auto with form data

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = VehiclesApi();
var autoId = 789; // int | ID of auto that needs to be updated
var auto = Auto(); // Auto | Auto object to operate on

try { 
    api_instance.updateAutoWithForm(autoId, auto);
} catch (e) {
    print("Exception when calling VehiclesApi->updateAutoWithForm: $e\n");
}

Parameters

Name Type Description Notes
autoId int ID of auto that needs to be updated [default to null]
auto Auto Auto object to operate on

Return type

void (empty response body)

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]