Files
onspring-api-sdk-javascript/src/models/Field.ts
T

72 lines
1.8 KiB
TypeScript
Raw Normal View History

import { type FieldStatus } from '../enums/FieldStatus.js';
import { type FieldType } from '../enums/FieldType.js';
2023-02-02 21:37:40 -06:00
2023-02-02 22:52:14 -06:00
/**
* @class Field - Represents a Field.
*/
2023-02-02 21:37:40 -06:00
export class Field {
2023-02-02 22:52:14 -06:00
/**
* @property {number} id - The id of the Field.
*/
2023-02-02 21:37:40 -06:00
public id: number;
2023-02-02 22:52:14 -06:00
/**
* @property {number} appId - The id of the App that the Field belongs to.
*/
2023-02-02 21:37:40 -06:00
public appId: number;
2023-02-02 22:52:14 -06:00
/**
* @property {number} name - The name of the Field.
*/
2023-02-02 21:37:40 -06:00
public name: string;
2023-02-02 22:52:14 -06:00
/**
* @property {FieldType} type - The type of the Field.
*/
2023-02-02 21:37:40 -06:00
public type: FieldType;
2023-02-02 22:52:14 -06:00
/**
* @property {FieldStatus} status - The status of the Field.
*/
2023-02-02 21:37:40 -06:00
public status: FieldStatus;
2023-02-02 22:52:14 -06:00
/**
* @property {boolean} isRequired - Indicates whether or not the Field is required.
*/
2023-02-02 21:37:40 -06:00
public isRequired: boolean;
2023-02-02 22:52:14 -06:00
/**
* @property {boolean} isUnique - Indicates whether or not the Field is required to be unique.
*/
2023-02-02 21:37:40 -06:00
public isUnique: boolean;
2023-02-02 22:52:14 -06:00
/**
* @constructor - Creates a new Field.
* @param {number} id - The id of the Field.
* @param {number} appId - The id of the App that the Field belongs to.
* @param {string} name - The name of the Field.
* @param {FieldType} type - The type of the Field.
* @param {FieldStatus} status - The status of the Field.
2023-02-02 22:52:14 -06:00
* @param {boolean} isRequired - Indicates whether or not the Field is required.
* @param {boolean} isUnique - Indicates whether or not the Field is required to be unique.
* @returns {Field} - A new Field.
*/
2023-02-02 21:37:40 -06:00
public constructor(
id: number,
appId: number,
name: string,
type: FieldType,
status: FieldStatus,
2023-02-02 21:37:40 -06:00
isRequired: boolean,
isUnique: boolean
) {
this.id = id;
this.appId = appId;
this.name = name;
this.type = type;
this.status = status;
2023-02-02 21:37:40 -06:00
this.isRequired = isRequired;
this.isUnique = isUnique;
}
}