-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from seatsio/matti/social-distancing-calls
Added social distancing calls
- Loading branch information
Showing
11 changed files
with
164 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class SocialDistancingRulesetsRequest: | ||
|
||
def __init__(self, rulesets): | ||
self.socialDistancingRulesets = {k: self.to_json(v) for k, v in rulesets.items()} | ||
|
||
def to_json(self, ruleset): | ||
return { | ||
"name": ruleset.name, | ||
"numberOfDisabledSeatsToTheSides": ruleset.number_of_disabled_seats_to_the_sides, | ||
"disableSeatsInFrontAndBehind": ruleset.disable_seats_in_front_and_behind, | ||
"numberOfDisabledAisleSeats": ruleset.number_of_disabled_aisle_seats, | ||
"maxGroupSize": ruleset.max_group_size, | ||
"disabledSeats": ruleset.disabled_seats, | ||
"enabledSeats": ruleset.enabled_seats, | ||
"index": ruleset.index, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
class CreateSingleEventRequest: | ||
def __init__(self, chart_key, event_key=None, book_whole_tables=None, table_booking_modes=None): | ||
def __init__(self, chart_key, event_key=None, book_whole_tables=None, table_booking_modes=None, social_distancing_ruleset_key=None): | ||
if chart_key: | ||
self.chartKey = chart_key | ||
if event_key: | ||
self.eventKey = event_key | ||
if book_whole_tables is not None: | ||
self.bookWholeTables = book_whole_tables | ||
if table_booking_modes is not None: | ||
self.tableBookingModes = table_booking_modes | ||
self.tableBookingModes = table_booking_modes | ||
if social_distancing_ruleset_key is not None: | ||
self.socialDistancingRulesetKey = social_distancing_ruleset_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
class EventProperties: | ||
def __init__(self, event_key=None, book_whole_tables=None, table_booking_modes=None): | ||
def __init__(self, event_key=None, book_whole_tables=None, table_booking_modes=None, social_distancing_ruleset_key=None): | ||
if event_key: | ||
self.eventKey = event_key | ||
if book_whole_tables is not None: | ||
self.bookWholeTables = book_whole_tables | ||
if table_booking_modes is not None: | ||
self.tableBookingModes = table_booking_modes | ||
if social_distancing_ruleset_key is not None: | ||
self.socialDistancingRulesetKey = social_distancing_ruleset_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
setup( | ||
name='seatsio', | ||
version='v51.2.0', | ||
version='v51.3.0', | ||
description='The official Seats.io Python client library', | ||
author='The seats.io dev team', | ||
author_email='[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from seatsio import SocialDistancingRuleset | ||
from tests.seatsioClientTest import SeatsioClientTest | ||
from tests.util.asserts import assert_that | ||
|
||
|
||
class SaveSocialDistancingRulesetsTest(SeatsioClientTest): | ||
|
||
def test(self): | ||
chart = self.client.charts.create() | ||
rulesets = { | ||
'ruleset1': SocialDistancingRuleset( | ||
name='My first ruleset', | ||
number_of_disabled_seats_to_the_sides=1, | ||
disable_seats_in_front_and_behind=True, | ||
number_of_disabled_aisle_seats=2, | ||
max_group_size=1, | ||
disabled_seats=["A-1"], | ||
enabled_seats=["A-2"], | ||
index=4 | ||
), | ||
'ruleset2': SocialDistancingRuleset(name='My second ruleset'), | ||
} | ||
self.client.charts.save_social_distancing_rulesets(chart.key, rulesets) | ||
|
||
retrieved_chart = self.client.charts.retrieve(chart.key) | ||
assert_that(retrieved_chart.social_distancing_rulesets).is_equal_to(rulesets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters