|
| 1 | +# WARNING: Do not edit by hand, this file was generated by Crank: |
| 2 | +# |
| 3 | +# https://github.com/gocardless/crank |
| 4 | +# |
| 5 | + |
| 6 | +class BillingRequestWithAction(object): |
| 7 | + """A thin wrapper around a billing_request_with_action, providing easy access to its |
| 8 | + attributes. |
| 9 | +
|
| 10 | + Example: |
| 11 | + billing_request_with_action = client.billing_request_with_actions.get() |
| 12 | + billing_request_with_action.id |
| 13 | + """ |
| 14 | + |
| 15 | + def __init__(self, attributes, api_response): |
| 16 | + self.attributes = attributes |
| 17 | + self.api_response = api_response |
| 18 | + |
| 19 | + @property |
| 20 | + def bank_authorisations(self): |
| 21 | + return self.BankAuthorisations(self.attributes.get('bank_authorisations')) |
| 22 | + |
| 23 | + |
| 24 | + @property |
| 25 | + def billing_requests(self): |
| 26 | + return self.BillingRequests(self.attributes.get('billing_requests')) |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + class BankAuthorisations(object): |
| 32 | + """Wrapper for the response's 'bank_authorisations' attribute.""" |
| 33 | + |
| 34 | + def __init__(self, attributes): |
| 35 | + self.attributes = attributes |
| 36 | + |
| 37 | + @property |
| 38 | + def authorisation_type(self): |
| 39 | + return self.attributes.get('authorisation_type') |
| 40 | + |
| 41 | + @property |
| 42 | + def authorised_at(self): |
| 43 | + return self.attributes.get('authorised_at') |
| 44 | + |
| 45 | + @property |
| 46 | + def created_at(self): |
| 47 | + return self.attributes.get('created_at') |
| 48 | + |
| 49 | + @property |
| 50 | + def expires_at(self): |
| 51 | + return self.attributes.get('expires_at') |
| 52 | + |
| 53 | + @property |
| 54 | + def id(self): |
| 55 | + return self.attributes.get('id') |
| 56 | + |
| 57 | + @property |
| 58 | + def last_visited_at(self): |
| 59 | + return self.attributes.get('last_visited_at') |
| 60 | + |
| 61 | + @property |
| 62 | + def links(self): |
| 63 | + return self.attributes.get('links') |
| 64 | + |
| 65 | + @property |
| 66 | + def qr_code_url(self): |
| 67 | + return self.attributes.get('qr_code_url') |
| 68 | + |
| 69 | + @property |
| 70 | + def redirect_uri(self): |
| 71 | + return self.attributes.get('redirect_uri') |
| 72 | + |
| 73 | + @property |
| 74 | + def url(self): |
| 75 | + return self.attributes.get('url') |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + class BillingRequests(object): |
| 81 | + """Wrapper for the response's 'billing_requests' attribute.""" |
| 82 | + |
| 83 | + def __init__(self, attributes): |
| 84 | + self.attributes = attributes |
| 85 | + |
| 86 | + @property |
| 87 | + def actions(self): |
| 88 | + return self.attributes.get('actions') |
| 89 | + |
| 90 | + @property |
| 91 | + def created_at(self): |
| 92 | + return self.attributes.get('created_at') |
| 93 | + |
| 94 | + @property |
| 95 | + def fallback_enabled(self): |
| 96 | + return self.attributes.get('fallback_enabled') |
| 97 | + |
| 98 | + @property |
| 99 | + def fallback_occurred(self): |
| 100 | + return self.attributes.get('fallback_occurred') |
| 101 | + |
| 102 | + @property |
| 103 | + def id(self): |
| 104 | + return self.attributes.get('id') |
| 105 | + |
| 106 | + @property |
| 107 | + def instalment_schedule_request(self): |
| 108 | + return self.attributes.get('instalment_schedule_request') |
| 109 | + |
| 110 | + @property |
| 111 | + def links(self): |
| 112 | + return self.attributes.get('links') |
| 113 | + |
| 114 | + @property |
| 115 | + def mandate_request(self): |
| 116 | + return self.attributes.get('mandate_request') |
| 117 | + |
| 118 | + @property |
| 119 | + def metadata(self): |
| 120 | + return self.attributes.get('metadata') |
| 121 | + |
| 122 | + @property |
| 123 | + def payment_request(self): |
| 124 | + return self.attributes.get('payment_request') |
| 125 | + |
| 126 | + @property |
| 127 | + def purpose_code(self): |
| 128 | + return self.attributes.get('purpose_code') |
| 129 | + |
| 130 | + @property |
| 131 | + def resources(self): |
| 132 | + return self.attributes.get('resources') |
| 133 | + |
| 134 | + @property |
| 135 | + def status(self): |
| 136 | + return self.attributes.get('status') |
| 137 | + |
| 138 | + @property |
| 139 | + def subscription_request(self): |
| 140 | + return self.attributes.get('subscription_request') |
| 141 | + |
| 142 | + |
| 143 | + |
0 commit comments