Skip to content

Commit

Permalink
Automatic synchronisation from developer.myptv.com
Browse files Browse the repository at this point in the history
  • Loading branch information
MachineUserPTV committed Nov 28, 2024
1 parent 024014c commit 4859ae6
Show file tree
Hide file tree
Showing 26 changed files with 886 additions and 561 deletions.
53 changes: 30 additions & 23 deletions typescript/apis/PositionsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Map Matching
* With the Map Matching service you can assign GPS positions to road segments on a digital map.
*
* The version of the OpenAPI document: 1.6
* The version of the OpenAPI document: 1.7
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -14,20 +14,22 @@


import * as runtime from '../runtime';
import type {
CalculationMode,
ErrorResponse,
MatchedPosition,
PositionsResultType,
} from '../models/index';
import {
CalculationMode,
CalculationModeFromJSON,
CalculationModeToJSON,
ErrorResponse,
ErrorResponseFromJSON,
ErrorResponseToJSON,
MatchedPosition,
MatchedPositionFromJSON,
MatchedPositionToJSON,
PositionsResultType,
PositionsResultTypeFromJSON,
PositionsResultTypeToJSON,
} from '../models';
} from '../models/index';

export interface MatchPositionRequest {
latitude: number;
Expand All @@ -46,42 +48,47 @@ export class PositionsApi extends runtime.BaseAPI {
/**
* Matches a single unrelated position on a map.
*/
async matchPositionRaw(requestParameters: MatchPositionRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<MatchedPosition>> {
if (requestParameters.latitude === null || requestParameters.latitude === undefined) {
throw new runtime.RequiredError('latitude','Required parameter requestParameters.latitude was null or undefined when calling matchPosition.');
async matchPositionRaw(requestParameters: MatchPositionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MatchedPosition>> {
if (requestParameters['latitude'] == null) {
throw new runtime.RequiredError(
'latitude',
'Required parameter "latitude" was null or undefined when calling matchPosition().'
);
}

if (requestParameters.longitude === null || requestParameters.longitude === undefined) {
throw new runtime.RequiredError('longitude','Required parameter requestParameters.longitude was null or undefined when calling matchPosition.');
if (requestParameters['longitude'] == null) {
throw new runtime.RequiredError(
'longitude',
'Required parameter "longitude" was null or undefined when calling matchPosition().'
);
}

const queryParameters: any = {};

if (requestParameters.heading !== undefined) {
queryParameters['heading'] = requestParameters.heading;
if (requestParameters['heading'] != null) {
queryParameters['heading'] = requestParameters['heading'];
}

if (requestParameters.calculationMode !== undefined) {
queryParameters['calculationMode'] = requestParameters.calculationMode;
if (requestParameters['calculationMode'] != null) {
queryParameters['calculationMode'] = requestParameters['calculationMode'];
}

if (requestParameters.results) {
queryParameters['results'] = requestParameters.results.join(runtime.COLLECTION_FORMATS["csv"]);
if (requestParameters['results'] != null) {
queryParameters['results'] = requestParameters['results']!.join(runtime.COLLECTION_FORMATS["csv"]);
}

if (requestParameters.language !== undefined) {
queryParameters['language'] = requestParameters.language;
if (requestParameters['language'] != null) {
queryParameters['language'] = requestParameters['language'];
}

const headerParameters: runtime.HTTPHeaders = {};
headerParameters['User-Agent'] = "ptv-generated typescript client";

if (this.configuration && this.configuration.apiKey) {
headerParameters["apiKey"] = this.configuration.apiKey("apiKey"); // apiKeyAuth authentication
headerParameters["apiKey"] = await this.configuration.apiKey("apiKey"); // apiKeyAuth authentication
}

const response = await this.request({
path: `/positions/{latitude}/{longitude}`.replace(`{${"latitude"}}`, encodeURIComponent(String(requestParameters.latitude))).replace(`{${"longitude"}}`, encodeURIComponent(String(requestParameters.longitude))),
path: `/positions/{latitude}/{longitude}`.replace(`{${"latitude"}}`, encodeURIComponent(String(requestParameters['latitude']))).replace(`{${"longitude"}}`, encodeURIComponent(String(requestParameters['longitude']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
Expand All @@ -93,7 +100,7 @@ export class PositionsApi extends runtime.BaseAPI {
/**
* Matches a single unrelated position on a map.
*/
async matchPosition(requestParameters: MatchPositionRequest, initOverrides?: RequestInit): Promise<MatchedPosition> {
async matchPosition(requestParameters: MatchPositionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MatchedPosition> {
const response = await this.matchPositionRaw(requestParameters, initOverrides);
return await response.value();
}
Expand Down
74 changes: 41 additions & 33 deletions typescript/apis/TracksApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Map Matching
* With the Map Matching service you can assign GPS positions to road segments on a digital map.
*
* The version of the OpenAPI document: 1.6
* The version of the OpenAPI document: 1.7
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -14,26 +14,28 @@


import * as runtime from '../runtime';
import type {
CalculationMode,
ErrorResponse,
MatchedTrackIdentifier,
MatchedTrackResultType,
MatchingResponse,
Track,
} from '../models/index';
import {
CalculationMode,
CalculationModeFromJSON,
CalculationModeToJSON,
ErrorResponse,
ErrorResponseFromJSON,
ErrorResponseToJSON,
MatchedTrackIdentifier,
MatchedTrackIdentifierFromJSON,
MatchedTrackIdentifierToJSON,
MatchedTrackResultType,
MatchedTrackResultTypeFromJSON,
MatchedTrackResultTypeToJSON,
MatchingResponse,
MatchingResponseFromJSON,
MatchingResponseToJSON,
Track,
TrackFromJSON,
TrackToJSON,
} from '../models';
} from '../models/index';

export interface CreateMatchedTrackRequest {
track: Track;
Expand All @@ -57,32 +59,34 @@ export class TracksApi extends runtime.BaseAPI {
/**
* Creates a complete track by triggering a matching calculation for it.
*/
async createMatchedTrackRaw(requestParameters: CreateMatchedTrackRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<MatchedTrackIdentifier>> {
if (requestParameters.track === null || requestParameters.track === undefined) {
throw new runtime.RequiredError('track','Required parameter requestParameters.track was null or undefined when calling createMatchedTrack.');
async createMatchedTrackRaw(requestParameters: CreateMatchedTrackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MatchedTrackIdentifier>> {
if (requestParameters['track'] == null) {
throw new runtime.RequiredError(
'track',
'Required parameter "track" was null or undefined when calling createMatchedTrack().'
);
}

const queryParameters: any = {};

if (requestParameters.calculationMode !== undefined) {
queryParameters['calculationMode'] = requestParameters.calculationMode;
if (requestParameters['calculationMode'] != null) {
queryParameters['calculationMode'] = requestParameters['calculationMode'];
}

const headerParameters: runtime.HTTPHeaders = {};
headerParameters['User-Agent'] = "ptv-generated typescript client";

headerParameters['Content-Type'] = 'application/json';

if (this.configuration && this.configuration.apiKey) {
headerParameters["apiKey"] = this.configuration.apiKey("apiKey"); // apiKeyAuth authentication
headerParameters["apiKey"] = await this.configuration.apiKey("apiKey"); // apiKeyAuth authentication
}

const response = await this.request({
path: `/tracks`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: TrackToJSON(requestParameters.track),
body: TrackToJSON(requestParameters['track']),
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => MatchedTrackIdentifierFromJSON(jsonValue));
Expand All @@ -91,30 +95,32 @@ export class TracksApi extends runtime.BaseAPI {
/**
* Creates a complete track by triggering a matching calculation for it.
*/
async createMatchedTrack(requestParameters: CreateMatchedTrackRequest, initOverrides?: RequestInit): Promise<MatchedTrackIdentifier> {
async createMatchedTrack(requestParameters: CreateMatchedTrackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MatchedTrackIdentifier> {
const response = await this.createMatchedTrackRaw(requestParameters, initOverrides);
return await response.value();
}

/**
* Deletes a matched track specified by its ID.
*/
async deleteMatchedTrackRaw(requestParameters: DeleteMatchedTrackRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<void>> {
if (requestParameters.id === null || requestParameters.id === undefined) {
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteMatchedTrack.');
async deleteMatchedTrackRaw(requestParameters: DeleteMatchedTrackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError(
'id',
'Required parameter "id" was null or undefined when calling deleteMatchedTrack().'
);
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};
headerParameters['User-Agent'] = "ptv-generated typescript client";

if (this.configuration && this.configuration.apiKey) {
headerParameters["apiKey"] = this.configuration.apiKey("apiKey"); // apiKeyAuth authentication
headerParameters["apiKey"] = await this.configuration.apiKey("apiKey"); // apiKeyAuth authentication
}

const response = await this.request({
path: `/tracks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/tracks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
Expand All @@ -126,33 +132,35 @@ export class TracksApi extends runtime.BaseAPI {
/**
* Deletes a matched track specified by its ID.
*/
async deleteMatchedTrack(requestParameters: DeleteMatchedTrackRequest, initOverrides?: RequestInit): Promise<void> {
async deleteMatchedTrack(requestParameters: DeleteMatchedTrackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteMatchedTrackRaw(requestParameters, initOverrides);
}

/**
* Gets the results of a matching calculation specified by its ID.
*/
async getMatchedTrackRaw(requestParameters: GetMatchedTrackRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<MatchingResponse>> {
if (requestParameters.id === null || requestParameters.id === undefined) {
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getMatchedTrack.');
async getMatchedTrackRaw(requestParameters: GetMatchedTrackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MatchingResponse>> {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError(
'id',
'Required parameter "id" was null or undefined when calling getMatchedTrack().'
);
}

const queryParameters: any = {};

if (requestParameters.results) {
queryParameters['results'] = requestParameters.results.join(runtime.COLLECTION_FORMATS["csv"]);
if (requestParameters['results'] != null) {
queryParameters['results'] = requestParameters['results']!.join(runtime.COLLECTION_FORMATS["csv"]);
}

const headerParameters: runtime.HTTPHeaders = {};
headerParameters['User-Agent'] = "ptv-generated typescript client";

if (this.configuration && this.configuration.apiKey) {
headerParameters["apiKey"] = this.configuration.apiKey("apiKey"); // apiKeyAuth authentication
headerParameters["apiKey"] = await this.configuration.apiKey("apiKey"); // apiKeyAuth authentication
}

const response = await this.request({
path: `/tracks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/tracks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
Expand All @@ -164,7 +172,7 @@ export class TracksApi extends runtime.BaseAPI {
/**
* Gets the results of a matching calculation specified by its ID.
*/
async getMatchedTrack(requestParameters: GetMatchedTrackRequest, initOverrides?: RequestInit): Promise<MatchingResponse> {
async getMatchedTrack(requestParameters: GetMatchedTrackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MatchingResponse> {
const response = await this.getMatchedTrackRaw(requestParameters, initOverrides);
return await response.value();
}
Expand Down
4 changes: 2 additions & 2 deletions typescript/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
export * from './runtime';
export * from './apis';
export * from './models';
export * from './apis/index';
export * from './models/index';
25 changes: 19 additions & 6 deletions typescript/models/CalculationMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,39 @@
* Map Matching
* With the Map Matching service you can assign GPS positions to road segments on a digital map.
*
* The version of the OpenAPI document: 1.6
* The version of the OpenAPI document: 1.7
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


/**
* Enumeration to define the calculation behavior of the matching, i.e. if the focus of calculation is on performance, quality or both.
* * `PERFORMANCE` - The matching focuses on performance. This means to take into account a higher number of failed matches and in the case of track matching that the matched track may be split into several paths.
* * `STANDARD` - The matching chooses a standard trade-off between quality and performance.
* * `QUALITY` - The matching focuses on high solution quality. This means that as many as possible of the input positions are matched and taken into account. Though the processing time of the request can be high.
* @export
* @enum {string}
*/
export enum CalculationMode {
PERFORMANCE = 'PERFORMANCE',
STANDARD = 'STANDARD',
QUALITY = 'QUALITY'
export const CalculationMode = {
PERFORMANCE: 'PERFORMANCE',
STANDARD: 'STANDARD',
QUALITY: 'QUALITY'
} as const;
export type CalculationMode = typeof CalculationMode[keyof typeof CalculationMode];


export function instanceOfCalculationMode(value: any): boolean {
for (const key in CalculationMode) {
if (Object.prototype.hasOwnProperty.call(CalculationMode, key)) {
if (CalculationMode[key as keyof typeof CalculationMode] === value) {
return true;
}
}
}
return false;
}

export function CalculationModeFromJSON(json: any): CalculationMode {
Expand Down
Loading

0 comments on commit 4859ae6

Please sign in to comment.