|
| 1 | +# Bookings |
| 2 | + |
| 3 | +```python |
| 4 | +bookings_api = client.bookings |
| 5 | +``` |
| 6 | + |
| 7 | +## Class Name |
| 8 | + |
| 9 | +`BookingsApi` |
| 10 | + |
| 11 | +## Methods |
| 12 | + |
| 13 | +* [Create Booking](/doc/api/bookings.md#create-booking) |
| 14 | +* [Search Availability](/doc/api/bookings.md#search-availability) |
| 15 | +* [Retrieve Business Booking Profile](/doc/api/bookings.md#retrieve-business-booking-profile) |
| 16 | +* [List Team Member Booking Profiles](/doc/api/bookings.md#list-team-member-booking-profiles) |
| 17 | +* [Retrieve Team Member Booking Profile](/doc/api/bookings.md#retrieve-team-member-booking-profile) |
| 18 | +* [Retrieve Booking](/doc/api/bookings.md#retrieve-booking) |
| 19 | +* [Update Booking](/doc/api/bookings.md#update-booking) |
| 20 | + |
| 21 | + |
| 22 | +# Create Booking |
| 23 | + |
| 24 | +Creates a booking. |
| 25 | + |
| 26 | +```python |
| 27 | +def create_booking(self, |
| 28 | + body) |
| 29 | +``` |
| 30 | + |
| 31 | +## Parameters |
| 32 | + |
| 33 | +| Parameter | Type | Tags | Description | |
| 34 | +| --- | --- | --- | --- | |
| 35 | +| `body` | [`Create Booking Request`](/doc/models/create-booking-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. | |
| 36 | + |
| 37 | +## Response Type |
| 38 | + |
| 39 | +[`Create Booking Response`](/doc/models/create-booking-response.md) |
| 40 | + |
| 41 | +## Example Usage |
| 42 | + |
| 43 | +```python |
| 44 | +body = {} |
| 45 | +body['idempotency_key'] = 'idempotency_key2' |
| 46 | +body['booking'] = {} |
| 47 | +body['booking']['id'] = 'id8' |
| 48 | +body['booking']['version'] = 148 |
| 49 | +body['booking']['status'] = 'ACCEPTED' |
| 50 | +body['booking']['created_at'] = 'created_at6' |
| 51 | +body['booking']['updated_at'] = 'updated_at4' |
| 52 | + |
| 53 | +result = bookings_api.create_booking(body) |
| 54 | + |
| 55 | +if result.is_success(): |
| 56 | + print(result.body) |
| 57 | +elif result.is_error(): |
| 58 | + print(result.errors) |
| 59 | +``` |
| 60 | + |
| 61 | + |
| 62 | +# Search Availability |
| 63 | + |
| 64 | +Searches for availabilities for booking. |
| 65 | + |
| 66 | +```python |
| 67 | +def search_availability(self, |
| 68 | + body) |
| 69 | +``` |
| 70 | + |
| 71 | +## Parameters |
| 72 | + |
| 73 | +| Parameter | Type | Tags | Description | |
| 74 | +| --- | --- | --- | --- | |
| 75 | +| `body` | [`Search Availability Request`](/doc/models/search-availability-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. | |
| 76 | + |
| 77 | +## Response Type |
| 78 | + |
| 79 | +[`Search Availability Response`](/doc/models/search-availability-response.md) |
| 80 | + |
| 81 | +## Example Usage |
| 82 | + |
| 83 | +```python |
| 84 | +body = {} |
| 85 | +body['query'] = {} |
| 86 | +body['query']['filter'] = {} |
| 87 | +body['query']['filter']['start_at_range'] = {} |
| 88 | +body['query']['filter']['start_at_range']['start_at'] = 'start_at8' |
| 89 | +body['query']['filter']['start_at_range']['end_at'] = 'end_at4' |
| 90 | +body['query']['filter']['location_id'] = 'location_id6' |
| 91 | +body['query']['filter']['segment_filters'] = [] |
| 92 | + |
| 93 | +body['query']['filter']['segment_filters'].append({}) |
| 94 | +body['query']['filter']['segment_filters'][0]['service_variation_id'] = 'service_variation_id8' |
| 95 | +body['query']['filter']['segment_filters'][0]['team_member_id_filter'] = {} |
| 96 | +body['query']['filter']['segment_filters'][0]['team_member_id_filter']['all'] = ['all7'] |
| 97 | +body['query']['filter']['segment_filters'][0]['team_member_id_filter']['any'] = ['any0', 'any1'] |
| 98 | +body['query']['filter']['segment_filters'][0]['team_member_id_filter']['none'] = ['none5'] |
| 99 | + |
| 100 | +body['query']['filter']['segment_filters'].append({}) |
| 101 | +body['query']['filter']['segment_filters'][1]['service_variation_id'] = 'service_variation_id7' |
| 102 | +body['query']['filter']['segment_filters'][1]['team_member_id_filter'] = {} |
| 103 | +body['query']['filter']['segment_filters'][1]['team_member_id_filter']['all'] = ['all6', 'all7', 'all8'] |
| 104 | +body['query']['filter']['segment_filters'][1]['team_member_id_filter']['any'] = ['any1', 'any2', 'any3'] |
| 105 | +body['query']['filter']['segment_filters'][1]['team_member_id_filter']['none'] = ['none6', 'none7'] |
| 106 | + |
| 107 | +body['query']['filter']['booking_id'] = 'booking_id6' |
| 108 | + |
| 109 | +result = bookings_api.search_availability(body) |
| 110 | + |
| 111 | +if result.is_success(): |
| 112 | + print(result.body) |
| 113 | +elif result.is_error(): |
| 114 | + print(result.errors) |
| 115 | +``` |
| 116 | + |
| 117 | + |
| 118 | +# Retrieve Business Booking Profile |
| 119 | + |
| 120 | +Retrieves a seller's booking profile. |
| 121 | + |
| 122 | +```python |
| 123 | +def retrieve_business_booking_profile(self) |
| 124 | +``` |
| 125 | + |
| 126 | +## Response Type |
| 127 | + |
| 128 | +[`Retrieve Business Booking Profile Response`](/doc/models/retrieve-business-booking-profile-response.md) |
| 129 | + |
| 130 | +## Example Usage |
| 131 | + |
| 132 | +```python |
| 133 | +result = bookings_api.retrieve_business_booking_profile() |
| 134 | + |
| 135 | +if result.is_success(): |
| 136 | + print(result.body) |
| 137 | +elif result.is_error(): |
| 138 | + print(result.errors) |
| 139 | +``` |
| 140 | + |
| 141 | + |
| 142 | +# List Team Member Booking Profiles |
| 143 | + |
| 144 | +Lists booking profiles for team members. |
| 145 | + |
| 146 | +```python |
| 147 | +def list_team_member_booking_profiles(self, |
| 148 | + bookable_only=False, |
| 149 | + limit=None, |
| 150 | + cursor=None, |
| 151 | + location_id=None) |
| 152 | +``` |
| 153 | + |
| 154 | +## Parameters |
| 155 | + |
| 156 | +| Parameter | Type | Tags | Description | |
| 157 | +| --- | --- | --- | --- | |
| 158 | +| `bookable_only` | `bool` | Query, Optional | Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`). | |
| 159 | +| `limit` | `int` | Query, Optional | The maximum number of results to return. | |
| 160 | +| `cursor` | `string` | Query, Optional | The cursor for paginating through the results. | |
| 161 | +| `location_id` | `string` | Query, Optional | Indicates whether to include only team members enabled at the given location in the returned result. | |
| 162 | + |
| 163 | +## Response Type |
| 164 | + |
| 165 | +[`List Team Member Booking Profiles Response`](/doc/models/list-team-member-booking-profiles-response.md) |
| 166 | + |
| 167 | +## Example Usage |
| 168 | + |
| 169 | +```python |
| 170 | +bookable_only = False |
| 171 | +limit = 172 |
| 172 | +cursor = 'cursor6' |
| 173 | +location_id = 'location_id4' |
| 174 | + |
| 175 | +result = bookings_api.list_team_member_booking_profiles(bookable_only, limit, cursor, location_id) |
| 176 | + |
| 177 | +if result.is_success(): |
| 178 | + print(result.body) |
| 179 | +elif result.is_error(): |
| 180 | + print(result.errors) |
| 181 | +``` |
| 182 | + |
| 183 | + |
| 184 | +# Retrieve Team Member Booking Profile |
| 185 | + |
| 186 | +Retrieves a team member's booking profile. |
| 187 | + |
| 188 | +```python |
| 189 | +def retrieve_team_member_booking_profile(self, |
| 190 | + team_member_id) |
| 191 | +``` |
| 192 | + |
| 193 | +## Parameters |
| 194 | + |
| 195 | +| Parameter | Type | Tags | Description | |
| 196 | +| --- | --- | --- | --- | |
| 197 | +| `team_member_id` | `string` | Template, Required | The ID of the team member to retrieve. | |
| 198 | + |
| 199 | +## Response Type |
| 200 | + |
| 201 | +[`Retrieve Team Member Booking Profile Response`](/doc/models/retrieve-team-member-booking-profile-response.md) |
| 202 | + |
| 203 | +## Example Usage |
| 204 | + |
| 205 | +```python |
| 206 | +team_member_id = 'team_member_id0' |
| 207 | + |
| 208 | +result = bookings_api.retrieve_team_member_booking_profile(team_member_id) |
| 209 | + |
| 210 | +if result.is_success(): |
| 211 | + print(result.body) |
| 212 | +elif result.is_error(): |
| 213 | + print(result.errors) |
| 214 | +``` |
| 215 | + |
| 216 | + |
| 217 | +# Retrieve Booking |
| 218 | + |
| 219 | +Retrieves a booking. |
| 220 | + |
| 221 | +```python |
| 222 | +def retrieve_booking(self, |
| 223 | + booking_id) |
| 224 | +``` |
| 225 | + |
| 226 | +## Parameters |
| 227 | + |
| 228 | +| Parameter | Type | Tags | Description | |
| 229 | +| --- | --- | --- | --- | |
| 230 | +| `booking_id` | `string` | Template, Required | The ID of the [Booking](#type-booking) object representing the to-be-retrieved booking. | |
| 231 | + |
| 232 | +## Response Type |
| 233 | + |
| 234 | +[`Retrieve Booking Response`](/doc/models/retrieve-booking-response.md) |
| 235 | + |
| 236 | +## Example Usage |
| 237 | + |
| 238 | +```python |
| 239 | +booking_id = 'booking_id4' |
| 240 | + |
| 241 | +result = bookings_api.retrieve_booking(booking_id) |
| 242 | + |
| 243 | +if result.is_success(): |
| 244 | + print(result.body) |
| 245 | +elif result.is_error(): |
| 246 | + print(result.errors) |
| 247 | +``` |
| 248 | + |
| 249 | + |
| 250 | +# Update Booking |
| 251 | + |
| 252 | +Updates a booking. |
| 253 | + |
| 254 | +```python |
| 255 | +def update_booking(self, |
| 256 | + booking_id, |
| 257 | + body) |
| 258 | +``` |
| 259 | + |
| 260 | +## Parameters |
| 261 | + |
| 262 | +| Parameter | Type | Tags | Description | |
| 263 | +| --- | --- | --- | --- | |
| 264 | +| `booking_id` | `string` | Template, Required | The ID of the [Booking](#type-booking) object representing the to-be-updated booking. | |
| 265 | +| `body` | [`Update Booking Request`](/doc/models/update-booking-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. | |
| 266 | + |
| 267 | +## Response Type |
| 268 | + |
| 269 | +[`Update Booking Response`](/doc/models/update-booking-response.md) |
| 270 | + |
| 271 | +## Example Usage |
| 272 | + |
| 273 | +```python |
| 274 | +booking_id = 'booking_id4' |
| 275 | +body = {} |
| 276 | +body['idempotency_key'] = 'idempotency_key2' |
| 277 | +body['booking'] = {} |
| 278 | +body['booking']['id'] = 'id8' |
| 279 | +body['booking']['version'] = 148 |
| 280 | +body['booking']['status'] = 'ACCEPTED' |
| 281 | +body['booking']['created_at'] = 'created_at6' |
| 282 | +body['booking']['updated_at'] = 'updated_at4' |
| 283 | + |
| 284 | +result = bookings_api.update_booking(booking_id, body) |
| 285 | + |
| 286 | +if result.is_success(): |
| 287 | + print(result.body) |
| 288 | +elif result.is_error(): |
| 289 | + print(result.errors) |
| 290 | +``` |
| 291 | + |
0 commit comments