import eel
import os
import sys
import json
import sims.acc as acc
import sims.iracing as iracing
import sims.ac as ac
from external.phue import Bridge
from external.modified.rgbxy import Converter
# GUI Theme Customization
GUI_COLOR_NO_FLAG = '#000000'
GUI_COLOR_BLUE_FLAG = '#0D47A1'
GUI_COLOR_YELLOW_FLAG = '#FFEB3B'
GUI_COLOR_BLACK_FLAG = '#000000'
GUI_COLOR_WHITE_FLAG = '#ffffff'
GUI_COLOR_CHECKERED_FLAG = '#000000'
GUI_COLOR_PENALTY_FLAG = '#b71c1c'
GUI_COLOR_GREEN_FLAG = '#388E3C'
GUI_COLOR_ORANGE_FLAG = '#FF6F00'
SAVE_FILE_PATH = './prf-save.json'
HUE_CONNECTION = {
'ip': '',
'lights': [],
'brightness': 255,
'sim': 'AC',
'colors': {
'No_Flag': '',
'Blue_Flag': GUI_COLOR_BLUE_FLAG,
'Yellow_Flag': GUI_COLOR_YELLOW_FLAG,
'Black_Flag': '',
'White_Flag': GUI_COLOR_WHITE_FLAG,
'Checkered_Flag': '',
'Penalty_Flag': GUI_COLOR_PENALTY_FLAG,
'Green_Flag': GUI_COLOR_GREEN_FLAG,
'Orange_Flag': GUI_COLOR_ORANGE_FLAG
},
'auto_sync': False
}
STOP_SYNC = True
@eel.expose
def init_bridge_connection():
load_hue_connection_from_file()
eel.mutate_connection_works(bridge_connection_works())
eel.mutate_hue_connection(HUE_CONNECTION)
eel.mutate_available_lights(get_lights_from_bridge(Bridge(HUE_CONNECTION['ip'])))
if HUE_CONNECTION['auto_sync']:
eel.mutate_live_sync_running(True)
start_sync()
@eel.expose
def connect(ip: str):
HUE_CONNECTION['ip'] = ip
save_hue_connection_to_file()
init_bridge_connection()
@eel.expose
def sync_and_save_hue_connection(hueConnection):
global HUE_CONNECTION
HUE_CONNECTION = hueConnection
save_hue_connection_to_file()
@eel.expose
def test_light(key: str):
color_hex = HUE_CONNECTION['colors'][key]
raise_color(color_hex)
@eel.expose
def start_sync():
global STOP_SYNC
if STOP_SYNC:
STOP_SYNC = False
while True:
if HUE_CONNECTION['sim'] == 'AC':
sync_ac_color()
eel.sleep(0.1)
if HUE_CONNECTION['sim'] == 'ACC':
sync_acc_color()
eel.sleep(0.1)
if HUE_CONNECTION['sim'] == 'iRacing':
sync_iracing_color()
eel.sleep(0.1)
if STOP_SYNC:
break
@eel.expose
def stop_sync():
global STOP_SYNC
STOP_SYNC = True
def save_hue_connection_to_file():
save_file = open(SAVE_FILE_PATH, 'w')
json.dump(HUE_CONNECTION, save_file)
def load_hue_connection_from_file():
try:
save_file = open(SAVE_FILE_PATH, 'r')
data = json.load(save_file)
HUE_CONNECTION['ip'] = data['ip']
HUE_CONNECTION['lights'] = data['lights']
HUE_CONNECTION['brightness'] = data['brightness']
HUE_CONNECTION['sim'] = data['sim'] or 'AC'
HUE_CONNECTION['colors'] = data['colors']
HUE_CONNECTION['auto_sync'] = data['auto_sync']
except (FileNotFoundError, KeyError) as error:
print(error)
HUE_CONNECTION['ip'] = ''
HUE_CONNECTION['lights'] = []
HUE_CONNECTION['brightness'] = 255
HUE_CONNECTION['sim'] = 'AC'
HUE_CONNECTION['colors'] = {
'No_Flag': '',
'Blue_Flag': GUI_COLOR_BLUE_FLAG,
'Yellow_Flag': GUI_COLOR_YELLOW_FLAG,
'Black_Flag': '',
'White_Flag': GUI_COLOR_WHITE_FLAG,
'Checkered_Flag': '',
'Penalty_Flag': GUI_COLOR_PENALTY_FLAG,
'Green_Flag': GUI_COLOR_GREEN_FLAG,
'Orange_Flag': GUI_COLOR_ORANGE_FLAG
}
HUE_CONNECTION['auto_sync'] = False
def bridge_connection_works() -> bool:
if HUE_CONNECTION['ip'] == '':
return False
else:
try:
Bridge(HUE_CONNECTION['ip'])
return True
except:
return False
def get_lights_from_bridge(bridge: Bridge) -> []:
light_options = []
for light in bridge.get_light_objects():
light_options.append(light.name)
return light_options
def raise_color(color_hex: str):
if color_hex == '' or color_hex == '#000000':
for light in HUE_CONNECTION['lights']:
Bridge(HUE_CONNECTION['ip']).set_light(light, {'transitiontime': 0, 'on': False})
else:
converter = Converter()
color_xy = converter.hex_to_xy(color_hex.replace('#', ''))
for light in HUE_CONNECTION['lights']:
Bridge(HUE_CONNECTION['ip']).set_light(light, {'transitiontime': 0, 'on': True, 'bri': int(HUE_CONNECTION['brightness']),
'xy': color_xy})
def raise_ac_flag(flag: ac.ACFlagType):
if flag == ac.ACFlagType.AC_NO_FLAG:
raise_color(HUE_CONNECTION['colors']['No_Flag'])
if flag == ac.ACFlagType.AC_BLUE_FLAG:
raise_color(HUE_CONNECTION['colors']['Blue_Flag'])
if flag == ac.ACFlagType.AC_YELLOW_FLAG:
raise_color(HUE_CONNECTION['colors']['Yellow_Flag'])
if flag == ac.ACFlagType.AC_BLACK_FLAG:
raise_color(HUE_CONNECTION['colors']['Black_Flag'])
if flag == ac.ACFlagType.AC_WHITE_FLAG:
raise_color(HUE_CONNECTION['colors']['White_Flag'])
if flag == ac.ACFlagType.AC_CHECKERED_FLAG:
raise_color(HUE_CONNECTION['colors']['Checkered_Flag'])
if flag == ac.ACFlagType.AC_PENALTY_FLAG:
raise_color(HUE_CONNECTION['colors']['Penalty_Flag'])
def raise_acc_flag(flag: acc.ACCFlagType):
if flag == acc.ACCFlagType.ACC_NO_FLAG:
raise_color(HUE_CONNECTION['colors']['No_Flag'])
if flag == acc.ACCFlagType.ACC_BLUE_FLAG:
raise_color(HUE_CONNECTION['colors']['Blue_Flag'])
if flag == acc.ACCFlagType.ACC_YELLOW_FLAG:
raise_color(HUE_CONNECTION['colors']['Yellow_Flag'])
if flag == acc.ACCFlagType.ACC_BLACK_FLAG:
raise_color(HUE_CONNECTION['colors']['Black_Flag'])
if flag == acc.ACCFlagType.ACC_WHITE_FLAG:
raise_color(HUE_CONNECTION['colors']['White_Flag'])
if flag == acc.ACCFlagType.ACC_CHECKERED_FLAG:
raise_color(HUE_CONNECTION['colors']['Checkered_Flag'])
if flag == acc.ACCFlagType.ACC_PENALTY_FLAG:
raise_color(HUE_CONNECTION['colors']['Penalty_Flag'])
if flag == acc.ACCFlagType.ACC_GREEN_FLAG:
raise_color(HUE_CONNECTION['colors']['Green_Flag'])
if flag == acc.ACCFlagType.ACC_ORANGE_FLAG:
raise_color(HUE_CONNECTION['colors']['Orange_Flag'])
def raise_iracing_flag(flag: iracing.IRacingGUIFlagType):
if flag == iracing.IRacingGUIFlagType.IRACING_NO_FLAG:
raise_color(HUE_CONNECTION['colors']['No_Flag'])
if flag == iracing.IRacingGUIFlagType.IRACING_BLUE_FLAG:
raise_color(HUE_CONNECTION['colors']['Blue_Flag'])
if flag == iracing.IRacingGUIFlagType.IRACING_YELLOW_FLAG:
raise_color(HUE_CONNECTION['colors']['Yellow_Flag'])
if flag == iracing.IRacingGUIFlagType.IRACING_BLACK_FLAG:
raise_color(HUE_CONNECTION['colors']['Black_Flag'])
if flag == iracing.IRacingGUIFlagType.IRACING_WHITE_FLAG:
raise_color(HUE_CONNECTION['colors']['White_Flag'])
if flag == iracing.IRacingGUIFlagType.IRACING_CHEQUERED_FLAG:
raise_color(HUE_CONNECTION['colors']['Checkered_Flag'])
if flag == iracing.IRacingGUIFlagType.IRACING_RED_FLAG:
raise_color(HUE_CONNECTION['colors']['Penalty_Flag'])
if flag == iracing.IRacingGUIFlagType.IRACING_GREEN_FLAG:
raise_color(HUE_CONNECTION['colors']['Green_Flag'])
if flag == iracing.IRacingGUIFlagType.IRACING_MEATBALL_FLAG:
raise_color(HUE_CONNECTION['colors']['Orange_Flag'])
def sync_ac_color():
flag = ac.get_flag()
raise_ac_flag(flag)
def sync_acc_color():
flag = acc.get_flag()
raise_acc_flag(flag)
def sync_iracing_color():
flag = iracing.get_flag()
raise_iracing_flag(flag)
def close_callback(route, websockets):
if not websockets:
stop_sync()
exit()
def resource_path(rel_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, rel_path)
if __name__ == '__main__':
eel.init('web')
eel.browsers.set_path('electron', resource_path('node_modules\electron\dist\electron.exe'))
eel.start('index.html', mode='electron')
# -*- coding: utf-8 -*-
import logging
from ...models_access import (
OdooProductAccess, ProductSyncAccess, AmazonProductAccess
)
from ...model_names.shared_names import (
MODEL_NAME_FIELD, RECORD_ID_FIELD,
)
from ...model_names.product_sync import (
SYNC_TYPE_FIELD,
SYNC_DELETE, SYNC_CREATE, SYNC_DEACTIVATE,
)
from ..amazon_names import AMAZON_ID_FIELD, AMAZON_SKU_FIELD
_logger = logging.getLogger(__name__)
class BaseTransformer(object):
"""
This is the base transform
"""
def __init__(self, env):
self._odoo_product = OdooProductAccess(env)
self._product_sync = ProductSyncAccess(env)
self._amazon_product = AmazonProductAccess(env)
self._product = None
@staticmethod
def _raise_exception(field_name):
template = "Invalid {} value in Sync transformation"
raise ValueError(template.format(field_name))
@staticmethod
def _check_string(sync_value, field_name, field_value):
# add field to sync value, raise an exception if the value is invalid
if field_value:
field_value = field_value.strip()
if field_value:
sync_value[field_name] = field_value
return
# otherwise raise an exception for required field
BaseTransformer._raise_exception(field_name)
@staticmethod
def _add_string(sync_value, field_name, field_value):
# add valid field value to sync value
if field_value:
field_value = field_value.strip()
if field_value:
sync_value[field_name] = field_value
@staticmethod
def _remove_syncs(sync_ops, removing_ops):
for sync_op in removing_ops:
sync_ops = sync_ops - sync_op
return sync_ops
def _merge_others(self, sync_op, sync_ops):
"""
This is stub that to be implement in a child class if
it needs to do other work
"""
pass
# the default implementation, update transform should combine values
def _check_redundant(self, sync_ops):
_logger.debug("check and remove redundant syncs.")
processed = set()
redundant = []
for sync_op in sync_ops:
sync_key = (sync_op[MODEL_NAME_FIELD], sync_op[RECORD_ID_FIELD])
if sync_key in processed:
self._product_sync.set_sync_redundant(sync_op)
redundant.append(sync_op)
else:
processed.add(sync_key)
# a hook method that might be implemented in a subclass
self._merge_others(sync_op, sync_ops)
_logger.debug("Found {} redundant syncs.".format(len(redundant)))
return BaseTransformer._remove_syncs(sync_ops, redundant)
def _convert_sync(self, sync_op):
"""
To be called and extended in subclass to convert more fields
"""
sync_value = {AMAZON_ID_FIELD: sync_op.id}
sku = OdooProductAccess.get_sku(self._product)
BaseTransformer._check_string(sync_value, AMAZON_SKU_FIELD, sku)
return sync_value
def _check_stop(self, sync_op):
stop_sync = False
self._product = self._odoo_product.get_existed_product(sync_op)
# for all but delete, we want to make sure the product exists
# no need to check Amazon Product table because both
# waiting syncs are checked before switch to new
if sync_op[SYNC_TYPE_FIELD] != SYNC_DELETE:
if self._product:
if self._odoo_product.is_sync_active_product(
self._product):
# may be unnecessary but does not hurt
if sync_op[SYNC_TYPE_FIELD] == SYNC_DEACTIVATE:
stop_sync = True
else:
if sync_op[SYNC_TYPE_FIELD] != SYNC_DEACTIVATE:
stop_sync = True
else:
stop_sync = True
return stop_sync
def _transform_sync(self, sync_op, invalid_ops, sync_values):
if self._check_stop(sync_op):
log_template = "Product not found or sync disabled " \
"for sync id {0}. Skip it."
_logger.debug(log_template.format(sync_op.id))
ProductSyncAccess.set_sync_no_product(sync_op)
invalid_ops.append(sync_op)
else:
sync_value = self._convert_sync(sync_op)
if sync_value:
sync_values.append(sync_value)
else:
log_template = "Sync id {0} has empty value. Skip it."
_logger.debug(log_template.format(sync_op.id))
ProductSyncAccess.update_sync_new_empty_value(sync_op)
invalid_ops.append(sync_op)
def transform(self, sync_ops):
# we change sync_ops record set because making a copy
# creates a new record set that is saved in table.
sync_ops = self._check_redundant(sync_ops)
sync_values = []
invalid_ops = []
for sync_op in sync_ops:
try:
self._transform_sync(sync_op, invalid_ops, sync_values)
# some pending write syncs or newly-switched new
# write syncs are made redundant by delete and create
if sync_op[SYNC_TYPE_FIELD] in [SYNC_CREATE, SYNC_DELETE]:
self._product_sync.find_set_redundant(sync_op)
except Exception as ex:
log_template = "Sync transform error for sync id {0} " \
"Exception: {1}."
_logger.debug(log_template.format(sync_op.id, ex.message))
ProductSyncAccess.update_sync_new_exception(sync_op, ex)
invalid_ops.append(sync_op)
sync_ops = BaseTransformer._remove_syncs(sync_ops, invalid_ops)
assert(len(sync_ops) == len(sync_values))
return sync_ops, sync_values
# -*- coding: utf-8 -*-
# Auto-generated by Stone, do not modify.
# @generated
# flake8: noqa
# pylint: skip-file
from __future__ import unicode_literals
from stone.backends.python_rsrc import stone_base as bb
from stone.backends.python_rsrc import stone_validators as bv
from dropbox import common
class GroupManagementType(bb.Union):
"""
The group type determines how a group is managed.
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar team_common.GroupManagementType.user_managed: A group which is managed
by selected users.
:ivar team_common.GroupManagementType.company_managed: A group which is
managed by team admins only.
:ivar team_common.GroupManagementType.system_managed: A group which is
managed automatically by Dropbox.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
user_managed = None
# Attribute is overwritten below the class definition
company_managed = None
# Attribute is overwritten below the class definition
system_managed = None
# Attribute is overwritten below the class definition
other = None
def is_user_managed(self):
"""
Check if the union tag is ``user_managed``.
:rtype: bool
"""
return self._tag == 'user_managed'
def is_company_managed(self):
"""
Check if the union tag is ``company_managed``.
:rtype: bool
"""
return self._tag == 'company_managed'
def is_system_managed(self):
"""
Check if the union tag is ``system_managed``.
:rtype: bool
"""
return self._tag == 'system_managed'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GroupManagementType, self)._process_custom_annotations(annotation_type, field_path, processor)
GroupManagementType_validator = bv.Union(GroupManagementType)
class GroupSummary(bb.Struct):
"""
Information about a group.
:ivar team_common.GroupSummary.group_external_id: External ID of group. This
is an arbitrary ID that an admin can attach to a group.
:ivar team_common.GroupSummary.member_count: The number of members in the
group.
:ivar team_common.GroupSummary.group_management_type: Who is allowed to
manage the group.
"""
__slots__ = [
'_group_name_value',
'_group_id_value',
'_group_external_id_value',
'_member_count_value',
'_group_management_type_value',
]
_has_required_fields = True
def __init__(self,
group_name=None,
group_id=None,
group_management_type=None,
group_external_id=None,
member_count=None):
self._group_name_value = bb.NOT_SET
self._group_id_value = bb.NOT_SET
self._group_external_id_value = bb.NOT_SET
self._member_count_value = bb.NOT_SET
self._group_management_type_value = bb.NOT_SET
if group_name is not None:
self.group_name = group_name
if group_id is not None:
self.group_id = group_id
if group_external_id is not None:
self.group_external_id = group_external_id
if member_count is not None:
self.member_count = member_count
if group_management_type is not None:
self.group_management_type = group_management_type
# Instance attribute type: str (validator is set below)
group_name = bb.Attribute("group_name")
# Instance attribute type: str (validator is set below)
group_id = bb.Attribute("group_id")
# Instance attribute type: str (validator is set below)
group_external_id = bb.Attribute("group_external_id", nullable=True)
# Instance attribute type: int (validator is set below)
member_count = bb.Attribute("member_count", nullable=True)
# Instance attribute type: GroupManagementType (validator is set below)
group_management_type = bb.Attribute("group_management_type", user_defined=True)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GroupSummary, self)._process_custom_annotations(annotation_type, field_path, processor)
GroupSummary_validator = bv.Struct(GroupSummary)
class GroupType(bb.Union):
"""
The group type determines how a group is created and managed.
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar team_common.GroupType.team: A group to which team members are
automatically added. Applicable to `team folders
<https://www.dropbox.com/help/986>`_ only.
:ivar team_common.GroupType.user_managed: A group is created and managed by
a user.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
team = None
# Attribute is overwritten below the class definition
user_managed = None
# Attribute is overwritten below the class definition
other = None
def is_team(self):
"""
Check if the union tag is ``team``.
:rtype: bool
"""
return self._tag == 'team'
def is_user_managed(self):
"""
Check if the union tag is ``user_managed``.
:rtype: bool
"""
return self._tag == 'user_managed'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GroupType, self)._process_custom_annotations(annotation_type, field_path, processor)
GroupType_validator = bv.Union(GroupType)
class MemberSpaceLimitType(bb.Union):
"""
The type of the space limit imposed on a team member.
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar team_common.MemberSpaceLimitType.off: The team member does not have
imposed space limit.
:ivar team_common.MemberSpaceLimitType.alert_only: The team member has soft
imposed space limit - the limit is used for display and for
notifications.
:ivar team_common.MemberSpaceLimitType.stop_sync: The team member has hard
imposed space limit - Dropbox file sync will stop after the limit is
reached.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
off = None
# Attribute is overwritten below the class definition
alert_only = None
# Attribute is overwritten below the class definition
stop_sync = None
# Attribute is overwritten below the class definition
other = None
def is_off(self):
"""
Check if the union tag is ``off``.
:rtype: bool
"""
return self._tag == 'off'
def is_alert_only(self):
"""
Check if the union tag is ``alert_only``.
:rtype: bool
"""
return self._tag == 'alert_only'
def is_stop_sync(self):
"""
Check if the union tag is ``stop_sync``.
:rtype: bool
"""
return self._tag == 'stop_sync'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(MemberSpaceLimitType, self)._process_custom_annotations(annotation_type, field_path, processor)
MemberSpaceLimitType_validator = bv.Union(MemberSpaceLimitType)
class TimeRange(bb.Struct):
"""
Time range.
:ivar team_common.TimeRange.start_time: Optional starting time (inclusive).
:ivar team_common.TimeRange.end_time: Optional ending time (exclusive).
"""
__slots__ = [
'_start_time_value',
'_end_time_value',
]
_has_required_fields = False
def __init__(self,
start_time=None,
end_time=None):
self._start_time_value = bb.NOT_SET
self._end_time_value = bb.NOT_SET
if start_time is not None:
self.start_time = start_time
if end_time is not None:
self.end_time = end_time
# Instance attribute type: datetime.datetime (validator is set below)
start_time = bb.Attribute("start_time", nullable=True)
# Instance attribute type: datetime.datetime (validator is set below)
end_time = bb.Attribute("end_time", nullable=True)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(TimeRange, self)._process_custom_annotations(annotation_type, field_path, processor)
TimeRange_validator = bv.Struct(TimeRange)
GroupExternalId_validator = bv.String()
GroupId_validator = bv.String()
MemberExternalId_validator = bv.String(max_length=64)
ResellerId_validator = bv.String()
TeamId_validator = bv.String()
TeamMemberId_validator = bv.String()
GroupManagementType._user_managed_validator = bv.Void()
GroupManagementType._company_managed_validator = bv.Void()
GroupManagementType._system_managed_validator = bv.Void()
GroupManagementType._other_validator = bv.Void()
GroupManagementType._tagmap = {
'user_managed': GroupManagementType._user_managed_validator,
'company_managed': GroupManagementType._company_managed_validator,
'system_managed': GroupManagementType._system_managed_validator,
'other': GroupManagementType._other_validator,
}
GroupManagementType.user_managed = GroupManagementType('user_managed')
GroupManagementType.company_managed = GroupManagementType('company_managed')
GroupManagementType.system_managed = GroupManagementType('system_managed')
GroupManagementType.other = GroupManagementType('other')
GroupSummary.group_name.validator = bv.String()
GroupSummary.group_id.validator = GroupId_validator
GroupSummary.group_external_id.validator = bv.Nullable(GroupExternalId_validator)
GroupSummary.member_count.validator = bv.Nullable(bv.UInt32())
GroupSummary.group_management_type.validator = GroupManagementType_validator
GroupSummary._all_field_names_ = set([
'group_name',
'group_id',
'group_external_id',
'member_count',
'group_management_type',
])
GroupSummary._all_fields_ = [
('group_name', GroupSummary.group_name.validator),
('group_id', GroupSummary.group_id.validator),
('group_external_id', GroupSummary.group_external_id.validator),
('member_count', GroupSummary.member_count.validator),
('group_management_type', GroupSummary.group_management_type.validator),
]
GroupType._team_validator = bv.Void()
GroupType._user_managed_validator = bv.Void()
GroupType._other_validator = bv.Void()
GroupType._tagmap = {
'team': GroupType._team_validator,
'user_managed': GroupType._user_managed_validator,
'other': GroupType._other_validator,
}
GroupType.team = GroupType('team')
GroupType.user_managed = GroupType('user_managed')
GroupType.other = GroupType('other')
MemberSpaceLimitType._off_validator = bv.Void()
MemberSpaceLimitType._alert_only_validator = bv.Void()
MemberSpaceLimitType._stop_sync_validator = bv.Void()
MemberSpaceLimitType._other_validator = bv.Void()
MemberSpaceLimitType._tagmap = {
'off': MemberSpaceLimitType._off_validator,
'alert_only': MemberSpaceLimitType._alert_only_validator,
'stop_sync': MemberSpaceLimitType._stop_sync_validator,
'other': MemberSpaceLimitType._other_validator,
}
MemberSpaceLimitType.off = MemberSpaceLimitType('off')
MemberSpaceLimitType.alert_only = MemberSpaceLimitType('alert_only')
MemberSpaceLimitType.stop_sync = MemberSpaceLimitType('stop_sync')
MemberSpaceLimitType.other = MemberSpaceLimitType('other')
TimeRange.start_time.validator = bv.Nullable(common.DropboxTimestamp_validator)
TimeRange.end_time.validator = bv.Nullable(common.DropboxTimestamp_validator)
TimeRange._all_field_names_ = set([
'start_time',
'end_time',
])
TimeRange._all_fields_ = [
('start_time', TimeRange.start_time.validator),
('end_time', TimeRange.end_time.validator),
]
ROUTES = {
}