InsInvoiceApplyItem.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class InsInvoiceApplyItem(object):
  6. def __init__(self):
  7. self._apply_scope = None
  8. self._expense_type = None
  9. self._ins_biz_no = None
  10. self._ins_biz_type = None
  11. @property
  12. def apply_scope(self):
  13. return self._apply_scope
  14. @apply_scope.setter
  15. def apply_scope(self, value):
  16. self._apply_scope = value
  17. @property
  18. def expense_type(self):
  19. return self._expense_type
  20. @expense_type.setter
  21. def expense_type(self, value):
  22. self._expense_type = value
  23. @property
  24. def ins_biz_no(self):
  25. return self._ins_biz_no
  26. @ins_biz_no.setter
  27. def ins_biz_no(self, value):
  28. self._ins_biz_no = value
  29. @property
  30. def ins_biz_type(self):
  31. return self._ins_biz_type
  32. @ins_biz_type.setter
  33. def ins_biz_type(self, value):
  34. self._ins_biz_type = value
  35. def to_alipay_dict(self):
  36. params = dict()
  37. if self.apply_scope:
  38. if hasattr(self.apply_scope, 'to_alipay_dict'):
  39. params['apply_scope'] = self.apply_scope.to_alipay_dict()
  40. else:
  41. params['apply_scope'] = self.apply_scope
  42. if self.expense_type:
  43. if hasattr(self.expense_type, 'to_alipay_dict'):
  44. params['expense_type'] = self.expense_type.to_alipay_dict()
  45. else:
  46. params['expense_type'] = self.expense_type
  47. if self.ins_biz_no:
  48. if hasattr(self.ins_biz_no, 'to_alipay_dict'):
  49. params['ins_biz_no'] = self.ins_biz_no.to_alipay_dict()
  50. else:
  51. params['ins_biz_no'] = self.ins_biz_no
  52. if self.ins_biz_type:
  53. if hasattr(self.ins_biz_type, 'to_alipay_dict'):
  54. params['ins_biz_type'] = self.ins_biz_type.to_alipay_dict()
  55. else:
  56. params['ins_biz_type'] = self.ins_biz_type
  57. return params
  58. @staticmethod
  59. def from_alipay_dict(d):
  60. if not d:
  61. return None
  62. o = InsInvoiceApplyItem()
  63. if 'apply_scope' in d:
  64. o.apply_scope = d['apply_scope']
  65. if 'expense_type' in d:
  66. o.expense_type = d['expense_type']
  67. if 'ins_biz_no' in d:
  68. o.ins_biz_no = d['ins_biz_no']
  69. if 'ins_biz_type' in d:
  70. o.ins_biz_type = d['ins_biz_type']
  71. return o