Space

class fabman.space.Space(requester: Requester, attributes: dict)

Class for interacting with the Space endpoint on the Fabman API

Initialize the Object. Stores the requester method to interact with the API for further calls

Parameters:
  • requester (Requester) – The Requester object to make requests with

  • attributes (dict) – The attributes to initialize this object with

create_holiday(**kwargs) SpaceHoliday

Creates a new holiday for the space.

Calls:

“POST /spaces/{spaceId}/holidays” <https://fabman.io/api/v1/documentation#/spaces/postSpacesIdHolidays>

Returns:

Object with new holiday information

Return type:

fabman.space.SpaceHoliday

delete(**kwargs) Response

Deletes a space. WARNING: This is irreversible.

Calls:

“DELETE /spaces/{spaceId}” <https://fabman.io/api/v1/documentation#/spaces/deleteSpacesId>

Returns:

response information of call

Return type:

requests.Response

delete_calendar_token(**kwargs) Response

Deletes a space calendar token. WARNING: This is irreversible.

Calls:

“DELETE /spaces/{spaceId}/calendar-token” <https://fabman.io/api/v1/documentation#/spaces/deleteSpacesIdCalendartoken>

Returns:

response information of call

Return type:

requests.Response

get_billing_settings(**kwargs) SpaceBillingSettings

Returns the billing settings for the space.

Calls:

“GET /spaces/{spaceId}/billing-settings” <https://fabman.io/api/v1/documentation#/spaces/getSpacesIdBillingsettings>

Returns:

Object with billing settings information

Return type:

fabman.space.SpaceBillingSettings

get_holiday(holiday_id, **kwargs) SpaceHoliday

Returns a specific holiday for the space given a holiday_id.

Calls:

“GET /spaces/{spaceId}/holidays/{holidayId}” <https://fabman.io/api/v1/documentation#/spaces/getSpacesIdHolidaysHolidayid>

Parameters:

holiday_id (int) – ID of the holiday to retrieve

Returns:

Object with holiday information

Return type:

fabman.space.SpaceHoliday

get_holidays(**kwargs) EmbeddedList | PaginatedList

Returns a list of holidays for the space. If the information is cached from an embedded call, a list of SpaceHoliday objects is returned. Otherwise, a PaginatedList will be returned.

Calls:

“GET /spaces/{spaceId}/holidays” <https://fabman.io/api/v1/documentation#/spaces/getSpacesIdHolidays>

Returns:

List of SpaceHoliday Objects

Return type:

list[fabman.space.SpaceHoliday] or fabman.paginated_list.PaginatedList

get_opening_hours(**kwargs) SpaceOpeningHours

Get the opening hours for the space.

Calls:

“GET /spaces/{spaceId}/opening-hours” <https://fabman.io/api/v1/documentation#/spaces/getSpacesIdOpeninghours>

Returns:

List of opening hours

Return type:

list

update(**kwargs) None

Updates the space. Attributes are updated in place with new information from the API.

Calls:

“PUT /spaces/{spaceId}” <https://fabman.io/api/v1/documentation#/spaces/putSpacesId>

Returns:

None – attributes are updated in place

Return type:

None

update_calendar_token(**kwargs) Response

Updates the space calendar token and returns a link to the new calendar ics file. Calendar Token attribute is updated in place with new information.

Calls:

“PUT /spaces/{spaceId}/calendar-token” <https://fabman.io/api/v1/documentation#/spaces/putSpacesIdCalendartoken>

Returns:

response information of call

Return type:

requests.Response

update_opening_hours(**kwargs) SpaceOpeningHours

Updates the opening hours of a space. If the the openingHours key is present in the _embedded attribute, the opening hours are updated in place with information returned by the api.

Calls:

“PUT /spaces/{spaceId}/opening-hours” <https://fabman.io/api/v1/documentation#/spaces/putSpacesIdOpeninghours>

Returns:

response information of call

Return type:

SpaceOpeningHours

SpaceBillingSettings

class fabman.space.SpaceBillingSettings(requester: Requester, attributes: dict)

Class for interacting with the space-billing-settings endpoint on the Fabman API

Initialize the Object. Stores the requester method to interact with the API for further calls

Parameters:
  • requester (Requester) – The Requester object to make requests with

  • attributes (dict) – The attributes to initialize this object with

delete_stripe(**kwargs) Response

Deletes Stripe information from a space. WARNING: This is irreversible.

Calls:

“DELETE /space/{id]/billing-settings/stripe” <https://fabman.io/api/v1/documentation#/spaces/deleteSpacesIdBillingsettingsStripe>

Returns:

response information of call

Return type:

requests.Response

update(**kwargs) None

Updates the space-billing-settings. Attributes are updated in place with new information retrieved from the API.

Calls:

“PUT /space-billing-settings/{spaceBillingSettingsId}” <https://fabman.io/api/v1/documentation#/space-billing-settings/putSpaceBillingSettingsSpaceBillingSettingsId>

Returns:

None – attributes are updated in place

Return type:

None

update_stripe(**kwargs) None

Updates the space-billing-settings. Attributes are updated in place with new information retrieved from the API. Placeholder for future implementation

Calls:

“PUT /space-billing-settings/{spaceBillingSettingsId}” <https://fabman.io/api/v1/documentation>

Raises:

NotImplementedError

SpaceHoliday

class fabman.space.SpaceHoliday(requester: Requester, attributes: dict)

Class for interacting with the space/{id}/holidays endpoints on the Fabman API

Initialize the Object. Stores the requester method to interact with the API for further calls

Parameters:
  • requester (Requester) – The Requester object to make requests with

  • attributes (dict) – The attributes to initialize this object with

delete(**kwargs) Response

Deletes a space holiday. WARNING: This is irreversible.

Calls:

“DELETE /space/{spaceId}/holidays/{holidayId}” <https://fabman.io/api/v1/documentation#/spaces/deleteSpacesIdHolidaysHolidayid>

Returns:

response information of call

Return type:

requests.Response

update(**kwargs) None

Updates the space holiday. Attributes are updated in place with new information retrieved from the API.

Calls:

“PUT /space/{spaceId}/holidays/{holidayId}” <https://fabman.io/api/v1/documentation#/spaces/putSpacesIdHolidaysHolidayid>

Returns:

None – attributes are updated in place

Return type:

None