Skip to content

Commit

Permalink
Adds time slots resource documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
coconutcraig committed Jan 14, 2019
1 parent 6c37e57 commit 80ec0d5
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,52 @@ class Settings {
}
```

### Time Slots

##### Methods

- `at(location: number)`

Set a filter which will tell the API to return time slots at the location matching the provided identifier.

- `between(start: string, end: string)`

Set a filter which will tell the API to return time slots between a given start and end date time string.

- `by(user: number)`

Set a filter which will tell the API to return time slots that are specifically for the user matching the provided identifier.

- `for(services: number | number[])`

Set a filter which will tell the API to return time slots that are specifically for the service(s) matching the provided identifier(s).

- `get()`

Send the API request using the pre-set filters.

##### Example

```javascript
import OpenApi from 'coconut-open-api-js';

class TimeSlots {
constructor() {
this.api = new OpenApi();
}

async get() {
return await this.api
.slots
.at(1)
.by(2)
.for(3)
.between('2019-01-01', '2019-01-14')
.get()
}
}
```

## Change log

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
Expand Down

0 comments on commit 80ec0d5

Please sign in to comment.