Deserializes string to date. :param string: str. :return: date.
(self, string)
| 631 | return value |
| 632 | |
| 633 | def __deserialize_date(self, string): |
| 634 | """Deserializes string to date. |
| 635 | |
| 636 | :param string: str. |
| 637 | :return: date. |
| 638 | """ |
| 639 | try: |
| 640 | return parse(string).date() |
| 641 | except ImportError: |
| 642 | return string |
| 643 | except ValueError: |
| 644 | raise rest.ApiException( |
| 645 | status=0, |
| 646 | reason="Failed to parse `{0}` as date object".format(string) |
| 647 | ) |
| 648 | |
| 649 | def __deserialize_datetime(self, string): |
| 650 | """Deserializes string to datetime. |