File tree Expand file tree Collapse file tree 5 files changed +24
-3
lines changed Expand file tree Collapse file tree 5 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -1671,6 +1671,11 @@ class VehiclesService extends BaseService {
1671
1671
resp . data = hydrator . hydrateResponse ( resp . data , resp . included ) ;
1672
1672
return resp ;
1673
1673
}
1674
+ async patchEquipment ( equipmentItems ) {
1675
+ const jsonApiSerializer = new JsonApiSerializer ( this . hydrator . getModelMap ( ) ) ;
1676
+ const payload = jsonApiSerializer . buildRelationshipPayload ( new Equipment , equipmentItems ) ;
1677
+ return await this . client . makePatchRequest ( `${ this . endpoint } /relationships/equipment` , payload ) ;
1678
+ }
1674
1679
async patchAssignee ( user ) {
1675
1680
const jsonApiSerializer = new JsonApiSerializer ( this . hydrator . getModelMap ( ) ) ;
1676
1681
const payload = jsonApiSerializer . buildRelationshipPayload ( new User , user ) ;
Original file line number Diff line number Diff line change @@ -4,9 +4,11 @@ import { Vehicle } from "../models/Vehicle";
4
4
import { User } from "../models/User" ;
5
5
import type { InternalResponse } from '../types/Response' ;
6
6
import type { MotRecord } from "../models/MotRecord" ;
7
+ import { Equipment } from "../models/Equipment" ;
7
8
export declare class VehiclesService extends BaseService < Vehicle > {
8
9
constructor ( client : Client , vehicleId ?: string ) ;
9
10
enquiry ( registration : string ) : Promise < InternalResponse < any [ ] > > ;
10
11
motRecords ( vehicleId : string ) : Promise < InternalResponse < MotRecord [ ] > > ;
12
+ patchEquipment ( equipmentItems : Array < Equipment > ) : Promise < any > ;
11
13
patchAssignee ( user : User ) : Promise < any > ;
12
14
}
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ import { BaseService } from "./BaseService";
3
3
import { Vehicle } from "../models/Vehicle" ;
4
4
import { User } from "../models/User" ;
5
5
import { Hydrator } from "../utils/Hydrator" ;
6
- import { JsonApiSerializer } from '../utils/JsonSerializer' ;
6
+ import { Equipment } from "../models/Equipment" ;
7
+ import { JsonApiSerializer } from "../utils/JsonSerializer" ;
7
8
export class VehiclesService extends BaseService {
8
9
constructor ( client , vehicleId ) {
9
10
const endpoint = vehicleId ? `/v3/orgs/:orgId/assets/vehicles/${ vehicleId } ` : `/v3/orgs/:orgId/assets/vehicles` ;
@@ -28,6 +29,11 @@ export class VehiclesService extends BaseService {
28
29
resp . data = hydrator . hydrateResponse ( resp . data , resp . included ) ;
29
30
return resp ;
30
31
}
32
+ async patchEquipment ( equipmentItems ) {
33
+ const jsonApiSerializer = new JsonApiSerializer ( this . hydrator . getModelMap ( ) ) ;
34
+ const payload = jsonApiSerializer . buildRelationshipPayload ( new Equipment , equipmentItems ) ;
35
+ return await this . client . makePatchRequest ( `${ this . endpoint } /relationships/equipment` , payload ) ;
36
+ }
31
37
async patchAssignee ( user ) {
32
38
const jsonApiSerializer = new JsonApiSerializer ( this . hydrator . getModelMap ( ) ) ;
33
39
const payload = jsonApiSerializer . buildRelationshipPayload ( new User , user ) ;
Original file line number Diff line number Diff line change 4
4
"type" : " git" ,
5
5
"url" : " https://github.com/ctrl-hub/sdk.ts"
6
6
},
7
- "version" : " 0.1.129 " ,
7
+ "version" : " 0.1.130 " ,
8
8
"main" : " dist/index.js" ,
9
9
"types" : " dist/index.d.ts" ,
10
10
"type" : " module" ,
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ import {User} from "../models/User";
5
5
import type { InternalResponse } from '../types/Response' ;
6
6
import { Hydrator } from "@utils/Hydrator" ;
7
7
import type { MotRecord } from "@models/MotRecord" ;
8
- import { JsonApiSerializer } from '@utils/JsonSerializer' ;
8
+ import { Equipment } from "@models/Equipment" ;
9
+ import { JsonApiSerializer } from "@utils/JsonSerializer" ;
9
10
10
11
export class VehiclesService extends BaseService < Vehicle > {
11
12
constructor ( client : Client , vehicleId ?: string ) {
@@ -38,6 +39,13 @@ export class VehiclesService extends BaseService<Vehicle> {
38
39
return resp ;
39
40
}
40
41
42
+ public async patchEquipment ( equipmentItems : Array < Equipment > ) {
43
+ const jsonApiSerializer = new JsonApiSerializer ( this . hydrator . getModelMap ( ) ) ;
44
+ const payload = jsonApiSerializer . buildRelationshipPayload ( new Equipment , equipmentItems ) ;
45
+ return await this . client . makePatchRequest ( `${ this . endpoint } /relationships/equipment` , payload ) ;
46
+ }
47
+
48
+
41
49
public async patchAssignee ( user : User ) {
42
50
const jsonApiSerializer = new JsonApiSerializer ( this . hydrator . getModelMap ( ) ) ;
43
51
const payload = jsonApiSerializer . buildRelationshipPayload ( new User , user ) ;
You can’t perform that action at this time.
0 commit comments