Added scan (station) apis feature/67-scan_apis #80

Merged
niggl merged 51 commits from feature/67-scan_apis into dev 2021-01-08 19:18:42 +00:00
Showing only changes of commit c447114297 - Show all commits

View File

@ -0,0 +1,62 @@
import {
IsInt,
IsNotEmpty,
IsObject,
IsOptional,
IsString
} from "class-validator";
import { ScanStation } from '../entities/ScanStation';
import { ResponseTrack } from './ResponseTrack';
/**
* Defines the statsClient response.
*/
export class ResponseScanStation {
/**
* The client's id.
*/
@IsInt()
id: number;
/**
* The client's description.
*/
@IsString()
@IsOptional()
description?: string;
/**
* The client's api key.
* Only visible on creation or regeneration.
*/
@IsString()
@IsOptional()
key: string;
/**
* The client's api key prefix.
*/
@IsString()
@IsNotEmpty()
prefix: string;
@IsObject()
@IsNotEmpty()
track: ResponseTrack;
/**
* Creates a ResponseStatsClient object from a statsClient.
* @param client The statsClient the response shall be build for.
*/
public constructor(station: ScanStation) {
this.id = station.id;
this.description = station.description;
this.prefix = station.prefix;
this.key = "Only visible on creation.";
this.track = station.track;
}
}