UNPKG

@xompass/sdk-cloud-api

Version:

Xompass Client for cloud-api

81 lines (75 loc) 1.73 kB
import {ModelDefinition} from './BaseModels'; declare var Object: any; export interface RateLimitInterface { readLimit: number; writeLimit: number; timeIntervalS: number; enabled?: boolean; id?: any; } export class RateLimit implements RateLimitInterface { readLimit: number; writeLimit: number; timeIntervalS: number; enabled: boolean = true; id: any; constructor(data?: RateLimitInterface) { Object.assign(this, data); } /** * The name of the model represented by this $resource, * i.e. `RateLimit`. */ public static getModelName(): string { return 'RateLimit'; } /** * @method factory * @author Jonathan Casarrubias * @license MIT * This method creates an instance of RateLimit for dynamic purposes. */ public static factory(data: RateLimitInterface): RateLimit{ return new RateLimit(data); } /** * @method getModelDefinition * @author Julien Ledun * @license MIT * This method returns an object that represents some of the model * definitions. */ public static getModelDefinition(): ModelDefinition { return { name: 'RateLimit', plural: 'RateLimits', path: 'RateLimits', idName: 'id', properties: { readLimit: { name: 'readLimit', type: 'number' }, writeLimit: { name: 'writeLimit', type: 'number' }, timeIntervalS: { name: 'timeIntervalS', type: 'number' }, enabled: { name: 'enabled', type: 'boolean', default: true }, id: { name: 'id', type: 'any' }, }, relations: { } }; } }