AlipayInsSceneInvoiceApplyModel.py 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. from alipay.aop.api.domain.InsAddressee import InsAddressee
  6. from alipay.aop.api.domain.InsInvoiceApplyItem import InsInvoiceApplyItem
  7. class AlipayInsSceneInvoiceApplyModel(object):
  8. def __init__(self):
  9. self._delivery_type = None
  10. self._invoice_addressee = None
  11. self._invoice_apply_item = None
  12. self._invoice_date = None
  13. self._invoice_title = None
  14. self._invoice_type = None
  15. self._out_biz_no = None
  16. self._out_request_no = None
  17. @property
  18. def delivery_type(self):
  19. return self._delivery_type
  20. @delivery_type.setter
  21. def delivery_type(self, value):
  22. self._delivery_type = value
  23. @property
  24. def invoice_addressee(self):
  25. return self._invoice_addressee
  26. @invoice_addressee.setter
  27. def invoice_addressee(self, value):
  28. if isinstance(value, InsAddressee):
  29. self._invoice_addressee = value
  30. else:
  31. self._invoice_addressee = InsAddressee.from_alipay_dict(value)
  32. @property
  33. def invoice_apply_item(self):
  34. return self._invoice_apply_item
  35. @invoice_apply_item.setter
  36. def invoice_apply_item(self, value):
  37. if isinstance(value, InsInvoiceApplyItem):
  38. self._invoice_apply_item = value
  39. else:
  40. self._invoice_apply_item = InsInvoiceApplyItem.from_alipay_dict(value)
  41. @property
  42. def invoice_date(self):
  43. return self._invoice_date
  44. @invoice_date.setter
  45. def invoice_date(self, value):
  46. self._invoice_date = value
  47. @property
  48. def invoice_title(self):
  49. return self._invoice_title
  50. @invoice_title.setter
  51. def invoice_title(self, value):
  52. self._invoice_title = value
  53. @property
  54. def invoice_type(self):
  55. return self._invoice_type
  56. @invoice_type.setter
  57. def invoice_type(self, value):
  58. self._invoice_type = value
  59. @property
  60. def out_biz_no(self):
  61. return self._out_biz_no
  62. @out_biz_no.setter
  63. def out_biz_no(self, value):
  64. self._out_biz_no = value
  65. @property
  66. def out_request_no(self):
  67. return self._out_request_no
  68. @out_request_no.setter
  69. def out_request_no(self, value):
  70. self._out_request_no = value
  71. def to_alipay_dict(self):
  72. params = dict()
  73. if self.delivery_type:
  74. if hasattr(self.delivery_type, 'to_alipay_dict'):
  75. params['delivery_type'] = self.delivery_type.to_alipay_dict()
  76. else:
  77. params['delivery_type'] = self.delivery_type
  78. if self.invoice_addressee:
  79. if hasattr(self.invoice_addressee, 'to_alipay_dict'):
  80. params['invoice_addressee'] = self.invoice_addressee.to_alipay_dict()
  81. else:
  82. params['invoice_addressee'] = self.invoice_addressee
  83. if self.invoice_apply_item:
  84. if hasattr(self.invoice_apply_item, 'to_alipay_dict'):
  85. params['invoice_apply_item'] = self.invoice_apply_item.to_alipay_dict()
  86. else:
  87. params['invoice_apply_item'] = self.invoice_apply_item
  88. if self.invoice_date:
  89. if hasattr(self.invoice_date, 'to_alipay_dict'):
  90. params['invoice_date'] = self.invoice_date.to_alipay_dict()
  91. else:
  92. params['invoice_date'] = self.invoice_date
  93. if self.invoice_title:
  94. if hasattr(self.invoice_title, 'to_alipay_dict'):
  95. params['invoice_title'] = self.invoice_title.to_alipay_dict()
  96. else:
  97. params['invoice_title'] = self.invoice_title
  98. if self.invoice_type:
  99. if hasattr(self.invoice_type, 'to_alipay_dict'):
  100. params['invoice_type'] = self.invoice_type.to_alipay_dict()
  101. else:
  102. params['invoice_type'] = self.invoice_type
  103. if self.out_biz_no:
  104. if hasattr(self.out_biz_no, 'to_alipay_dict'):
  105. params['out_biz_no'] = self.out_biz_no.to_alipay_dict()
  106. else:
  107. params['out_biz_no'] = self.out_biz_no
  108. if self.out_request_no:
  109. if hasattr(self.out_request_no, 'to_alipay_dict'):
  110. params['out_request_no'] = self.out_request_no.to_alipay_dict()
  111. else:
  112. params['out_request_no'] = self.out_request_no
  113. return params
  114. @staticmethod
  115. def from_alipay_dict(d):
  116. if not d:
  117. return None
  118. o = AlipayInsSceneInvoiceApplyModel()
  119. if 'delivery_type' in d:
  120. o.delivery_type = d['delivery_type']
  121. if 'invoice_addressee' in d:
  122. o.invoice_addressee = d['invoice_addressee']
  123. if 'invoice_apply_item' in d:
  124. o.invoice_apply_item = d['invoice_apply_item']
  125. if 'invoice_date' in d:
  126. o.invoice_date = d['invoice_date']
  127. if 'invoice_title' in d:
  128. o.invoice_title = d['invoice_title']
  129. if 'invoice_type' in d:
  130. o.invoice_type = d['invoice_type']
  131. if 'out_biz_no' in d:
  132. o.out_biz_no = d['out_biz_no']
  133. if 'out_request_no' in d:
  134. o.out_request_no = d['out_request_no']
  135. return o