@ignos/api-client 20250806.0.12288 → 20250806.0.12310-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6890,8 +6890,6 @@ export interface IMachinesClient {
6890
6890
 
6891
6891
  getMachineErpData(id: number): Promise<MachineErpDataDto>;
6892
6892
 
6893
- getWorkOrderTimeline(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<WorkOrderDatapoint[]>;
6894
-
6895
6893
  getMachineUtilizationSummary(): Promise<UtilizationSummaryDto>;
6896
6894
 
6897
6895
  getCrossCompanyUtilizationSummary(): Promise<CrossCompanyUtilizationSummaryDto>;
@@ -7409,53 +7407,6 @@ export class MachinesClient extends AuthorizedApiBase implements IMachinesClient
7409
7407
  return Promise.resolve<MachineErpDataDto>(null as any);
7410
7408
  }
7411
7409
 
7412
- getWorkOrderTimeline(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<WorkOrderDatapoint[]> {
7413
- let url_ = this.baseUrl + "/machines/{id}/workorder/timeline?";
7414
- if (id === undefined || id === null)
7415
- throw new Error("The parameter 'id' must be defined.");
7416
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
7417
- if (startTime !== undefined && startTime !== null)
7418
- url_ += "startTime=" + encodeURIComponent(startTime ? "" + startTime.toISOString() : "") + "&";
7419
- if (endTime !== undefined && endTime !== null)
7420
- url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
7421
- url_ = url_.replace(/[?&]$/, "");
7422
-
7423
- let options_: RequestInit = {
7424
- method: "GET",
7425
- headers: {
7426
- "Accept": "application/json"
7427
- }
7428
- };
7429
-
7430
- return this.transformOptions(options_).then(transformedOptions_ => {
7431
- return this.http.fetch(url_, transformedOptions_);
7432
- }).then((_response: Response) => {
7433
- return this.processGetWorkOrderTimeline(_response);
7434
- });
7435
- }
7436
-
7437
- protected processGetWorkOrderTimeline(response: Response): Promise<WorkOrderDatapoint[]> {
7438
- const status = response.status;
7439
- let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
7440
- if (status === 200) {
7441
- return response.text().then((_responseText) => {
7442
- let result200: any = null;
7443
- let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
7444
- if (Array.isArray(resultData200)) {
7445
- result200 = [] as any;
7446
- for (let item of resultData200)
7447
- result200!.push(WorkOrderDatapoint.fromJS(item));
7448
- }
7449
- return result200;
7450
- });
7451
- } else if (status !== 200 && status !== 204) {
7452
- return response.text().then((_responseText) => {
7453
- return throwException("An unexpected server error occurred.", status, _responseText, _headers);
7454
- });
7455
- }
7456
- return Promise.resolve<WorkOrderDatapoint[]>(null as any);
7457
- }
7458
-
7459
7410
  getMachineUtilizationSummary(): Promise<UtilizationSummaryDto> {
7460
7411
  let url_ = this.baseUrl + "/machines/utilization/summary";
7461
7412
  url_ = url_.replace(/[?&]$/, "");
@@ -23232,6 +23183,18 @@ export interface IWorkordersClient {
23232
23183
  * Deleteds existing work order mappings.
23233
23184
  */
23234
23185
  deleteWorkOrderMappings(): Promise<void>;
23186
+
23187
+ getDiscussionMessages(id: string): Promise<WorkorderDiscussionMessageDto[]>;
23188
+
23189
+ addDiscussionMessage(id: string, request: AddDiscussionMessageRequest): Promise<WorkorderDiscussionMessageDto>;
23190
+
23191
+ updateMessage(id: string, messageId: string, content: string): Promise<FileResponse>;
23192
+
23193
+ deleteMessage(id: string, messageId: string): Promise<FileResponse>;
23194
+
23195
+ getLastRead(id: string, operationId: string | null | undefined, resourceId: string | null | undefined): Promise<WorkorderDiscussionReadStatusDto>;
23196
+
23197
+ setLastRead(id: string, request: SetDiscussionLastRead): Promise<void>;
23235
23198
  }
23236
23199
 
23237
23200
  export class WorkordersClient extends AuthorizedApiBase implements IWorkordersClient {
@@ -24311,6 +24274,270 @@ export class WorkordersClient extends AuthorizedApiBase implements IWorkordersCl
24311
24274
  }
24312
24275
  return Promise.resolve<void>(null as any);
24313
24276
  }
24277
+
24278
+ getDiscussionMessages(id: string): Promise<WorkorderDiscussionMessageDto[]> {
24279
+ let url_ = this.baseUrl + "/erp/workorders/{id}/discussion";
24280
+ if (id === undefined || id === null)
24281
+ throw new Error("The parameter 'id' must be defined.");
24282
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
24283
+ url_ = url_.replace(/[?&]$/, "");
24284
+
24285
+ let options_: RequestInit = {
24286
+ method: "GET",
24287
+ headers: {
24288
+ "Accept": "application/json"
24289
+ }
24290
+ };
24291
+
24292
+ return this.transformOptions(options_).then(transformedOptions_ => {
24293
+ return this.http.fetch(url_, transformedOptions_);
24294
+ }).then((_response: Response) => {
24295
+ return this.processGetDiscussionMessages(_response);
24296
+ });
24297
+ }
24298
+
24299
+ protected processGetDiscussionMessages(response: Response): Promise<WorkorderDiscussionMessageDto[]> {
24300
+ const status = response.status;
24301
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
24302
+ if (status === 200) {
24303
+ return response.text().then((_responseText) => {
24304
+ let result200: any = null;
24305
+ let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
24306
+ if (Array.isArray(resultData200)) {
24307
+ result200 = [] as any;
24308
+ for (let item of resultData200)
24309
+ result200!.push(WorkorderDiscussionMessageDto.fromJS(item));
24310
+ }
24311
+ return result200;
24312
+ });
24313
+ } else if (status !== 200 && status !== 204) {
24314
+ return response.text().then((_responseText) => {
24315
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
24316
+ });
24317
+ }
24318
+ return Promise.resolve<WorkorderDiscussionMessageDto[]>(null as any);
24319
+ }
24320
+
24321
+ addDiscussionMessage(id: string, request: AddDiscussionMessageRequest): Promise<WorkorderDiscussionMessageDto> {
24322
+ let url_ = this.baseUrl + "/erp/workorders/{id}/discussion";
24323
+ if (id === undefined || id === null)
24324
+ throw new Error("The parameter 'id' must be defined.");
24325
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
24326
+ url_ = url_.replace(/[?&]$/, "");
24327
+
24328
+ const content_ = JSON.stringify(request);
24329
+
24330
+ let options_: RequestInit = {
24331
+ body: content_,
24332
+ method: "POST",
24333
+ headers: {
24334
+ "Content-Type": "application/json",
24335
+ "Accept": "application/json"
24336
+ }
24337
+ };
24338
+
24339
+ return this.transformOptions(options_).then(transformedOptions_ => {
24340
+ return this.http.fetch(url_, transformedOptions_);
24341
+ }).then((_response: Response) => {
24342
+ return this.processAddDiscussionMessage(_response);
24343
+ });
24344
+ }
24345
+
24346
+ protected processAddDiscussionMessage(response: Response): Promise<WorkorderDiscussionMessageDto> {
24347
+ const status = response.status;
24348
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
24349
+ if (status === 201) {
24350
+ return response.text().then((_responseText) => {
24351
+ let result201: any = null;
24352
+ let resultData201 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
24353
+ result201 = WorkorderDiscussionMessageDto.fromJS(resultData201);
24354
+ return result201;
24355
+ });
24356
+ } else if (status !== 200 && status !== 204) {
24357
+ return response.text().then((_responseText) => {
24358
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
24359
+ });
24360
+ }
24361
+ return Promise.resolve<WorkorderDiscussionMessageDto>(null as any);
24362
+ }
24363
+
24364
+ updateMessage(id: string, messageId: string, content: string): Promise<FileResponse> {
24365
+ let url_ = this.baseUrl + "/erp/workorders/{id}/discussion/{messageId}";
24366
+ if (id === undefined || id === null)
24367
+ throw new Error("The parameter 'id' must be defined.");
24368
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
24369
+ if (messageId === undefined || messageId === null)
24370
+ throw new Error("The parameter 'messageId' must be defined.");
24371
+ url_ = url_.replace("{messageId}", encodeURIComponent("" + messageId));
24372
+ url_ = url_.replace(/[?&]$/, "");
24373
+
24374
+ const content_ = JSON.stringify(content);
24375
+
24376
+ let options_: RequestInit = {
24377
+ body: content_,
24378
+ method: "PUT",
24379
+ headers: {
24380
+ "Content-Type": "application/json",
24381
+ "Accept": "application/octet-stream"
24382
+ }
24383
+ };
24384
+
24385
+ return this.transformOptions(options_).then(transformedOptions_ => {
24386
+ return this.http.fetch(url_, transformedOptions_);
24387
+ }).then((_response: Response) => {
24388
+ return this.processUpdateMessage(_response);
24389
+ });
24390
+ }
24391
+
24392
+ protected processUpdateMessage(response: Response): Promise<FileResponse> {
24393
+ const status = response.status;
24394
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
24395
+ if (status === 200 || status === 206) {
24396
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
24397
+ let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
24398
+ let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
24399
+ if (fileName) {
24400
+ fileName = decodeURIComponent(fileName);
24401
+ } else {
24402
+ fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
24403
+ fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
24404
+ }
24405
+ return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
24406
+ } else if (status !== 200 && status !== 204) {
24407
+ return response.text().then((_responseText) => {
24408
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
24409
+ });
24410
+ }
24411
+ return Promise.resolve<FileResponse>(null as any);
24412
+ }
24413
+
24414
+ deleteMessage(id: string, messageId: string): Promise<FileResponse> {
24415
+ let url_ = this.baseUrl + "/erp/workorders/{id}/discussion/{messageId}";
24416
+ if (id === undefined || id === null)
24417
+ throw new Error("The parameter 'id' must be defined.");
24418
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
24419
+ if (messageId === undefined || messageId === null)
24420
+ throw new Error("The parameter 'messageId' must be defined.");
24421
+ url_ = url_.replace("{messageId}", encodeURIComponent("" + messageId));
24422
+ url_ = url_.replace(/[?&]$/, "");
24423
+
24424
+ let options_: RequestInit = {
24425
+ method: "DELETE",
24426
+ headers: {
24427
+ "Accept": "application/octet-stream"
24428
+ }
24429
+ };
24430
+
24431
+ return this.transformOptions(options_).then(transformedOptions_ => {
24432
+ return this.http.fetch(url_, transformedOptions_);
24433
+ }).then((_response: Response) => {
24434
+ return this.processDeleteMessage(_response);
24435
+ });
24436
+ }
24437
+
24438
+ protected processDeleteMessage(response: Response): Promise<FileResponse> {
24439
+ const status = response.status;
24440
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
24441
+ if (status === 200 || status === 206) {
24442
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
24443
+ let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
24444
+ let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
24445
+ if (fileName) {
24446
+ fileName = decodeURIComponent(fileName);
24447
+ } else {
24448
+ fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
24449
+ fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
24450
+ }
24451
+ return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
24452
+ } else if (status !== 200 && status !== 204) {
24453
+ return response.text().then((_responseText) => {
24454
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
24455
+ });
24456
+ }
24457
+ return Promise.resolve<FileResponse>(null as any);
24458
+ }
24459
+
24460
+ getLastRead(id: string, operationId: string | null | undefined, resourceId: string | null | undefined): Promise<WorkorderDiscussionReadStatusDto> {
24461
+ let url_ = this.baseUrl + "/erp/workorders/{id}/discussion/last-read?";
24462
+ if (id === undefined || id === null)
24463
+ throw new Error("The parameter 'id' must be defined.");
24464
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
24465
+ if (operationId !== undefined && operationId !== null)
24466
+ url_ += "operationId=" + encodeURIComponent("" + operationId) + "&";
24467
+ if (resourceId !== undefined && resourceId !== null)
24468
+ url_ += "resourceId=" + encodeURIComponent("" + resourceId) + "&";
24469
+ url_ = url_.replace(/[?&]$/, "");
24470
+
24471
+ let options_: RequestInit = {
24472
+ method: "GET",
24473
+ headers: {
24474
+ "Accept": "application/json"
24475
+ }
24476
+ };
24477
+
24478
+ return this.transformOptions(options_).then(transformedOptions_ => {
24479
+ return this.http.fetch(url_, transformedOptions_);
24480
+ }).then((_response: Response) => {
24481
+ return this.processGetLastRead(_response);
24482
+ });
24483
+ }
24484
+
24485
+ protected processGetLastRead(response: Response): Promise<WorkorderDiscussionReadStatusDto> {
24486
+ const status = response.status;
24487
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
24488
+ if (status === 200) {
24489
+ return response.text().then((_responseText) => {
24490
+ let result200: any = null;
24491
+ let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
24492
+ result200 = WorkorderDiscussionReadStatusDto.fromJS(resultData200);
24493
+ return result200;
24494
+ });
24495
+ } else if (status !== 200 && status !== 204) {
24496
+ return response.text().then((_responseText) => {
24497
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
24498
+ });
24499
+ }
24500
+ return Promise.resolve<WorkorderDiscussionReadStatusDto>(null as any);
24501
+ }
24502
+
24503
+ setLastRead(id: string, request: SetDiscussionLastRead): Promise<void> {
24504
+ let url_ = this.baseUrl + "/erp/workorders/{id}/discussion/last-read";
24505
+ if (id === undefined || id === null)
24506
+ throw new Error("The parameter 'id' must be defined.");
24507
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
24508
+ url_ = url_.replace(/[?&]$/, "");
24509
+
24510
+ const content_ = JSON.stringify(request);
24511
+
24512
+ let options_: RequestInit = {
24513
+ body: content_,
24514
+ method: "POST",
24515
+ headers: {
24516
+ "Content-Type": "application/json",
24517
+ }
24518
+ };
24519
+
24520
+ return this.transformOptions(options_).then(transformedOptions_ => {
24521
+ return this.http.fetch(url_, transformedOptions_);
24522
+ }).then((_response: Response) => {
24523
+ return this.processSetLastRead(_response);
24524
+ });
24525
+ }
24526
+
24527
+ protected processSetLastRead(response: Response): Promise<void> {
24528
+ const status = response.status;
24529
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
24530
+ if (status === 204) {
24531
+ return response.text().then((_responseText) => {
24532
+ return;
24533
+ });
24534
+ } else if (status !== 200 && status !== 204) {
24535
+ return response.text().then((_responseText) => {
24536
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
24537
+ });
24538
+ }
24539
+ return Promise.resolve<void>(null as any);
24540
+ }
24314
24541
  }
24315
24542
 
24316
24543
  export class AzureRegionDto implements IAzureRegionDto {
@@ -35481,78 +35708,6 @@ export interface IWorkOrderProjectDto {
35481
35708
  projectManager?: string | null;
35482
35709
  }
35483
35710
 
35484
- export class WorkOrderDatapoint implements IWorkOrderDatapoint {
35485
- workOrder!: string;
35486
- id!: number;
35487
- externalId!: string;
35488
- subType?: string | null;
35489
- startTime!: number;
35490
- endTime?: number | null;
35491
- metaData?: { [key: string]: string; } | null;
35492
-
35493
- constructor(data?: IWorkOrderDatapoint) {
35494
- if (data) {
35495
- for (var property in data) {
35496
- if (data.hasOwnProperty(property))
35497
- (<any>this)[property] = (<any>data)[property];
35498
- }
35499
- }
35500
- }
35501
-
35502
- init(_data?: any) {
35503
- if (_data) {
35504
- this.workOrder = _data["workOrder"];
35505
- this.id = _data["id"];
35506
- this.externalId = _data["externalId"];
35507
- this.subType = _data["subType"];
35508
- this.startTime = _data["startTime"];
35509
- this.endTime = _data["endTime"];
35510
- if (_data["metaData"]) {
35511
- this.metaData = {} as any;
35512
- for (let key in _data["metaData"]) {
35513
- if (_data["metaData"].hasOwnProperty(key))
35514
- (<any>this.metaData)![key] = _data["metaData"][key];
35515
- }
35516
- }
35517
- }
35518
- }
35519
-
35520
- static fromJS(data: any): WorkOrderDatapoint {
35521
- data = typeof data === 'object' ? data : {};
35522
- let result = new WorkOrderDatapoint();
35523
- result.init(data);
35524
- return result;
35525
- }
35526
-
35527
- toJSON(data?: any) {
35528
- data = typeof data === 'object' ? data : {};
35529
- data["workOrder"] = this.workOrder;
35530
- data["id"] = this.id;
35531
- data["externalId"] = this.externalId;
35532
- data["subType"] = this.subType;
35533
- data["startTime"] = this.startTime;
35534
- data["endTime"] = this.endTime;
35535
- if (this.metaData) {
35536
- data["metaData"] = {};
35537
- for (let key in this.metaData) {
35538
- if (this.metaData.hasOwnProperty(key))
35539
- (<any>data["metaData"])[key] = (<any>this.metaData)[key];
35540
- }
35541
- }
35542
- return data;
35543
- }
35544
- }
35545
-
35546
- export interface IWorkOrderDatapoint {
35547
- workOrder: string;
35548
- id: number;
35549
- externalId: string;
35550
- subType?: string | null;
35551
- startTime: number;
35552
- endTime?: number | null;
35553
- metaData?: { [key: string]: string; } | null;
35554
- }
35555
-
35556
35711
  export class UtilizationSummaryDto implements IUtilizationSummaryDto {
35557
35712
  factory!: FactoryUtilizationDto;
35558
35713
  groups!: MachineGroupUtilizationDto[];
@@ -59967,6 +60122,238 @@ export interface ICreateWorkOrderMapping {
59967
60122
  newWorkOrderId: string;
59968
60123
  }
59969
60124
 
60125
+ export class WorkorderDiscussionMessageDto implements IWorkorderDiscussionMessageDto {
60126
+ id?: string;
60127
+ workorderId?: string;
60128
+ companyId?: string;
60129
+ content?: string;
60130
+ senderUpn?: string;
60131
+ senderName?: string;
60132
+ operationId?: string | null;
60133
+ operationName?: string | null;
60134
+ resourceId?: string | null;
60135
+ created?: Date;
60136
+
60137
+ constructor(data?: IWorkorderDiscussionMessageDto) {
60138
+ if (data) {
60139
+ for (var property in data) {
60140
+ if (data.hasOwnProperty(property))
60141
+ (<any>this)[property] = (<any>data)[property];
60142
+ }
60143
+ }
60144
+ }
60145
+
60146
+ init(_data?: any) {
60147
+ if (_data) {
60148
+ this.id = _data["id"];
60149
+ this.workorderId = _data["workorderId"];
60150
+ this.companyId = _data["companyId"];
60151
+ this.content = _data["content"];
60152
+ this.senderUpn = _data["senderUpn"];
60153
+ this.senderName = _data["senderName"];
60154
+ this.operationId = _data["operationId"];
60155
+ this.operationName = _data["operationName"];
60156
+ this.resourceId = _data["resourceId"];
60157
+ this.created = _data["created"] ? new Date(_data["created"].toString()) : <any>undefined;
60158
+ }
60159
+ }
60160
+
60161
+ static fromJS(data: any): WorkorderDiscussionMessageDto {
60162
+ data = typeof data === 'object' ? data : {};
60163
+ let result = new WorkorderDiscussionMessageDto();
60164
+ result.init(data);
60165
+ return result;
60166
+ }
60167
+
60168
+ toJSON(data?: any) {
60169
+ data = typeof data === 'object' ? data : {};
60170
+ data["id"] = this.id;
60171
+ data["workorderId"] = this.workorderId;
60172
+ data["companyId"] = this.companyId;
60173
+ data["content"] = this.content;
60174
+ data["senderUpn"] = this.senderUpn;
60175
+ data["senderName"] = this.senderName;
60176
+ data["operationId"] = this.operationId;
60177
+ data["operationName"] = this.operationName;
60178
+ data["resourceId"] = this.resourceId;
60179
+ data["created"] = this.created ? this.created.toISOString() : <any>undefined;
60180
+ return data;
60181
+ }
60182
+ }
60183
+
60184
+ export interface IWorkorderDiscussionMessageDto {
60185
+ id?: string;
60186
+ workorderId?: string;
60187
+ companyId?: string;
60188
+ content?: string;
60189
+ senderUpn?: string;
60190
+ senderName?: string;
60191
+ operationId?: string | null;
60192
+ operationName?: string | null;
60193
+ resourceId?: string | null;
60194
+ created?: Date;
60195
+ }
60196
+
60197
+ export class AddDiscussionMessageRequest implements IAddDiscussionMessageRequest {
60198
+ companyId?: string;
60199
+ message?: string;
60200
+ senderUpn?: string;
60201
+ senderName?: string;
60202
+ operationId?: string | null;
60203
+ operationName?: string | null;
60204
+ resourceId?: string | null;
60205
+
60206
+ constructor(data?: IAddDiscussionMessageRequest) {
60207
+ if (data) {
60208
+ for (var property in data) {
60209
+ if (data.hasOwnProperty(property))
60210
+ (<any>this)[property] = (<any>data)[property];
60211
+ }
60212
+ }
60213
+ }
60214
+
60215
+ init(_data?: any) {
60216
+ if (_data) {
60217
+ this.companyId = _data["companyId"];
60218
+ this.message = _data["message"];
60219
+ this.senderUpn = _data["senderUpn"];
60220
+ this.senderName = _data["senderName"];
60221
+ this.operationId = _data["operationId"];
60222
+ this.operationName = _data["operationName"];
60223
+ this.resourceId = _data["resourceId"];
60224
+ }
60225
+ }
60226
+
60227
+ static fromJS(data: any): AddDiscussionMessageRequest {
60228
+ data = typeof data === 'object' ? data : {};
60229
+ let result = new AddDiscussionMessageRequest();
60230
+ result.init(data);
60231
+ return result;
60232
+ }
60233
+
60234
+ toJSON(data?: any) {
60235
+ data = typeof data === 'object' ? data : {};
60236
+ data["companyId"] = this.companyId;
60237
+ data["message"] = this.message;
60238
+ data["senderUpn"] = this.senderUpn;
60239
+ data["senderName"] = this.senderName;
60240
+ data["operationId"] = this.operationId;
60241
+ data["operationName"] = this.operationName;
60242
+ data["resourceId"] = this.resourceId;
60243
+ return data;
60244
+ }
60245
+ }
60246
+
60247
+ export interface IAddDiscussionMessageRequest {
60248
+ companyId?: string;
60249
+ message?: string;
60250
+ senderUpn?: string;
60251
+ senderName?: string;
60252
+ operationId?: string | null;
60253
+ operationName?: string | null;
60254
+ resourceId?: string | null;
60255
+ }
60256
+
60257
+ export class WorkorderDiscussionReadStatusDto implements IWorkorderDiscussionReadStatusDto {
60258
+ workorderId?: string;
60259
+ operationId?: string | null;
60260
+ resourceId?: string | null;
60261
+ userUpn?: string;
60262
+ lastRead?: Date;
60263
+
60264
+ constructor(data?: IWorkorderDiscussionReadStatusDto) {
60265
+ if (data) {
60266
+ for (var property in data) {
60267
+ if (data.hasOwnProperty(property))
60268
+ (<any>this)[property] = (<any>data)[property];
60269
+ }
60270
+ }
60271
+ }
60272
+
60273
+ init(_data?: any) {
60274
+ if (_data) {
60275
+ this.workorderId = _data["workorderId"];
60276
+ this.operationId = _data["operationId"];
60277
+ this.resourceId = _data["resourceId"];
60278
+ this.userUpn = _data["userUpn"];
60279
+ this.lastRead = _data["lastRead"] ? new Date(_data["lastRead"].toString()) : <any>undefined;
60280
+ }
60281
+ }
60282
+
60283
+ static fromJS(data: any): WorkorderDiscussionReadStatusDto {
60284
+ data = typeof data === 'object' ? data : {};
60285
+ let result = new WorkorderDiscussionReadStatusDto();
60286
+ result.init(data);
60287
+ return result;
60288
+ }
60289
+
60290
+ toJSON(data?: any) {
60291
+ data = typeof data === 'object' ? data : {};
60292
+ data["workorderId"] = this.workorderId;
60293
+ data["operationId"] = this.operationId;
60294
+ data["resourceId"] = this.resourceId;
60295
+ data["userUpn"] = this.userUpn;
60296
+ data["lastRead"] = this.lastRead ? this.lastRead.toISOString() : <any>undefined;
60297
+ return data;
60298
+ }
60299
+ }
60300
+
60301
+ export interface IWorkorderDiscussionReadStatusDto {
60302
+ workorderId?: string;
60303
+ operationId?: string | null;
60304
+ resourceId?: string | null;
60305
+ userUpn?: string;
60306
+ lastRead?: Date;
60307
+ }
60308
+
60309
+ export class SetDiscussionLastRead implements ISetDiscussionLastRead {
60310
+ workorderId?: string;
60311
+ operationId?: string | null;
60312
+ resourceId?: string | null;
60313
+ userUpn?: string;
60314
+
60315
+ constructor(data?: ISetDiscussionLastRead) {
60316
+ if (data) {
60317
+ for (var property in data) {
60318
+ if (data.hasOwnProperty(property))
60319
+ (<any>this)[property] = (<any>data)[property];
60320
+ }
60321
+ }
60322
+ }
60323
+
60324
+ init(_data?: any) {
60325
+ if (_data) {
60326
+ this.workorderId = _data["workorderId"];
60327
+ this.operationId = _data["operationId"];
60328
+ this.resourceId = _data["resourceId"];
60329
+ this.userUpn = _data["userUpn"];
60330
+ }
60331
+ }
60332
+
60333
+ static fromJS(data: any): SetDiscussionLastRead {
60334
+ data = typeof data === 'object' ? data : {};
60335
+ let result = new SetDiscussionLastRead();
60336
+ result.init(data);
60337
+ return result;
60338
+ }
60339
+
60340
+ toJSON(data?: any) {
60341
+ data = typeof data === 'object' ? data : {};
60342
+ data["workorderId"] = this.workorderId;
60343
+ data["operationId"] = this.operationId;
60344
+ data["resourceId"] = this.resourceId;
60345
+ data["userUpn"] = this.userUpn;
60346
+ return data;
60347
+ }
60348
+ }
60349
+
60350
+ export interface ISetDiscussionLastRead {
60351
+ workorderId?: string;
60352
+ operationId?: string | null;
60353
+ resourceId?: string | null;
60354
+ userUpn?: string;
60355
+ }
60356
+
59970
60357
  function formatDate(d: Date) {
59971
60358
  return d.getFullYear() + '-' +
59972
60359
  (d.getMonth() < 9 ? ('0' + (d.getMonth()+1)) : (d.getMonth()+1)) + '-' +