// tslint:disable /** * 3Di API * 3Di simulation API (latest stable version: v3) Framework release: 3.0.1 3Di core release: 2.3.0.dev0 deployed on: 10:42AM (UTC) on October 04, 2022 * * The version of the OpenAPI document: v3 * Contact: info@nelen-schuurmans.nl * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { exists, mapValues } from '../runtime'; /** * * @export * @interface PersonalAPIKey */ export interface PersonalAPIKey { /** * * @type {string} * @memberof PersonalAPIKey */ readonly prefix?: string; /** * A space-separated list of {endpoint|*}:{read|readwrite}. * @type {string} * @memberof PersonalAPIKey */ scope: string; /** * A free-form name for the API key. Need not be unique. 50 characters max. * @type {string} * @memberof PersonalAPIKey */ name: string; /** * Once API key expires, clients cannot use it anymore. * @type {Date} * @memberof PersonalAPIKey */ expiryDate?: Date | null; /** * * @type {Date} * @memberof PersonalAPIKey */ readonly created?: Date; /** * If the API key is revoked, clients cannot use it anymore. (This cannot be undone.) * @type {boolean} * @memberof PersonalAPIKey */ revoked?: boolean; /** * Last time the API key was used. * @type {Date} * @memberof PersonalAPIKey */ readonly lastUsed?: Date; } export function PersonalAPIKeyFromJSON(json: any): PersonalAPIKey { return { 'prefix': !exists(json, 'prefix') ? undefined : json['prefix'], 'scope': json['scope'], 'name': json['name'], 'expiryDate': !exists(json, 'expiry_date') ? undefined : new Date(json['expiry_date']), 'created': !exists(json, 'created') ? undefined : new Date(json['created']), 'revoked': !exists(json, 'revoked') ? undefined : json['revoked'], 'lastUsed': !exists(json, 'last_used') ? undefined : new Date(json['last_used']), }; } export function PersonalAPIKeyToJSON(value?: PersonalAPIKey): any { if (value === undefined) { return undefined; } return { 'scope': value.scope, 'name': value.name, 'expiry_date': value.expiryDate === undefined ? undefined : value.expiryDate.toISOString(), 'revoked': value.revoked, }; }