BookingV2
Address
pydantic-model
¶
Bases: AddressMixin, OtfItemBase
Address associated with a studio in the v2 bookings endpoint.
Show JSON schema:
{
"description": "Address associated with a studio in the v2 bookings endpoint.",
"properties": {
"line1": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Line1"
},
"line2": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Line2"
},
"city": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "City"
},
"postal_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Postal Code"
},
"state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "State"
},
"country": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Country"
},
"physicalRegion": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Physicalregion"
},
"physicalCountryId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Physicalcountryid"
}
},
"title": "Address",
"type": "object"
}
Fields:
-
address_line1(str | None) -
address_line2(str | None) -
city(str | None) -
postal_code(str | None) -
state(str | None) -
country(str | None) -
region(str | None) -
country_id(int | None)
Rating
pydantic-model
¶
Bases: OtfItemBase
A rating given by a member for a class or coach.
Show JSON schema:
{
"description": "A rating given by a member for a class or coach.",
"properties": {
"id": {
"description": "Unique identifier for the rating.",
"title": "Id",
"type": "string"
},
"description": {
"description": "Human-readable label for the rating level.",
"title": "Description",
"type": "string"
},
"value": {
"description": "Numeric rating value.",
"title": "Value",
"type": "integer"
}
},
"required": [
"id",
"description",
"value"
],
"title": "Rating",
"type": "object"
}
Fields:
-
id(str) -
description(str) -
value(int)
BookingV2Studio
pydantic-model
¶
Bases: PhoneLongitudeLatitudeMixin, OtfItemBase
Studio details from the v2 bookings endpoint.
Show JSON schema:
{
"$defs": {
"Address": {
"description": "Address associated with a studio in the v2 bookings endpoint.",
"properties": {
"line1": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Line1"
},
"line2": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Line2"
},
"city": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "City"
},
"postal_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Postal Code"
},
"state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "State"
},
"country": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Country"
},
"physicalRegion": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Physicalregion"
},
"physicalCountryId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Physicalcountryid"
}
},
"title": "Address",
"type": "object"
}
},
"description": "Studio details from the v2 bookings endpoint.",
"properties": {
"phone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Phone"
},
"latitude": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Latitude"
},
"longitude": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Longitude"
},
"id": {
"description": "Unique identifier for the studio.",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the studio.",
"title": "Name"
},
"time_zone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "IANA time zone of the studio.",
"title": "Time Zone"
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Contact email for the studio.",
"title": "Email"
},
"address": {
"anyOf": [
{
"$ref": "#/$defs/Address"
},
{
"type": "null"
}
],
"default": null,
"description": "Physical address of the studio."
},
"currency_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Currency Code"
},
"mbo_studio_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "MindBody attr",
"title": "Mbo Studio Id"
}
},
"required": [
"id"
],
"title": "BookingV2Studio",
"type": "object"
}
Fields:
-
phone_number(str | None) -
latitude(float | None) -
longitude(float | None) -
studio_uuid(str) -
name(str | None) -
time_zone(str | None) -
email(str | None) -
address(Address | None) -
currency_code(str | None) -
mbo_studio_id(str | None)
BookingV2Class
pydantic-model
¶
Bases: ApiMixin, OtfItemBase
Class details from the v2 bookings endpoint.
Show JSON schema:
{
"$defs": {
"Address": {
"description": "Address associated with a studio in the v2 bookings endpoint.",
"properties": {
"line1": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Line1"
},
"line2": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Line2"
},
"city": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "City"
},
"postal_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Postal Code"
},
"state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "State"
},
"country": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Country"
},
"physicalRegion": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Physicalregion"
},
"physicalCountryId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Physicalcountryid"
}
},
"title": "Address",
"type": "object"
},
"BookingV2Studio": {
"description": "Studio details from the v2 bookings endpoint.",
"properties": {
"phone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Phone"
},
"latitude": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Latitude"
},
"longitude": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Longitude"
},
"id": {
"description": "Unique identifier for the studio.",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the studio.",
"title": "Name"
},
"time_zone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "IANA time zone of the studio.",
"title": "Time Zone"
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Contact email for the studio.",
"title": "Email"
},
"address": {
"anyOf": [
{
"$ref": "#/$defs/Address"
},
{
"type": "null"
}
],
"default": null,
"description": "Physical address of the studio."
},
"currency_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Currency Code"
},
"mbo_studio_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "MindBody attr",
"title": "Mbo Studio Id"
}
},
"required": [
"id"
],
"title": "BookingV2Studio",
"type": "object"
},
"ClassType": {
"description": "High-level classification of OTF class formats.",
"enum": [
"ORANGE_60",
"ORANGE_90",
"OTHER",
"STRENGTH_50",
"TREAD_50"
],
"title": "ClassType",
"type": "string"
}
},
"description": "Class details from the v2 bookings endpoint.",
"properties": {
"id": {
"description": "Matches the `class_id` attribute of the OtfClass model",
"title": "Id",
"type": "string"
},
"name": {
"description": "The name of the class.",
"title": "Name",
"type": "string"
},
"type": {
"allOf": [
{
"$ref": "#/$defs/ClassType"
}
],
"description": "The high-level class format category."
},
"starts_at_local": {
"description": "The start time of the class. Reflects local time, but the object does not have a timezone.",
"format": "date-time",
"title": "Starts At Local",
"type": "string"
},
"studio": {
"anyOf": [
{
"$ref": "#/$defs/BookingV2Studio"
},
{
"type": "null"
}
],
"default": null,
"description": "The studio where the class takes place."
},
"coach": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "First name of the coach leading the class.",
"title": "Coach"
},
"ot_base_class_uuid": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Only present when class is ratable",
"title": "Ot Base Class Uuid"
},
"starts_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Starts At"
}
},
"required": [
"id",
"name",
"type",
"starts_at_local"
],
"title": "BookingV2Class",
"type": "object"
}
Fields:
-
_api(Otf) -
class_id(str) -
name(str) -
class_type(ClassType) -
starts_at(datetime) -
studio(BookingV2Studio | None) -
coach(str | None) -
class_uuid(str | None) -
starts_at_utc(datetime | None)
starts_at
pydantic-field
¶
starts_at
The start time of the class. Reflects local time, but the object does not have a timezone.
coach_name
property
¶
coach_name
Shortcut to get the coach's name, to be compatible with old Booking OtfClass model.
ends_at
property
¶
ends_at
Emulates the end time of the class, to be compatible with old Booking OtfClass model.
get_booking ¶
get_booking()
Returns a BookingV2 instance for this class.
Raises:
| Type | Description |
|---|---|
ResourceNotFoundError
|
If the booking does not exist. |
ValueError
|
If class_uuid is None or empty string or if the API instance is not set. |
cancel_booking ¶
cancel_booking()
Cancels the booking by calling the proper API method.
Raises:
| Type | Description |
|---|---|
ResourceNotFoundError
|
If the booking does not exist. |
ValueError
|
If class_uuid is None or empty string or if the API instance is not set. |
BookingV2Workout
pydantic-model
¶
Bases: OtfItemBase
Workout summary data attached to a v2 booking, available after the class is completed.
Show JSON schema:
{
"description": "Workout summary data attached to a v2 booking, available after the class is completed.",
"properties": {
"id": {
"description": "Unique identifier for the workout.",
"title": "Id",
"type": "string"
},
"calories_burned": {
"description": "Total calories burned during the workout.",
"title": "Calories Burned",
"type": "integer"
},
"splat_points": {
"description": "Total splat points earned during the workout.",
"title": "Splat Points",
"type": "integer"
},
"step_count": {
"description": "Total step count during the workout.",
"title": "Step Count",
"type": "integer"
},
"active_time_seconds": {
"description": "Total active time in seconds.",
"title": "Active Time Seconds",
"type": "integer"
}
},
"required": [
"id",
"calories_burned",
"splat_points",
"step_count",
"active_time_seconds"
],
"title": "BookingV2Workout",
"type": "object"
}
Fields:
-
performance_summary_id(str) -
calories_burned(int) -
splat_points(int) -
step_count(int) -
active_time_seconds(int)
BookingV2
pydantic-model
¶
Bases: ApiMixin, OtfItemBase
A class booking from the v2 bookings endpoint, used by the current OTF app.
Show JSON schema:
{
"$defs": {
"Address": {
"description": "Address associated with a studio in the v2 bookings endpoint.",
"properties": {
"line1": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Line1"
},
"line2": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Line2"
},
"city": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "City"
},
"postal_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Postal Code"
},
"state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "State"
},
"country": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Country"
},
"physicalRegion": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Physicalregion"
},
"physicalCountryId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Physicalcountryid"
}
},
"title": "Address",
"type": "object"
},
"BookingV2Class": {
"description": "Class details from the v2 bookings endpoint.",
"properties": {
"id": {
"description": "Matches the `class_id` attribute of the OtfClass model",
"title": "Id",
"type": "string"
},
"name": {
"description": "The name of the class.",
"title": "Name",
"type": "string"
},
"type": {
"allOf": [
{
"$ref": "#/$defs/ClassType"
}
],
"description": "The high-level class format category."
},
"starts_at_local": {
"description": "The start time of the class. Reflects local time, but the object does not have a timezone.",
"format": "date-time",
"title": "Starts At Local",
"type": "string"
},
"studio": {
"anyOf": [
{
"$ref": "#/$defs/BookingV2Studio"
},
{
"type": "null"
}
],
"default": null,
"description": "The studio where the class takes place."
},
"coach": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "First name of the coach leading the class.",
"title": "Coach"
},
"ot_base_class_uuid": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Only present when class is ratable",
"title": "Ot Base Class Uuid"
},
"starts_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Starts At"
}
},
"required": [
"id",
"name",
"type",
"starts_at_local"
],
"title": "BookingV2Class",
"type": "object"
},
"BookingV2Studio": {
"description": "Studio details from the v2 bookings endpoint.",
"properties": {
"phone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Phone"
},
"latitude": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Latitude"
},
"longitude": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Longitude"
},
"id": {
"description": "Unique identifier for the studio.",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the studio.",
"title": "Name"
},
"time_zone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "IANA time zone of the studio.",
"title": "Time Zone"
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Contact email for the studio.",
"title": "Email"
},
"address": {
"anyOf": [
{
"$ref": "#/$defs/Address"
},
{
"type": "null"
}
],
"default": null,
"description": "Physical address of the studio."
},
"currency_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Currency Code"
},
"mbo_studio_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "MindBody attr",
"title": "Mbo Studio Id"
}
},
"required": [
"id"
],
"title": "BookingV2Studio",
"type": "object"
},
"BookingV2Workout": {
"description": "Workout summary data attached to a v2 booking, available after the class is completed.",
"properties": {
"id": {
"description": "Unique identifier for the workout.",
"title": "Id",
"type": "string"
},
"calories_burned": {
"description": "Total calories burned during the workout.",
"title": "Calories Burned",
"type": "integer"
},
"splat_points": {
"description": "Total splat points earned during the workout.",
"title": "Splat Points",
"type": "integer"
},
"step_count": {
"description": "Total step count during the workout.",
"title": "Step Count",
"type": "integer"
},
"active_time_seconds": {
"description": "Total active time in seconds.",
"title": "Active Time Seconds",
"type": "integer"
}
},
"required": [
"id",
"calories_burned",
"splat_points",
"step_count",
"active_time_seconds"
],
"title": "BookingV2Workout",
"type": "object"
},
"ClassType": {
"description": "High-level classification of OTF class formats.",
"enum": [
"ORANGE_60",
"ORANGE_90",
"OTHER",
"STRENGTH_50",
"TREAD_50"
],
"title": "ClassType",
"type": "string"
},
"Rating": {
"description": "A rating given by a member for a class or coach.",
"properties": {
"id": {
"description": "Unique identifier for the rating.",
"title": "Id",
"type": "string"
},
"description": {
"description": "Human-readable label for the rating level.",
"title": "Description",
"type": "string"
},
"value": {
"description": "Numeric rating value.",
"title": "Value",
"type": "integer"
}
},
"required": [
"id",
"description",
"value"
],
"title": "Rating",
"type": "object"
}
},
"description": "A class booking from the v2 bookings endpoint, used by the current OTF app.",
"properties": {
"id": {
"description": "The booking ID used to cancel the booking - must be canceled through new endpoint",
"title": "Id",
"type": "string"
},
"member_id": {
"description": "Unique identifier for the member.",
"title": "Member Id",
"type": "string"
},
"service_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Represents tier of member",
"title": "Service Name"
},
"cross_regional": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the booking is at a non-home studio.",
"title": "Cross Regional"
},
"intro": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether this is an introductory class booking.",
"title": "Intro"
},
"checked_in": {
"description": "Whether the member has checked in.",
"title": "Checked In",
"type": "boolean"
},
"canceled": {
"description": "Whether the booking has been cancelled.",
"title": "Canceled",
"type": "boolean"
},
"late_canceled": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the booking was cancelled late.",
"title": "Late Canceled"
},
"canceled_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "When the booking was cancelled.",
"title": "Canceled At"
},
"ratable": {
"description": "Whether the class is eligible for rating.",
"title": "Ratable",
"type": "boolean"
},
"waitlist_position": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Position on the waitlist, if applicable.",
"title": "Waitlist Position"
},
"class": {
"allOf": [
{
"$ref": "#/$defs/BookingV2Class"
}
],
"description": "The class associated with this booking."
},
"workout": {
"anyOf": [
{
"$ref": "#/$defs/BookingV2Workout"
},
{
"type": "null"
}
],
"default": null,
"description": "Workout summary, present after class is completed."
},
"coach_rating": {
"anyOf": [
{
"$ref": "#/$defs/Rating"
},
{
"type": "null"
}
],
"default": null,
"description": "Rating given to the coach."
},
"class_rating": {
"anyOf": [
{
"$ref": "#/$defs/Rating"
},
{
"type": "null"
}
],
"default": null,
"description": "Rating given to the class."
},
"paying_studio_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Studio ID responsible for billing.",
"title": "Paying Studio Id"
},
"mbo_booking_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Mbo Booking Id"
},
"mbo_unique_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Mbo Unique Id"
},
"mbo_paying_unique_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Mbo Paying Unique Id"
},
"person_id": {
"description": "Person identifier in the OTF system.",
"title": "Person Id",
"type": "string"
},
"created_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Date the booking was created in the system",
"title": "Created At"
},
"updated_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Date the booking was updated in the system",
"title": "Updated At"
}
},
"required": [
"id",
"member_id",
"checked_in",
"canceled",
"ratable",
"class",
"person_id"
],
"title": "BookingV2",
"type": "object"
}
Fields:
-
_api(Otf) -
booking_id(str) -
member_uuid(str) -
service_name(str | None) -
cross_regional(bool | None) -
intro(bool | None) -
checked_in(bool) -
canceled(bool) -
late_canceled(bool | None) -
canceled_at(datetime | None) -
ratable(bool) -
waitlist_position(int | None) -
otf_class(BookingV2Class) -
workout(BookingV2Workout | None) -
coach_rating(Rating | None) -
class_rating(Rating | None) -
paying_studio_id(str | None) -
mbo_booking_id(str | None) -
mbo_unique_id(str | None) -
mbo_paying_unique_id(str | None) -
person_id(str) -
created_at(datetime | None) -
updated_at(datetime | None)
booking_id
pydantic-field
¶
booking_id
The booking ID used to cancel the booking - must be canceled through new endpoint
waitlist_position
pydantic-field
¶
waitlist_position = None
Position on the waitlist, if applicable.
cancelled_date
property
¶
cancelled_date
Returns the canceled_at value in a backward-compatible way.
cancel ¶
cancel()
Cancels the booking by calling the proper API method.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the API instance is not set. |
get_sort_key ¶
get_sort_key()
Returns a tuple for sorting bookings, used when attempting to remove duplicates.
get_end_time ¶
get_end_time(start_time, class_type)
Get the end time of a class based on the start time and class type.