|
| 1 | +from ..base_model import BaseModel, AttributeField, RelationField |
| 2 | + |
| 3 | + |
| 4 | +class Invoice(BaseModel): |
| 5 | + class Meta: |
| 6 | + path = "billing/invoices" |
| 7 | + type = "invoices" |
| 8 | + |
| 9 | + account = RelationField("account") |
| 10 | + originated_destinations = RelationField("originated-destinations") |
| 11 | + originated_networks = RelationField("originated-networks") |
| 12 | + terminated_destinations = RelationField("terminated-destinations") |
| 13 | + terminated_networks = RelationField("terminated-networks") |
| 14 | + |
| 15 | + reference = AttributeField("reference") |
| 16 | + state = AttributeField("state") |
| 17 | + invoice_type = AttributeField("invoice-type") |
| 18 | + start_date = AttributeField("start-date") |
| 19 | + end_date = AttributeField("end-date") |
| 20 | + amount_spent = AttributeField("amount-spent") |
| 21 | + amount_earned = AttributeField("amount-earned") |
| 22 | + |
| 23 | + originated_amount_spent = AttributeField("originated-amount-spent") |
| 24 | + originated_amount_earned = AttributeField("originated-amount-earned") |
| 25 | + originated_calls_count = AttributeField("originated-calls-count") |
| 26 | + originated_successful_calls_count = AttributeField( |
| 27 | + "originated-successful-calls-count" |
| 28 | + ) |
| 29 | + originated_calls_duration = AttributeField("originated-calls-duration") |
| 30 | + originated_billing_duration = AttributeField("originated-billing-duration") |
| 31 | + originated_first_call_at = AttributeField("originated-first-call-at") |
| 32 | + originated_last_call_at = AttributeField("originated-last-call-at") |
| 33 | + |
| 34 | + terminated_amount_spent = AttributeField("terminated-amount-spent") |
| 35 | + terminated_amount_earned = AttributeField("terminated-amount-earned") |
| 36 | + terminated_calls_count = AttributeField("terminated-calls-count") |
| 37 | + terminated_successful_calls_count = AttributeField( |
| 38 | + "terminated-successful-calls-count" |
| 39 | + ) |
| 40 | + terminated_calls_duration = AttributeField("terminated-calls-duration") |
| 41 | + terminated_billing_duration = AttributeField("terminated-billing-duration") |
| 42 | + terminated_first_call_at = AttributeField("terminated-first-call-at") |
| 43 | + terminated_last_call_at = AttributeField("terminated-last-call-at") |
| 44 | + |
| 45 | + def creatable_fields(self): |
| 46 | + return ["account", "start_date", "end_date"] |
0 commit comments