|
| 1 | +try: |
| 2 | + from urllib.parse import quote_plus |
| 3 | +except ImportError: |
| 4 | + from urllib import quote_plus |
| 5 | + |
| 6 | +import processout |
| 7 | +import json |
| 8 | + |
| 9 | +from processout.networking.request import Request |
| 10 | +from processout.networking.response import Response |
| 11 | + |
| 12 | +# The content of this file was automatically generated |
| 13 | + |
| 14 | + |
| 15 | +class CardContact(object): |
| 16 | + def __init__(self, client, prefill=None): |
| 17 | + self._client = client |
| 18 | + |
| 19 | + self._address1 = None |
| 20 | + self._address2 = None |
| 21 | + self._city = None |
| 22 | + self._state = None |
| 23 | + self._country_code = None |
| 24 | + self._zip = None |
| 25 | + if prefill is not None: |
| 26 | + self.fill_with_data(prefill) |
| 27 | + |
| 28 | + @property |
| 29 | + def address1(self): |
| 30 | + """Get address1""" |
| 31 | + return self._address1 |
| 32 | + |
| 33 | + @address1.setter |
| 34 | + def address1(self, val): |
| 35 | + """Set address1 |
| 36 | + Keyword argument: |
| 37 | + val -- New address1 value""" |
| 38 | + self._address1 = val |
| 39 | + return self |
| 40 | + |
| 41 | + @property |
| 42 | + def address2(self): |
| 43 | + """Get address2""" |
| 44 | + return self._address2 |
| 45 | + |
| 46 | + @address2.setter |
| 47 | + def address2(self, val): |
| 48 | + """Set address2 |
| 49 | + Keyword argument: |
| 50 | + val -- New address2 value""" |
| 51 | + self._address2 = val |
| 52 | + return self |
| 53 | + |
| 54 | + @property |
| 55 | + def city(self): |
| 56 | + """Get city""" |
| 57 | + return self._city |
| 58 | + |
| 59 | + @city.setter |
| 60 | + def city(self, val): |
| 61 | + """Set city |
| 62 | + Keyword argument: |
| 63 | + val -- New city value""" |
| 64 | + self._city = val |
| 65 | + return self |
| 66 | + |
| 67 | + @property |
| 68 | + def state(self): |
| 69 | + """Get state""" |
| 70 | + return self._state |
| 71 | + |
| 72 | + @state.setter |
| 73 | + def state(self, val): |
| 74 | + """Set state |
| 75 | + Keyword argument: |
| 76 | + val -- New state value""" |
| 77 | + self._state = val |
| 78 | + return self |
| 79 | + |
| 80 | + @property |
| 81 | + def country_code(self): |
| 82 | + """Get country_code""" |
| 83 | + return self._country_code |
| 84 | + |
| 85 | + @country_code.setter |
| 86 | + def country_code(self, val): |
| 87 | + """Set country_code |
| 88 | + Keyword argument: |
| 89 | + val -- New country_code value""" |
| 90 | + self._country_code = val |
| 91 | + return self |
| 92 | + |
| 93 | + @property |
| 94 | + def zip(self): |
| 95 | + """Get zip""" |
| 96 | + return self._zip |
| 97 | + |
| 98 | + @zip.setter |
| 99 | + def zip(self, val): |
| 100 | + """Set zip |
| 101 | + Keyword argument: |
| 102 | + val -- New zip value""" |
| 103 | + self._zip = val |
| 104 | + return self |
| 105 | + |
| 106 | + def fill_with_data(self, data): |
| 107 | + """Fill the current object with the new values pulled from data |
| 108 | + Keyword argument: |
| 109 | + data -- The data from which to pull the new values""" |
| 110 | + if "address1" in data.keys(): |
| 111 | + self.address1 = data["address1"] |
| 112 | + if "address2" in data.keys(): |
| 113 | + self.address2 = data["address2"] |
| 114 | + if "city" in data.keys(): |
| 115 | + self.city = data["city"] |
| 116 | + if "state" in data.keys(): |
| 117 | + self.state = data["state"] |
| 118 | + if "country_code" in data.keys(): |
| 119 | + self.country_code = data["country_code"] |
| 120 | + if "zip" in data.keys(): |
| 121 | + self.zip = data["zip"] |
| 122 | + |
| 123 | + return self |
| 124 | + |
| 125 | + def to_json(self): |
| 126 | + return { |
| 127 | + "address1": self.address1, |
| 128 | + "address2": self.address2, |
| 129 | + "city": self.city, |
| 130 | + "state": self.state, |
| 131 | + "country_code": self.country_code, |
| 132 | + "zip": self.zip, |
| 133 | + } |
0 commit comments