// 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 PersonalAPIKeyWithSecret */ export interface PersonalAPIKeyWithSecret { /** * * @type {string} * @memberof PersonalAPIKeyWithSecret */ readonly prefix?: string; /** * A space-separated list of {endpoint|*}:{read|readwrite}. * @type {string} * @memberof PersonalAPIKeyWithSecret */ scope: string; /** * A free-form name for the API key. Need not be unique. 50 characters max. * @type {string} * @memberof PersonalAPIKeyWithSecret */ name: string; /** * Once API key expires, clients cannot use it anymore. * @type {Date} * @memberof PersonalAPIKeyWithSecret */ expiryDate?: Date | null; /** * * @type {Date} * @memberof PersonalAPIKeyWithSecret */ readonly created?: Date; /** * If the API key is revoked, clients cannot use it anymore. (This cannot be undone.) * @type {boolean} * @memberof PersonalAPIKeyWithSecret */ revoked?: boolean; /** * Last time the API key was used. * @type {Date} * @memberof PersonalAPIKeyWithSecret */ readonly lastUsed?: Date; /** * The API key. Please store the key somewhere safe, you will not be able to see it again. * @type {string} * @memberof PersonalAPIKeyWithSecret */ readonly key?: string; /** * * @type {string} * @memberof PersonalAPIKeyWithSecret */ readonly message?: string; } export function PersonalAPIKeyWithSecretFromJSON(json: any): PersonalAPIKeyWithSecret { 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']), 'key': !exists(json, 'key') ? undefined : json['key'], 'message': !exists(json, 'message') ? undefined : json['message'], }; } export function PersonalAPIKeyWithSecretToJSON(value?: PersonalAPIKeyWithSecret): 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, }; }