Classes
OtfClass
pydantic-model
¶
Bases: ApiMixin, OtfItemBase
An OrangeTheory class available for booking, with schedule, capacity, and studio details.
Show JSON schema:
{
"$defs": {
"ClassType": {
"description": "High-level classification of OTF class formats.",
"enum": [
"ORANGE_60",
"ORANGE_90",
"OTHER",
"STRENGTH_50",
"TREAD_50"
],
"title": "ClassType",
"type": "string"
},
"StudioDetail": {
"description": "Detailed information about an OrangeTheory studio.",
"properties": {
"studioUUId": {
"description": "The OTF studio UUID",
"title": "Studiouuid",
"type": "string"
},
"contactEmail": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Studio contact email address.",
"title": "Contactemail"
},
"distance": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Distance from latitude and longitude provided to `search_studios_by_geo` method, NULL if that method was not used",
"title": "Distance"
},
"studioLocation": {
"allOf": [
{
"$ref": "#/$defs/StudioLocation"
}
],
"description": "Physical location details."
},
"studioName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the studio.",
"title": "Studioname"
},
"studioStatus": {
"anyOf": [
{
"$ref": "#/$defs/StudioStatus"
},
{
"type": "null"
}
],
"default": null,
"description": "Active, Temporarily Closed, Coming Soon"
},
"timeZone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "IANA time zone of the studio.",
"title": "Timezone"
},
"acceptsAch": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Acceptsach"
},
"acceptsAmericanExpress": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Acceptsamericanexpress"
},
"acceptsDiscover": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Acceptsdiscover"
},
"acceptsVisaMasterCard": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Acceptsvisamastercard"
},
"allowsCrWaitlist": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Allowscrwaitlist"
},
"allowsDashboardAccess": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Allowsdashboardaccess"
},
"is_crm": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Is Crm"
},
"isIntegrated": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Always 'True'",
"title": "Isintegrated"
},
"isMobile": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Ismobile"
},
"isOtbeat": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Isotbeat"
},
"is_web": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Is Web"
},
"smsPackageEnabled": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Smspackageenabled"
},
"studioId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Not used by API",
"title": "Studioid"
},
"mboStudioId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "MindBody attr",
"title": "Mbostudioid"
},
"openDate": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Opendate"
},
"pricingLevel": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pro, Legacy, Accelerate, or empty",
"title": "Pricinglevel"
},
"reOpenDate": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Reopendate"
},
"studioNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Studionumber"
},
"studioPhysicalLocationId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Studiophysicallocationid"
},
"studioToken": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Studiotoken"
},
"studioTypeId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Studiotypeid"
}
},
"required": [
"studioUUId"
],
"title": "StudioDetail",
"type": "object"
},
"StudioLocation": {
"description": "Physical location details for an OrangeTheory studio.",
"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"
},
"phone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Studio phone number.",
"title": "Phone"
},
"latitude": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Geographic latitude.",
"title": "Latitude"
},
"longitude": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Geographic longitude.",
"title": "Longitude"
}
},
"title": "StudioLocation",
"type": "object"
},
"StudioStatus": {
"description": "Operational status of an OrangeTheory studio.",
"enum": [
"OTHER",
"Active",
"Inactive",
"Coming Soon",
"Temporarily Closed",
"Permanently Closed",
"Unknown"
],
"title": "StudioStatus",
"type": "string"
}
},
"description": "An OrangeTheory class available for booking, with schedule, capacity, and studio details.",
"properties": {
"ot_base_class_uuid": {
"description": "The OTF class UUID",
"title": "Ot Base Class Uuid",
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Matches new booking endpoint class id",
"title": "Id"
},
"name": {
"description": "The name of the class",
"title": "Name",
"type": "string"
},
"type": {
"allOf": [
{
"$ref": "#/$defs/ClassType"
}
],
"description": "The high-level class format category."
},
"coach": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "First name of the coach leading the class.",
"title": "Coach"
},
"ends_at_local": {
"description": "The end time of the class. Reflects local time, but the object does not have a timezone.",
"format": "date-time",
"title": "Ends At Local",
"type": "string"
},
"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": {
"$ref": "#/$defs/StudioDetail"
},
"booking_capacity": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Current number of bookings for this class.",
"title": "Booking Capacity"
},
"full": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the class is at full capacity.",
"title": "Full"
},
"max_capacity": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum number of participants allowed.",
"title": "Max Capacity"
},
"waitlist_available": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the waitlist is open for this class.",
"title": "Waitlist Available"
},
"waitlist_size": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "The number of people on the waitlist",
"title": "Waitlist Size"
},
"is_booked": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Custom helper field to determine if class is already booked",
"title": "Is Booked"
},
"canceled": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the class has been cancelled by the studio.",
"title": "Canceled"
},
"is_home_studio": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Custom helper field to determine if at home studio",
"title": "Is Home Studio"
},
"created_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Created At"
},
"ends_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ends At"
},
"mbo_class_description_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "MindBody attr",
"title": "Mbo Class Description Id"
},
"mbo_class_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "MindBody attr",
"title": "Mbo Class Id"
},
"mbo_class_schedule_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "MindBody attr",
"title": "Mbo Class Schedule Id"
},
"starts_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Starts At"
},
"updated_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Updated At"
}
},
"required": [
"ot_base_class_uuid",
"name",
"type",
"ends_at_local",
"starts_at_local",
"studio"
],
"title": "OtfClass",
"type": "object"
}
Fields:
-
_api(Otf) -
class_uuid(str) -
class_id(str | None) -
name(str) -
class_type(ClassType) -
coach(str | None) -
ends_at(datetime) -
starts_at(datetime) -
studio(StudioDetail) -
booking_capacity(int | None) -
full(bool | None) -
max_capacity(int | None) -
waitlist_available(bool | None) -
waitlist_size(int | None) -
is_booked(bool | None) -
is_cancelled(bool | None) -
is_home_studio(bool | None) -
created_at(datetime | None) -
ends_at_utc(datetime | None) -
mbo_class_description_id(str | None) -
mbo_class_id(str | None) -
mbo_class_schedule_id(str | None) -
starts_at_utc(datetime | None) -
updated_at(datetime | None)
ends_at
pydantic-field
¶
ends_at
The end time of the class. Reflects local time, but the object does not have a timezone.
starts_at
pydantic-field
¶
starts_at
The start time of the class. Reflects local time, but the object does not have a timezone.
booking_capacity
pydantic-field
¶
booking_capacity = None
Current number of bookings for this class.
waitlist_available
pydantic-field
¶
waitlist_available = None
Whether the waitlist is open for this class.
is_booked
pydantic-field
¶
is_booked = None
Custom helper field to determine if class is already booked
is_cancelled
pydantic-field
¶
is_cancelled = None
Whether the class has been cancelled by the studio.
is_home_studio
pydantic-field
¶
is_home_studio = None
Custom helper field to determine if at home studio
day_of_week
property
¶
day_of_week
Returns the day of the week as a DoW enum based on the class start time.
has_availability
property
¶
has_availability
Returns True if the class is not full and has open spots.
book_class ¶
book_class()
Book a class by providing either the class_uuid or the OtfClass object.
Returns:
| Name | Type | Description |
|---|---|---|
Booking |
Booking
|
The booking. |
Raises:
| Type | Description |
|---|---|
AlreadyBookedError
|
If the class is already booked. |
OutsideSchedulingWindowError
|
If the class is outside the scheduling window. |
ValueError
|
If class_uuid is None or empty string. |
OtfError
|
If there is an error booking the class. |
cancel_booking ¶
cancel_booking()
Cancels the class booking.
Raises:
| Type | Description |
|---|---|
ResourceNotFoundError
|
If the booking does not exist. |
ValueError
|
If booking_uuid is None or empty string or the API is not set. |