Booking Trait
API Service: BookingApi
The BookingApi defines an interface for interacting with bookable resources, for example rooms. Bookings can be listed, edited, and created.
| Method | Request Type | Response Type | Description |
|---|---|---|---|
| ListBookings | ListBookingsRequest | ListBookingsResponse | list bookings for a given bookable |
| CheckInBooking | CheckInBookingRequest | CheckInBookingResponse | check in an existing booking |
| CheckOutBooking | CheckOutBookingRequest | CheckOutBookingResponse | check out an existing booking |
| CreateBooking | CreateBookingRequest | CreateBookingResponse | create a new booking |
| UpdateBooking | UpdateBookingRequest | UpdateBookingResponse | update an existing booking |
| PullBookings | ListBookingsRequest | PullBookingsResponse stream | request updates to booking changes for a given bookable |
Info Service: BookingInfo
Describes the capabilities of a specific named device with respect to this trait.
| Method | Request Type | Response Type | Description |
|---|---|---|---|
| DescribeBooking | DescribeBookingRequest | BookingSupport | Get information about how a named device implements Booking features |
Booking
| Field Name | Type | Description |
|---|---|---|
| bookable | string | The name of the bookable (e.g. the resource name) |
| id | string | the unique identifier for this booking |
| title | string | the title of this booking |
| owner_name | string | the name of the owner of this booking |
| booked | smartcore.types.time.Period | the time period this booking is for |
| check_in | smartcore.types.time.Period | The time period this booking was checked in for. If this is absent, then no check in or check out has happened If check_in.start_time is absent, no check in has happened If check_in.end_time is absent, no check out has happened |
| check_in_not_required | bool | If true, the booking does not require a check-in and one should not be expected. Defaults to false; check-in is required. |
BookingSupport
BookingSupport describes the capabilities of devices implementing this trait
| Field Name | Type | Description |
|---|---|---|
| resource_support | smartcore.types.ResourceSupport | How a named device supports read/write/pull apis |
| check_in_support | BookingSupport.CheckInSupport | is check in supported, and how |
| check_out_support | BookingSupport.CheckInSupport | is check out supported, and how |
| time_resolution | smartcore.types.time.Unit | the supported time resolution for date time fields and queries |
BookingSupport.CheckInSupport
| Name | Number | Description |
|---|---|---|
| CHECK_IN_SUPPORT_UNSPECIFIED | 0 | check in support is unknown |
| NO_SUPPORT | 1 | check in is not supported |
| STATE | 2 | check in is supported as a state, without an associated time |
| TIME | 3 | check in is supported with an associated time |
ListBookingsRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | The name of the bookable (e.g. the resource name) |
| booking_intersects | smartcore.types.time.Period | Specify the time period to return bookings for bookings are returned if they intersect this time period |
| read_mask | google.protobuf.FieldMask | The state fields to fetch |
| updates_only | bool | When true the device will only send changes to the resource value. The default behaviour is to send the current value immediately followed by any updates as they happen. |
ListBookingsResponse
| Field Name | Type | Description |
|---|---|---|
| bookings | repeated Booking | the list of bookings for the given request |
CheckInBookingRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | The name of the bookable (e.g. the resource name) |
| booking_id | string | Which booking to check in |
| time | google.protobuf.Timestamp | The time the booking was checked-in. If omitted the server time will be used. |
CheckInBookingResponse
No fields defined.
CheckOutBookingRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | The name of the bookable (e.g. the resource name) |
| booking_id | string | Which booking to check out |
| time | google.protobuf.Timestamp | The time the booking was checked-out. If omitted the server time will be used. |
CheckOutBookingResponse
No fields defined.
CreateBookingRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | The name of the bookable (e.g. the resource name) |
| booking | Booking | the booking to add, the id field should not be set |
CreateBookingResponse
| Field Name | Type | Description |
|---|---|---|
| booking_id | string | The created bookings' id |
UpdateBookingRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | The name of the bookable (e.g. the resource name) |
| booking | Booking | The new value of the booking to use, make sure id is set |
| update_mask | google.protobuf.FieldMask | Which fields in the booking to update, any unsupported fields will be ignored, check the return value |
UpdateBookingResponse
| Field Name | Type | Description |
|---|---|---|
| booking | Booking | The new value of the booking |
PullBookingsResponse
| Field Name | Type | Description |
|---|---|---|
| changes | repeated PullBookingsResponse.Change | the list of changes which have occurred |
PullBookingsResponse.Change
| Field Name | Type | Description |
|---|---|---|
| name | string | the name of the device that emitted this change |
| type | smartcore.types.ChangeType | the type of change (e.g. ADD, UPDATE, etc...) |
| new_value | Booking | the new value to use for ADD |
| old_value | Booking | the old value to use for UPDATE |
| change_time | google.protobuf.Timestamp | when the change occurred |
DescribeBookingRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | The name of the device |