• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

chift-oneapi / chift-python-sdk / 7666915815

26 Jan 2024 10:18AM UTC coverage: 98.637%. First build
7666915815

push

github

hhertoghe
reformat

3112 of 3155 relevant lines covered (98.64%)

0.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.24
/chift/models/consumers/invoicing/__init__.py
1
from __future__ import annotations
1✔
2

3
from typing import ClassVar
1✔
4

5
from chift.api.mixins import CreateMixin, PaginationMixin, ReadMixin, UpdateMixin
1✔
6
from chift.openapi.models import Contact as ContactModel
1✔
7
from chift.openapi.models import Invoice as InvoiceModel
1✔
8
from chift.openapi.models import Opportunity as OpportunityModel
1✔
9
from chift.openapi.models import Product as ProductModel
1✔
10
from chift.openapi.models import Tax as TaxModel
1✔
11

12

13
class InvoicingRouter:
1✔
14
    def __init__(self, consumer_id, connection_id):
1✔
15
        self.Product = Product(consumer_id, connection_id)
1✔
16
        self.Invoice = Invoice(consumer_id, connection_id)
1✔
17
        self.Contact = Contact(consumer_id, connection_id)
1✔
18
        self.Opportunity = Opportunity(consumer_id, connection_id)
1✔
19
        self.Tax = Tax(consumer_id, connection_id)
1✔
20
        self.Custom = Custom(consumer_id, connection_id)
1✔
21

22

23
class Product(
1✔
24
    ReadMixin[ProductModel],
25
    PaginationMixin[ProductModel],
26
    CreateMixin[ProductModel],
27
):
28
    chift_vertical: ClassVar = "invoicing"
1✔
29
    chift_model: ClassVar = "products"
1✔
30
    model = ProductModel
1✔
31

32

33
class Invoice(
1✔
34
    ReadMixin[InvoiceModel],
35
    CreateMixin[InvoiceModel],
36
    PaginationMixin[InvoiceModel],
37
):
38
    chift_vertical: ClassVar = "invoicing"
1✔
39
    chift_model: ClassVar = "invoices"
1✔
40
    model = InvoiceModel
1✔
41

42

43
class Contact(
1✔
44
    ReadMixin[ContactModel],
45
    CreateMixin[ContactModel],
46
    PaginationMixin[ContactModel],
47
):
48
    chift_vertical: ClassVar = "invoicing"
1✔
49
    chift_model: ClassVar = "contacts"
1✔
50
    model = ContactModel
1✔
51

52

53
class Opportunity(
1✔
54
    ReadMixin[OpportunityModel],
55
    CreateMixin[OpportunityModel],
56
    PaginationMixin[OpportunityModel],
57
):
58
    chift_vertical: ClassVar = "invoicing"
1✔
59
    chift_model: ClassVar = "opportunities"
1✔
60
    model = OpportunityModel
1✔
61

62

63
class Tax(ReadMixin[TaxModel], PaginationMixin[TaxModel]):
1✔
64
    chift_vertical: ClassVar = "invoicing"
1✔
65
    chift_model: ClassVar = "taxes"
1✔
66
    model = TaxModel
1✔
67

68

69
class Custom(ReadMixin, CreateMixin, UpdateMixin, PaginationMixin):
1✔
70
    chift_vertical: ClassVar = "invoicing"
1✔
71
    chift_model: ClassVar = "custom"
1✔
72

73
    def all(self, custom_path, params=None, client=None, limit=None):
1✔
74
        self.extra_path = custom_path
1✔
75
        return super().all(params=params, map_model=False, client=client, limit=limit)
1✔
76

77
    def create(self, custom_path, data, client=None, params=None):
1✔
78
        self.extra_path = custom_path
×
79
        return super().create(data, map_model=False, client=client, params=params)
×
80

81
    def update(self, custom_path, chift_id, data, client=None, params=None):
1✔
82
        self.extra_path = f"{custom_path}/{chift_id}"
×
83
        return super().update(None, data, map_model=False, client=client, params=params)
×
84

85
    def get(self, custom_path, chift_id, params=None, client=None):
1✔
86
        self.extra_path = f"{custom_path}/{chift_id}"
×
87
        return super().get(chift_id=None, map_model=False, params=params, client=client)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc