| GET,POST,PUT,OPTIONS | /v1/Equipment/{EquipmentID}/maintenance | ||
|---|---|---|---|
| PUT,OPTIONS | /v1/Equipment/{EquipmentID}/maintenance/{EquipmentMaintenanceID} |
"use strict";
export class EquipmentMaintenance {
/** @param {{EquipmentMaintenanceID?:number,EquipmentID?:number,Type?:string,ScheduledDate?:string,IntervalDays?:number,LastServiced?:string,Notes?:string,Status?:string,CreatedBy?:string,CreatedAt?:string,UpdatedAt?:string,NextDue?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
EquipmentMaintenanceID;
/** @type {number} */
EquipmentID;
/** @type {string} */
Type;
/** @type {?string} */
ScheduledDate;
/** @type {?number} */
IntervalDays;
/** @type {?string} */
LastServiced;
/** @type {string} */
Notes;
/** @type {string} */
Status;
/** @type {string} */
CreatedBy;
/** @type {?string} */
CreatedAt;
/** @type {?string} */
UpdatedAt;
/** @type {?string} */
NextDue;
}
export class EquipmentMaintenanceResponse {
/** @param {{ResponseStatus?:ResponseStatus,Maintenance?:EquipmentMaintenance[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {ResponseStatus} */
ResponseStatus;
/** @type {EquipmentMaintenance[]} */
Maintenance = [];
}
export class EquipmentMaintenanceRequest {
/** @param {{EquipmentID?:number,EquipmentMaintenanceID?:number,Maintenance?:EquipmentMaintenance[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
EquipmentID;
/** @type {number} */
EquipmentMaintenanceID;
/** @type {EquipmentMaintenance[]} */
Maintenance = [];
}
JavaScript EquipmentMaintenanceRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/Equipment/{EquipmentID}/maintenance HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
EquipmentID: 0,
EquipmentMaintenanceID: 0,
Maintenance:
[
{
EquipmentMaintenanceID: 0,
EquipmentID: 0,
Type: String,
ScheduledDate: 0001-01-01,
IntervalDays: 0,
LastServiced: 0001-01-01,
Notes: String,
Status: String,
CreatedBy: String,
CreatedAt: 0001-01-01,
UpdatedAt: 0001-01-01,
NextDue: 0001-01-01
}
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
Maintenance:
[
{
EquipmentMaintenanceID: 0,
EquipmentID: 0,
Type: String,
ScheduledDate: 0001-01-01,
IntervalDays: 0,
LastServiced: 0001-01-01,
Notes: String,
Status: String,
CreatedBy: String,
CreatedAt: 0001-01-01,
UpdatedAt: 0001-01-01,
NextDue: 0001-01-01
}
]
}