AlipayCommerceIotSnCreateModel.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayCommerceIotSnCreateModel(object):
  6. def __init__(self):
  7. self._content = None
  8. self._create_count = None
  9. self._hardware_product_id = None
  10. self._item_id = None
  11. self._supplier_id = None
  12. @property
  13. def content(self):
  14. return self._content
  15. @content.setter
  16. def content(self, value):
  17. self._content = value
  18. @property
  19. def create_count(self):
  20. return self._create_count
  21. @create_count.setter
  22. def create_count(self, value):
  23. self._create_count = value
  24. @property
  25. def hardware_product_id(self):
  26. return self._hardware_product_id
  27. @hardware_product_id.setter
  28. def hardware_product_id(self, value):
  29. self._hardware_product_id = value
  30. @property
  31. def item_id(self):
  32. return self._item_id
  33. @item_id.setter
  34. def item_id(self, value):
  35. self._item_id = value
  36. @property
  37. def supplier_id(self):
  38. return self._supplier_id
  39. @supplier_id.setter
  40. def supplier_id(self, value):
  41. self._supplier_id = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.content:
  45. if hasattr(self.content, 'to_alipay_dict'):
  46. params['content'] = self.content.to_alipay_dict()
  47. else:
  48. params['content'] = self.content
  49. if self.create_count:
  50. if hasattr(self.create_count, 'to_alipay_dict'):
  51. params['create_count'] = self.create_count.to_alipay_dict()
  52. else:
  53. params['create_count'] = self.create_count
  54. if self.hardware_product_id:
  55. if hasattr(self.hardware_product_id, 'to_alipay_dict'):
  56. params['hardware_product_id'] = self.hardware_product_id.to_alipay_dict()
  57. else:
  58. params['hardware_product_id'] = self.hardware_product_id
  59. if self.item_id:
  60. if hasattr(self.item_id, 'to_alipay_dict'):
  61. params['item_id'] = self.item_id.to_alipay_dict()
  62. else:
  63. params['item_id'] = self.item_id
  64. if self.supplier_id:
  65. if hasattr(self.supplier_id, 'to_alipay_dict'):
  66. params['supplier_id'] = self.supplier_id.to_alipay_dict()
  67. else:
  68. params['supplier_id'] = self.supplier_id
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = AlipayCommerceIotSnCreateModel()
  75. if 'content' in d:
  76. o.content = d['content']
  77. if 'create_count' in d:
  78. o.create_count = d['create_count']
  79. if 'hardware_product_id' in d:
  80. o.hardware_product_id = d['hardware_product_id']
  81. if 'item_id' in d:
  82. o.item_id = d['item_id']
  83. if 'supplier_id' in d:
  84. o.supplier_id = d['supplier_id']
  85. return o