|
| 1 | +from com.alipay.ams.api.model.companyType import CompanyType |
| 2 | +from com.alipay.ams.api.model.address import Address |
| 3 | +from com.alipay.ams.api.model.attachment import Attachment |
| 4 | +from com.alipay.ams.api.model.certificate import Certificate |
| 5 | +from com.alipay.ams.api.model.company_unit_type import CompanyUnitType |
| 6 | +from com.alipay.ams.api.model.contact import Contact |
| 7 | +from com.alipay.ams.api.model.stock_info import StockInfo |
| 8 | + |
| 9 | + |
| 10 | +class Company: |
| 11 | + def __int__(self): |
| 12 | + self.__legal_name = None |
| 13 | + self.__company_type = None #type:CompanyType |
| 14 | + self.__registered_address = None #type:Address |
| 15 | + self.__operating_address = None #type:Address |
| 16 | + self.__incorporation_date = None |
| 17 | + self.__stock_info = None #type:StockInfo |
| 18 | + self.__certificates = None #type:Certificate |
| 19 | + self.__attachments = None #type: list[Attachment] |
| 20 | + self.__company_unit = None #type: CompanyUnitType |
| 21 | + self.__contacts = None #type: list[Contact] |
| 22 | + self.__vatNo = None |
| 23 | + |
| 24 | + @property |
| 25 | + def legal_name(self): |
| 26 | + return self.__legal_name |
| 27 | + |
| 28 | + @legal_name.setter |
| 29 | + def legal_name(self, value): |
| 30 | + self.__legal_name = value |
| 31 | + |
| 32 | + @property |
| 33 | + def company_type(self): |
| 34 | + return self.__company_type |
| 35 | + |
| 36 | + @company_type.setter |
| 37 | + def company_type(self, value): |
| 38 | + self.__company_type = value |
| 39 | + |
| 40 | + @property |
| 41 | + def registered_address(self): |
| 42 | + return self.__registered_address |
| 43 | + |
| 44 | + @registered_address.setter |
| 45 | + def registered_address(self, value): |
| 46 | + self.__registered_address = value |
| 47 | + |
| 48 | + @property |
| 49 | + def operating_address(self): |
| 50 | + return self.__operating_address |
| 51 | + |
| 52 | + @operating_address.setter |
| 53 | + def operating_address(self, value): |
| 54 | + self.__operating_address = value |
| 55 | + |
| 56 | + @property |
| 57 | + def incorporation_date(self): |
| 58 | + return self.__incorporation_date |
| 59 | + |
| 60 | + @incorporation_date.setter |
| 61 | + def incorporation_date(self, value): |
| 62 | + self.__incorporation_date = value |
| 63 | + |
| 64 | + @property |
| 65 | + def stock_info(self): |
| 66 | + return self.__stock_info |
| 67 | + |
| 68 | + @stock_info.setter |
| 69 | + def stock_info(self, value): |
| 70 | + self.__stock_info = value |
| 71 | + |
| 72 | + @property |
| 73 | + def certificates(self): |
| 74 | + return self.__certificates |
| 75 | + |
| 76 | + @certificates.setter |
| 77 | + def certificates(self, value): |
| 78 | + self.__certificates = value |
| 79 | + |
| 80 | + @property |
| 81 | + def attachments(self): |
| 82 | + return self.__attachments |
| 83 | + |
| 84 | + @attachments.setter |
| 85 | + def attachments(self, value): |
| 86 | + self.__attachments = value |
| 87 | + |
| 88 | + @property |
| 89 | + def company_unit(self): |
| 90 | + return self.__company_unit |
| 91 | + |
| 92 | + @company_unit.setter |
| 93 | + def company_unit(self, value): |
| 94 | + self.__company_unit = value |
| 95 | + |
| 96 | + @property |
| 97 | + def contacts(self): |
| 98 | + return self.__contacts |
| 99 | + |
| 100 | + @contacts.setter |
| 101 | + def contacts(self, value): |
| 102 | + self.__contacts = value |
| 103 | + |
| 104 | + @property |
| 105 | + def vatNo(self): |
| 106 | + return self.__vatNo |
| 107 | + @vatNo.setter |
| 108 | + def vatNo(self, value): |
| 109 | + self.__vatNo = value |
| 110 | + |
| 111 | + def to_ams_dict(self): |
| 112 | + params = dict() |
| 113 | + if hasattr(self, 'legal_name') and self.legal_name: |
| 114 | + params['legalName'] = self.legal_name |
| 115 | + if hasattr(self, 'company_type') and self.company_type: |
| 116 | + params['companyType'] = self.company_type.value |
| 117 | + if hasattr(self, 'registered_address') and self.registered_address: |
| 118 | + params['registeredAddress'] = self.registered_address.to_ams_dict() |
| 119 | + if hasattr(self, 'operating_address') and self.operating_address: |
| 120 | + params['operatingAddress'] = self.operating_address.to_ams_dict() |
| 121 | + if hasattr(self, 'incorporation_date') and self.incorporation_date: |
| 122 | + params['incorporationDate'] = self.incorporation_date |
| 123 | + if hasattr(self, 'stock_info') and self.stock_info: |
| 124 | + params['stockInfo'] = self.stock_info.to_ams_dict() |
| 125 | + if hasattr(self, 'certificates') and self.certificates: |
| 126 | + params['certificates'] = self.certificates |
| 127 | + if hasattr(self, 'attachments') and self.attachments: |
| 128 | + params['attachments'] = self.attachments |
| 129 | + for i in range(len(self.attachments)): |
| 130 | + params['attachments'][i] = self.attachments[i].to_ams_dict() |
| 131 | + params['attachments'] = params['attachments'] |
| 132 | + if hasattr(self, 'company_unit') and self.company_unit: |
| 133 | + params['companyUnit'] = self.company_unit.value |
| 134 | + if hasattr(self, 'contacts') and self.contacts: |
| 135 | + params['contacts'] = self.contacts |
| 136 | + for i in range(len(self.contacts)): |
| 137 | + params['contacts'][i] = self.contacts[i].to_ams_dict() |
| 138 | + params['contacts'] = params['contacts'] |
| 139 | + if hasattr(self, 'vatNo') and self.vatNo: |
| 140 | + params['vatNo'] = self.vatNo |
| 141 | + return params |
0 commit comments