New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Schedules Support Round 2 #48
Changes from 1 commit
03e8ce3
312a1c7
b32a632
0adb03f
66e1793
0342bed
bb9ff8f
34457b3
f4490fb
79271a1
b710d9d
46cc1d0
fd17154
371b6f9
28ebb9e
c330687
d7add3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import xml.etree.ElementTree as ET | ||
from .interval_item import IntervalItem | ||
from .property_decorators import property_is_enum, property_is_boolean, property_not_empty, property_not_nullable | ||
from .. import NAMESPACE | ||
|
||
|
||
|
@@ -49,12 +50,9 @@ def execution_order(self): | |
return self._execution_order | ||
|
||
@execution_order.setter | ||
@property_is_enum(ExecutionOrder) | ||
def execution_order(self, value): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to update this with @LGraber 's decorators still |
||
if value and not hasattr(ScheduleItem.ExecutionOrder, value): | ||
error = "Invalid execution order defined: {}.".format(value) | ||
raise ValueError(error) | ||
else: | ||
self._execution_order = value | ||
self._execution_order = value | ||
|
||
@property | ||
def frequency(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is supposed to access the interval's frequency There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, the frequency is on the schedule, the interval is the frequencyDetail http://onlinehelp.tableau.com/samples/en-us/rest_api/ts-api_2_3.xsd |
||
|
@@ -69,12 +67,9 @@ def name(self): | |
return self._name | ||
|
||
@name.setter | ||
@property_not_nullable | ||
def name(self, value): | ||
if not value: | ||
error = "Name must be defined." | ||
raise ValueError(error) | ||
else: | ||
self._name = value | ||
self._name = value | ||
|
||
@property | ||
def next_run_at(self): | ||
|
@@ -97,27 +92,19 @@ def schedule_type(self): | |
return self._schedule_type | ||
|
||
@schedule_type.setter | ||
@property_is_enum(Type) | ||
@property_not_nullable | ||
def schedule_type(self, value): | ||
if not value: | ||
error = "Schedule type must be defined." | ||
raise ValueError(error) | ||
elif not hasattr(ScheduleItem.Type, value): | ||
error = "Invalid schedule type defined: {}.".format(value) | ||
raise ValueError(error) | ||
else: | ||
self._schedule_type = value | ||
self._schedule_type = value | ||
|
||
@property | ||
def state(self): | ||
return self._state | ||
|
||
@state.setter | ||
@property_is_enum(State) | ||
def state(self, value): | ||
if not hasattr(ScheduleItem.State, value): | ||
error = "Invalid state defined." | ||
raise ValueError(error) | ||
else: | ||
self._state = value | ||
self._state = value | ||
|
||
@property | ||
def updated_at(self): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove the imports I'm not using, copy/paste error