|
| 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 ApplePayAlternativeMerchantCertificates(object): |
| 16 | + def __init__(self, client, prefill=None): |
| 17 | + self._client = client |
| 18 | + |
| 19 | + self._alternative_merchant_certificates = None |
| 20 | + if prefill is not None: |
| 21 | + self.fill_with_data(prefill) |
| 22 | + |
| 23 | + @property |
| 24 | + def alternative_merchant_certificates(self): |
| 25 | + """Get alternative_merchant_certificates""" |
| 26 | + return self._alternative_merchant_certificates |
| 27 | + |
| 28 | + @alternative_merchant_certificates.setter |
| 29 | + def alternative_merchant_certificates(self, val): |
| 30 | + """Set alternative_merchant_certificates |
| 31 | + Keyword argument: |
| 32 | + val -- New alternative_merchant_certificates value""" |
| 33 | + if val is None: |
| 34 | + self._alternative_merchant_certificates = [] |
| 35 | + return self |
| 36 | + |
| 37 | + if len(val) > 0 and isinstance( |
| 38 | + val[0], processout.AlternativeMerchantCertificate): |
| 39 | + self._alternative_merchant_certificates = val |
| 40 | + else: |
| 41 | + l = [] |
| 42 | + for v in val: |
| 43 | + obj = processout.AlternativeMerchantCertificate(self._client) |
| 44 | + obj.fill_with_data(v) |
| 45 | + l.append(obj) |
| 46 | + self._alternative_merchant_certificates = l |
| 47 | + return self |
| 48 | + |
| 49 | + def fill_with_data(self, data): |
| 50 | + """Fill the current object with the new values pulled from data |
| 51 | + Keyword argument: |
| 52 | + data -- The data from which to pull the new values""" |
| 53 | + if "alternative_merchant_certificates" in data.keys(): |
| 54 | + self.alternative_merchant_certificates = data["alternative_merchant_certificates"] |
| 55 | + |
| 56 | + return self |
| 57 | + |
| 58 | + def to_json(self): |
| 59 | + return { |
| 60 | + "alternative_merchant_certificates": self.alternative_merchant_certificates, |
| 61 | + } |
| 62 | + |
| 63 | + def fetch(self, options={}): |
| 64 | + """Fetch the project's alternative certificates by ID |
| 65 | + Keyword argument: |
| 66 | +
|
| 67 | + options -- Options for the request""" |
| 68 | + self.fill_with_data(options) |
| 69 | + |
| 70 | + request = Request(self._client) |
| 71 | + path = "/projects/applepay/alternative-merchant-certificates" |
| 72 | + data = { |
| 73 | + |
| 74 | + } |
| 75 | + |
| 76 | + response = Response(request.get(path, data, options)) |
| 77 | + return_values = [] |
| 78 | + |
| 79 | + body = response.body |
| 80 | + body = body["applepay_certificates"] |
| 81 | + applePayAlternativeMerchantCertificates = processout.ApplePayAlternativeMerchantCertificates( |
| 82 | + self._client) |
| 83 | + return_values.append( |
| 84 | + applePayAlternativeMerchantCertificates.fill_with_data(body)) |
| 85 | + |
| 86 | + return return_values[0] |
0 commit comments