def end_date(self, value): start_date = self.get('startDate') assert_datetime(value, 'end_date', start_date) self['endDate'] = value
def start_date(self, value): end_date = self.get('endDate') assert_datetime(value, 'start_date', upper_bound=end_date) self['startDate'] = value
class DateRangeSpecification(PythonModel): @classmethod def registry(cls): return DateRangeProperty @property @DateRangeProperty.getter( nullable=False, value_validate_function=lambda value: assert_string(value, 'id')) def id(self): return self.get('id') @id.setter @DateRangeProperty.setter() def id(self, value): self['id'] = value @property @DateRangeProperty.getter( nullable=False, value_validate_function=lambda value: assert_enum( value, DateRangeType, argument_name='date_type'), value_formatter_function=lambda value: value.name, ) def date_type(self): return self.get('dateType') @date_type.setter @DateRangeProperty.setter(value_parser_function=deserialize_date_range) def date_type(self, value): self['dateType'] = value @property @DateRangeProperty.getter( nullable=False, value_validate_function=lambda value: assert_datetime( value, 'end_date'), value_formatter_function=stringify_datetime, ) def end_date(self): return self.get('endDate') @end_date.setter @DateRangeProperty.setter(value_parser_function=convert_datetime) def end_date(self, value): start_date = self.get('startDate') assert_datetime(value, 'end_date', start_date) self['endDate'] = value @property @DateRangeProperty.getter( nullable=False, value_validate_function=lambda value: assert_datetime( value, 'start_date'), value_formatter_function=stringify_datetime, ) def start_date(self): return self.get('startDate') @start_date.setter @DateRangeProperty.setter(value_parser_function=convert_datetime) def start_date(self, value): end_date = self.get('endDate') assert_datetime(value, 'start_date', upper_bound=end_date) self['startDate'] = value