File tree 3 files changed +59
-0
lines changed
3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 6
6
- [ updateEvent] ( #updateevent )
7
7
- [ deleteEvent] ( #deleteevent )
8
8
- [ searchAvailableTimes] ( #searchavailabletimes )
9
+ - [ getFacilities] ( #getfacilities )
9
10
10
11
## Overview
11
12
@@ -228,3 +229,23 @@ See the example response in the `Reference`.
228
229
#### Reference
229
230
230
231
- https://developer.cybozu.io/hc/ja/articles/360018417771#step1
232
+
233
+ ### getFacilities
234
+
235
+ Get facilities by specifying conditions.
236
+
237
+ #### Parameters
238
+
239
+ | Name | Type | Required | Description |
240
+ | ------ | :----: | :------: | ------------------------------------------------------------------------------------------------------------------------------------------ |
241
+ | limit | number | | The number of facilities to retrieve.<br />Must be between ` 1 ` and ` 1000 ` .<br />If nothing is specified, it will default to ` 100 ` . |
242
+ | offset | Number | | The number of retrievals that will be skipped.<br />Must be between ` 0 ` and ` 2147483647 ` . If nothing is specified, it will default to ` 0 ` . |
243
+ | name | String | | The facility name. |
244
+
245
+ #### Returns
246
+
247
+ See the example response in the ` Reference ` .
248
+
249
+ #### Reference
250
+
251
+ - https://developer.cybozu.io/hc/ja/articles/360017764211#step1
Original file line number Diff line number Diff line change @@ -203,4 +203,22 @@ export class ScheduleClient {
203
203
const path = buildPath ( { endpointName : "schedule/searchAvailableTimes" } ) ;
204
204
return this . client . post ( path , params ) ;
205
205
}
206
+
207
+ public getFacilities ( params : {
208
+ limit ?: number ;
209
+ offset ?: number ;
210
+ name ?: string ;
211
+ } ) : Promise < {
212
+ facilities : Array < {
213
+ id : string ;
214
+ name : string ;
215
+ code : string ;
216
+ notes : string ;
217
+ facilityGroup : string ;
218
+ } > ;
219
+ hasNext : boolean ;
220
+ } > {
221
+ const path = buildPath ( { endpointName : "schedule/facilities" } ) ;
222
+ return this . client . get ( path , params ) ;
223
+ }
206
224
}
Original file line number Diff line number Diff line change @@ -284,4 +284,24 @@ describe("ScheduleClient", () => {
284
284
expect ( mockClient . getLogs ( ) [ 0 ] . params ) . toEqual ( params ) ;
285
285
} ) ;
286
286
} ) ;
287
+
288
+ describe ( "getFacilities" , ( ) => {
289
+ const params = {
290
+ limit : 100 ,
291
+ offset : 0 ,
292
+ name : "Facility" ,
293
+ } ;
294
+ beforeEach ( async ( ) => {
295
+ await scheduleClient . getFacilities ( params ) ;
296
+ } ) ;
297
+ it ( "should pass the path to the http client" , ( ) => {
298
+ expect ( mockClient . getLogs ( ) [ 0 ] . path ) . toBe ( "/api/v1/schedule/facilities" ) ;
299
+ } ) ;
300
+ it ( "should send a get request" , ( ) => {
301
+ expect ( mockClient . getLogs ( ) [ 0 ] . method ) . toBe ( "get" ) ;
302
+ } ) ;
303
+ it ( "should pass params as a param to the http client" , ( ) => {
304
+ expect ( mockClient . getLogs ( ) [ 0 ] . params ) . toEqual ( params ) ;
305
+ } ) ;
306
+ } ) ;
287
307
} ) ;
You can’t perform that action at this time.
0 commit comments