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

chift-oneapi / chift-python-sdk / 14660830381

25 Apr 2025 08:56AM UTC coverage: 94.82% (-3.7%) from 98.536%
14660830381

push

github

web-flow
Merge pull request #39 from chift-oneapi/dima/pydatic-v2-migration

feature(sdk): migrate from pydantic.v1 to v2

356 of 361 new or added lines in 26 files covered. (98.61%)

190 existing lines in 13 files now uncovered.

3844 of 4054 relevant lines covered (94.82%)

0.95 hits per line

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

95.58
/chift/openapi/models.py
1
import datetime
1✔
2
from enum import Enum
1✔
3
from typing import List, Optional
1✔
4

5
from pydantic import BaseModel
1✔
6

7
from .openapi import (
1✔
8
    AccountingCategoryItem,
9
    AccountingVatCode,
10
    AccountItem,
11
    AnalyticAccountItemOutMultiAnalyticPlans,
12
    AnalyticPlanItem,
13
    AttachmentItemOut,
14
    BackboneApiAppRoutersConnectionsConnectionItem,
15
    BackboneCommonModelsPosCommonProductCategoryItem,
16
    BalanceItemOut,
17
    CategoryItem,
18
    ClientItemOut,
19
    ClosureItem,
20
    CommerceCustomerItem,
21
    CommerceLocationItemOut,
22
    ConsumerItem,
23
    ContactItemOut,
24
    CountryItem,
25
    DataItem,
26
    DataItemOut,
27
    DataStoreItem,
28
    EmployeeItem,
29
    FinancialEntryItemOut,
30
    IntegrationItem,
31
    InvoiceItemOutMonoAnalyticPlan,
32
    InvoiceItemOutSingle,
33
    InvoicingPaymentItem,
34
    InvoicingPaymentMethodItem,
35
    InvoicingVatCode,
36
    Journal,
37
    JournalEntryMultiAnalyticPlan,
38
    LinkItem,
39
    MatchingOut,
40
    MiscellaneousOperationOut,
41
    MultipleMatchingOut,
42
    OpportunityItem,
43
    OrderItemOut,
44
    OutstandingItem,
45
    PaymentItemOut,
46
    PaymentMethodItem,
47
    PaymentMethods,
48
    PMSAccountingCategoryItem,
49
    PMSClosureItem,
50
    PMSCustomerItem,
51
    PMSInvoiceFullItem,
52
    PMSLocationItem,
53
    PMSOrderItem,
54
    PMSPaymentItem,
55
    PMSPaymentMethods,
56
    PMSTaxRateItem,
57
    POSCustomerItem,
58
    POSLocationItem,
59
    POSOrderItem,
60
    POSPaymentItem,
61
    POSProductItem,
62
    ProductItemOut,
63
    ProductItemOutput,
64
    ReadFlowItem,
65
    ReadSyncItem,
66
    RefundItemOut,
67
    SalesItem,
68
    SupplierItemOut,
69
    SyncConsumerItem,
70
    TaxRateItem,
71
    TransactionItemOut,
72
    VariantItem,
73
    WebhookInstanceGetItem,
74
    WebhookItem,
75
)
76

77
# UNPUBLISHED MODELS
78

79

80
class DatastoreColumn(BaseModel):
1✔
81
    name: str
1✔
82
    title: str
1✔
83
    type: str
1✔
84

85

86
class DatastoreDef(BaseModel):
1✔
87
    columns: List[DatastoreColumn]
1✔
88

89

90
class Datastore(BaseModel):
1✔
91
    id: Optional[str] = None
1✔
92
    name: str
1✔
93
    definition: DatastoreDef
1✔
94

95

96
class LogType(str, Enum):
1✔
97
    INFO = "INFO"
1✔
98
    ERROR = "ERROR"
1✔
99
    WARNING = "WARNING"
1✔
100
    DEBUG = "DEBUG"
1✔
101

102

103
class ConsumerLog(BaseModel):
1✔
104
    logid: str
1✔
105
    type: LogType
1✔
106
    message: str
1✔
107
    when: datetime.datetime
1✔
108
    context: Optional[dict] = None
1✔
109

110

111
class ExecutionType(str, Enum):
1✔
112
    CODE = "code"
1✔
113
    CHAIN = "chain"
1✔
114

115

116
class TriggerType(str, Enum):
1✔
117
    TIMER = "timer"
1✔
118
    EVENT = "event"
1✔
119

120

121
class FlowExecutionCode(BaseModel):
1✔
122
    code: str
1✔
123

124

125
class FlowExecutionChain(BaseModel):
1✔
126
    id: str
1✔
127

128

129
class FlowTriggerTimer(BaseModel):
1✔
130
    cronschedule: str = "*/5 * * * *"
1✔
131

132

133
class FlowTrigger(BaseModel):
1✔
134
    type: TriggerType
1✔
135
    data: Optional[FlowTriggerTimer] = None
1✔
136

137

138
class FlowConfig(BaseModel):
1✔
139
    definitionFields: Optional[List[dict]] = None
1✔
140
    doorkeyFields: Optional[List[dict]] = None
1✔
141
    customFields: Optional[List[dict]] = None
1✔
142
    datastores: Optional[List[Datastore]] = []
1✔
143

144

145
# consumers
146

147

148
class Consumer(ConsumerItem, extra="allow"):
1✔
149
    connectionid: str = None
1✔
150

151
    @property
1✔
152
    def invoicing(self):
1✔
153
        from chift.models.consumers.invoicing import (
1✔
154
            InvoicingRouter,
155
        )  # avoid circular import
156

157
        return InvoicingRouter(self.consumerid, self.connectionid)
1✔
158

159
    @property
1✔
160
    def accounting(self):
1✔
161
        from chift.models.consumers.accounting import (
1✔
162
            AccountingRouter,
163
        )  # avoid circular import
164

165
        return AccountingRouter(self.consumerid, self.connectionid)
1✔
166

167
    @property
1✔
168
    def pos(self):
1✔
169
        from chift.models.consumers.pos import PosRouter  # avoid circular import
1✔
170

171
        return PosRouter(self.consumerid, self.connectionid)
1✔
172

173
    @property
1✔
174
    def pms(self):
1✔
UNCOV
175
        from chift.models.consumers.pms import PmsRouter  # avoid circular import
×
176

UNCOV
177
        return PmsRouter(self.consumerid, self.connectionid)
×
178

179
    @property
1✔
180
    def commerce(self):
1✔
181
        from chift.models.consumers.commerce import (
1✔
182
            CommerceRouter,
183
        )  # avoid circular import
184

185
        return CommerceRouter(self.consumerid, self.connectionid)
1✔
186

187
    @property
1✔
188
    def payment(self):
1✔
189
        from chift.models.consumers.payment import (
1✔
190
            PaymentRouter,
191
        )  # avoid circular import
192

193
        return PaymentRouter(self.consumerid, self.connectionid)
1✔
194

195
    @property
1✔
196
    def custom(self):
1✔
UNCOV
197
        from chift.models.consumers.custom import CustomRouter  # avoid circular import
×
198

UNCOV
199
        return CustomRouter(self.consumerid, self.connectionid)
×
200

201
    @property
1✔
202
    def Connection(self):
1✔
UNCOV
203
        from chift.models.consumers.connection import (
×
204
            Connection,
205
        )  # avoid circular import
206

UNCOV
207
        return Connection(self.consumerid, self.connectionid)
×
208

209
    @property
1✔
210
    def Data(self):
1✔
UNCOV
211
        from chift.models.consumers.data import Data  # avoid circular import
×
212

UNCOV
213
        return Data(self.consumerid, self.connectionid)
×
214

215
    @property
1✔
216
    def Sync(self):
1✔
UNCOV
217
        from chift.models.consumers.sync import Sync  # avoid circular import
×
218

UNCOV
219
        return Sync(self.consumerid, self.connectionid)
×
220

221
    @property
1✔
222
    def Log(self):
1✔
223
        from chift.models.consumers.log import Log  # avoid circular import
1✔
224

225
        return Log(self.consumerid, self.connectionid)
1✔
226

227

228
# syncs
229

230

231
class Sync(ReadSyncItem):
1✔
232
    pass
1✔
233

234

235
class SyncConsumer(SyncConsumerItem):
1✔
236
    pass
1✔
237

238

239
# flow
240

241

242
class Flow(ReadFlowItem):
1✔
243
    pass
1✔
244

245

246
# datastores
247

248

249
class Datastore(DataStoreItem):
1✔
250
    pass
1✔
251

252

253
class DataIn(DataItem):
1✔
254
    pass
1✔
255

256

257
class Data(DataItemOut):
1✔
258
    id: Optional[str] = None
1✔
259

260

261
# webhook
262

263

264
class WebhookInstance(WebhookInstanceGetItem):
1✔
265
    pass
1✔
266

267

268
class WebhookType(WebhookItem):
1✔
269
    pass
1✔
270

271

272
# connections
273
class Connection(BackboneApiAppRoutersConnectionsConnectionItem):
1✔
274
    pass
1✔
275

276

277
class ConnectionLink(LinkItem):
1✔
278
    pass
1✔
279

280

281
# integrations
282
class Integration(IntegrationItem):
1✔
283
    pass
1✔
284

285

286
# invoicing
287

288

289
class Invoice(InvoiceItemOutSingle):
1✔
290
    pass
1✔
291

292

293
class Contact(ContactItemOut):
1✔
294
    pass
1✔
295

296

297
class Product(ProductItemOut):
1✔
298
    pass
1✔
299

300

301
class Opportunity(OpportunityItem):
1✔
302
    pass
1✔
303

304

305
class Tax(InvoicingVatCode):
1✔
306
    pass
1✔
307

308

309
class InvoicingPayment(InvoicingPaymentItem):
1✔
310
    pass
1✔
311

312

313
class InvoicingPaymentMethod(InvoicingPaymentMethodItem):
1✔
314
    pass
1✔
315

316

317
# accounting
318
class AnalyticPlan(AnalyticPlanItem):
1✔
319
    pass
1✔
320

321

322
class AnalyticAccountMultiPlan(AnalyticAccountItemOutMultiAnalyticPlans):
1✔
323
    pass
1✔
324

325

326
class TaxAccounting(AccountingVatCode):
1✔
327
    pass
1✔
328

329

330
class MiscellaneousOperation(MiscellaneousOperationOut):
1✔
331
    pass
1✔
332

333

334
class Account(AccountItem):
1✔
335
    pass
1✔
336

337

338
class Supplier(SupplierItemOut):
1✔
339
    pass
1✔
340

341

342
class Client(ClientItemOut):
1✔
343
    pass
1✔
344

345

346
class Employee(EmployeeItem):
1✔
347
    pass
1✔
348

349

350
class InvoiceAccounting(InvoiceItemOutMonoAnalyticPlan):
1✔
351
    pass
1✔
352

353

354
class JournalEntry(JournalEntryMultiAnalyticPlan):
1✔
355
    pass
1✔
356

357

358
class FinancialEntry(FinancialEntryItemOut):
1✔
359
    pass
1✔
360

361

362
class Outstanding(OutstandingItem):
1✔
363
    pass
1✔
364

365

366
class Journal(Journal):
1✔
367
    pass
1✔
368

369

370
class Matching(MatchingOut):
1✔
371
    pass
1✔
372

373

374
class MultipleMatching(MultipleMatchingOut):
1✔
375
    pass
1✔
376

377

378
class Attachment(AttachmentItemOut):
1✔
379
    pass
1✔
380

381

382
# log
383
class Log(ConsumerLog):
1✔
384
    pass
1✔
385

386

387
# pos
388
class Customer(POSCustomerItem):
1✔
389
    pass
1✔
390

391

392
class PaymentMethods(PaymentMethods):
1✔
393
    pass
1✔
394

395

396
class Sales(SalesItem):
1✔
397
    pass
1✔
398

399

400
class Payment(POSPaymentItem):
1✔
401
    pass
1✔
402

403

404
class Location(POSLocationItem):
1✔
405
    pass
1✔
406

407

408
class Order(POSOrderItem):
1✔
409
    pass
1✔
410

411

412
class Closure(ClosureItem):
1✔
413
    pass
1✔
414

415

416
class POSProductCategory(BackboneCommonModelsPosCommonProductCategoryItem):
1✔
417
    pass
1✔
418

419

420
class POSAccountingCategory(AccountingCategoryItem):
1✔
421
    pass
1✔
422

423

424
class POSProduct(POSProductItem):
1✔
425
    pass
1✔
426

427

428
# pms
429

430

431
class PMSPaymentMethods(PMSPaymentMethods):
1✔
432
    pass
1✔
433

434

435
class PMSPayment(PMSPaymentItem):
1✔
436
    pass
1✔
437

438

439
class PMSLocation(PMSLocationItem):
1✔
440
    pass
1✔
441

442

443
class PMSOrder(PMSOrderItem):
1✔
444
    pass
1✔
445

446

447
class PMSClosure(PMSClosureItem):
1✔
448
    pass
1✔
449

450

451
class PMSAccountingCategory(PMSAccountingCategoryItem):
1✔
452
    pass
1✔
453

454

455
class PMSInvoiceFull(PMSInvoiceFullItem):
1✔
456
    pass
1✔
457

458

459
class PMSCustomer(PMSCustomerItem):
1✔
460
    pass
1✔
461

462

463
class PMSTax(PMSTaxRateItem):
1✔
464
    pass
1✔
465

466

467
# e-commerce
468
class CommerceCustomer(CommerceCustomerItem):
1✔
469
    pass
1✔
470

471

472
class CommerceProduct(ProductItemOutput):
1✔
473
    pass
1✔
474

475

476
class CommerceLocation(CommerceLocationItemOut):
1✔
477
    pass
1✔
478

479

480
class CommerceOrder(OrderItemOut):
1✔
481
    pass
1✔
482

483

484
class CommerceVariant(VariantItem):
1✔
485
    pass
1✔
486

487

488
class CommercePaymentMethod(PaymentMethodItem):
1✔
489
    pass
1✔
490

491

492
class CommerceProductCategory(CategoryItem):
1✔
493
    pass
1✔
494

495

496
class CommerceCountry(CountryItem):
1✔
497
    pass
1✔
498

499

500
class CommerceTax(TaxRateItem):
1✔
501
    pass
1✔
502

503

504
# payment
505

506

507
class PaymentTransaction(TransactionItemOut):
1✔
508
    pass
1✔
509

510

511
class PaymentBalance(BalanceItemOut):
1✔
512
    pass
1✔
513

514

515
class PaymentPayment(PaymentItemOut):
1✔
516
    pass
1✔
517

518

519
class PaymentRefund(RefundItemOut):
1✔
520
    pass
1✔
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

© 2026 Coveralls, Inc