Deserializes string to date. :param string: str. :return: date.
(self, string)
| 742 | return value |
| 743 | |
| 744 | def __deserialize_date(self, string): |
| 745 | """Deserializes string to date. |
| 746 | |
| 747 | :param string: str. |
| 748 | :return: date. |
| 749 | """ |
| 750 | try: |
| 751 | return parse(string).date() |
| 752 | except ImportError: |
| 753 | return string |
| 754 | except ValueError: |
| 755 | raise rest.ApiException( |
| 756 | status=0, |
| 757 | reason="Failed to parse `{0}` as date object".format(string) |
| 758 | ) |
| 759 | |
| 760 | def __deserialize_datetime(self, string): |
| 761 | """Deserializes string to datetime. |