AlipayCommerceTransportAdStocktaskCreateModel.py 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.StockQueryCondition import StockQueryCondition
  6. class AlipayCommerceTransportAdStocktaskCreateModel(object):
  7. def __init__(self):
  8. self._ad_user_id = None
  9. self._charge_type = None
  10. self._sell_mode = None
  11. self._stock_query_condition = None
  12. @property
  13. def ad_user_id(self):
  14. return self._ad_user_id
  15. @ad_user_id.setter
  16. def ad_user_id(self, value):
  17. self._ad_user_id = value
  18. @property
  19. def charge_type(self):
  20. return self._charge_type
  21. @charge_type.setter
  22. def charge_type(self, value):
  23. self._charge_type = value
  24. @property
  25. def sell_mode(self):
  26. return self._sell_mode
  27. @sell_mode.setter
  28. def sell_mode(self, value):
  29. self._sell_mode = value
  30. @property
  31. def stock_query_condition(self):
  32. return self._stock_query_condition
  33. @stock_query_condition.setter
  34. def stock_query_condition(self, value):
  35. if isinstance(value, StockQueryCondition):
  36. self._stock_query_condition = value
  37. else:
  38. self._stock_query_condition = StockQueryCondition.from_alipay_dict(value)
  39. def to_alipay_dict(self):
  40. params = dict()
  41. if self.ad_user_id:
  42. if hasattr(self.ad_user_id, 'to_alipay_dict'):
  43. params['ad_user_id'] = self.ad_user_id.to_alipay_dict()
  44. else:
  45. params['ad_user_id'] = self.ad_user_id
  46. if self.charge_type:
  47. if hasattr(self.charge_type, 'to_alipay_dict'):
  48. params['charge_type'] = self.charge_type.to_alipay_dict()
  49. else:
  50. params['charge_type'] = self.charge_type
  51. if self.sell_mode:
  52. if hasattr(self.sell_mode, 'to_alipay_dict'):
  53. params['sell_mode'] = self.sell_mode.to_alipay_dict()
  54. else:
  55. params['sell_mode'] = self.sell_mode
  56. if self.stock_query_condition:
  57. if hasattr(self.stock_query_condition, 'to_alipay_dict'):
  58. params['stock_query_condition'] = self.stock_query_condition.to_alipay_dict()
  59. else:
  60. params['stock_query_condition'] = self.stock_query_condition
  61. return params
  62. @staticmethod
  63. def from_alipay_dict(d):
  64. if not d:
  65. return None
  66. o = AlipayCommerceTransportAdStocktaskCreateModel()
  67. if 'ad_user_id' in d:
  68. o.ad_user_id = d['ad_user_id']
  69. if 'charge_type' in d:
  70. o.charge_type = d['charge_type']
  71. if 'sell_mode' in d:
  72. o.sell_mode = d['sell_mode']
  73. if 'stock_query_condition' in d:
  74. o.stock_query_condition = d['stock_query_condition']
  75. return o