@@ -1601,42 +1601,49 @@ def __init__(self,
1601
1601
by the value of the `model_id` key.
1602
1602
:param list[Element] elements: (optional) Document elements identified by the
1603
1603
service.
1604
- :param list[Tables] tables: (optional) Definition of tables identified in the
1605
- input document.
1606
- :param DocStructure document_structure: (optional) The structure of the input
1607
- document.
1608
- :param list[Parties] parties: (optional) Definitions of the parties identified in
1609
- the input document.
1610
1604
:param list[EffectiveDates] effective_dates: (optional) The date or dates on which
1611
1605
the document becomes effective.
1612
1606
:param list[ContractAmts] contract_amounts: (optional) The monetary amounts that
1613
1607
identify the total amount of the contract that needs to be paid from one party to
1614
1608
another.
1615
1609
:param list[TerminationDates] termination_dates: (optional) The date or dates on
1616
1610
which the document is to be terminated.
1617
- :param list[ContractType] contract_type : (optional) The document's contract type
1611
+ :param list[ContractTypes] contract_types : (optional) The document's contract type
1618
1612
or types as declared in the document.
1613
+ :param list[ContractTerms] contract_terms: (optional) The duration or durations of
1614
+ the contract.
1615
+ :param list[PaymentTerms] payment_terms: (optional) The document's payment
1616
+ duration or durations.
1617
+ :param list[Tables] tables: (optional) Definition of tables identified in the
1618
+ input document.
1619
+ :param DocStructure document_structure: (optional) The structure of the input
1620
+ document.
1621
+ :param list[Parties] parties: (optional) Definitions of the parties identified in
1622
+ the input document.
1619
1623
"""
1620
1624
self .document = document
1621
1625
self .model_id = model_id
1622
1626
self .model_version = model_version
1623
1627
self .elements = elements
1624
- self .tables = tables
1625
- self .document_structure = document_structure
1626
- self .parties = parties
1627
1628
self .effective_dates = effective_dates
1628
1629
self .contract_amounts = contract_amounts
1629
1630
self .termination_dates = termination_dates
1630
- self .contract_type = contract_type
1631
+ self .contract_types = contract_types
1632
+ self .contract_terms = contract_terms
1633
+ self .payment_terms = payment_terms
1634
+ self .tables = tables
1635
+ self .document_structure = document_structure
1636
+ self .parties = parties
1631
1637
1632
1638
@classmethod
1633
1639
def _from_dict (cls , _dict ):
1634
1640
"""Initialize a ClassifyReturn object from a json dictionary."""
1635
1641
args = {}
1636
1642
validKeys = [
1637
- 'document' , 'model_id' , 'model_version' , 'elements' , 'tables' ,
1638
- 'document_structure' , 'parties' , 'effective_dates' ,
1639
- 'contract_amounts' , 'termination_dates' , 'contract_type'
1643
+ 'document' , 'model_id' , 'model_version' , 'elements' ,
1644
+ 'effective_dates' , 'contract_amounts' , 'termination_dates' ,
1645
+ 'contract_types' , 'contract_terms' , 'payment_terms' , 'tables' ,
1646
+ 'document_structure' , 'parties'
1640
1647
]
1641
1648
badKeys = set (_dict .keys ()) - set (validKeys )
1642
1649
if badKeys :
@@ -1653,17 +1660,6 @@ def _from_dict(cls, _dict):
1653
1660
args ['elements' ] = [
1654
1661
Element ._from_dict (x ) for x in (_dict .get ('elements' ))
1655
1662
]
1656
- if 'tables' in _dict :
1657
- args ['tables' ] = [
1658
- Tables ._from_dict (x ) for x in (_dict .get ('tables' ))
1659
- ]
1660
- if 'document_structure' in _dict :
1661
- args ['document_structure' ] = DocStructure ._from_dict (
1662
- _dict .get ('document_structure' ))
1663
- if 'parties' in _dict :
1664
- args ['parties' ] = [
1665
- Parties ._from_dict (x ) for x in (_dict .get ('parties' ))
1666
- ]
1667
1663
if 'effective_dates' in _dict :
1668
1664
args ['effective_dates' ] = [
1669
1665
EffectiveDates ._from_dict (x )
@@ -1679,9 +1675,30 @@ def _from_dict(cls, _dict):
1679
1675
TerminationDates ._from_dict (x )
1680
1676
for x in (_dict .get ('termination_dates' ))
1681
1677
]
1682
- if 'contract_type' in _dict :
1683
- args ['contract_type' ] = [
1684
- ContractType ._from_dict (x ) for x in (_dict .get ('contract_type' ))
1678
+ if 'contract_types' in _dict :
1679
+ args ['contract_types' ] = [
1680
+ ContractTypes ._from_dict (x )
1681
+ for x in (_dict .get ('contract_types' ))
1682
+ ]
1683
+ if 'contract_terms' in _dict :
1684
+ args ['contract_terms' ] = [
1685
+ ContractTerms ._from_dict (x )
1686
+ for x in (_dict .get ('contract_terms' ))
1687
+ ]
1688
+ if 'payment_terms' in _dict :
1689
+ args ['payment_terms' ] = [
1690
+ PaymentTerms ._from_dict (x ) for x in (_dict .get ('payment_terms' ))
1691
+ ]
1692
+ if 'tables' in _dict :
1693
+ args ['tables' ] = [
1694
+ Tables ._from_dict (x ) for x in (_dict .get ('tables' ))
1695
+ ]
1696
+ if 'document_structure' in _dict :
1697
+ args ['document_structure' ] = DocStructure ._from_dict (
1698
+ _dict .get ('document_structure' ))
1699
+ if 'parties' in _dict :
1700
+ args ['parties' ] = [
1701
+ Parties ._from_dict (x ) for x in (_dict .get ('parties' ))
1685
1702
]
1686
1703
return cls (** args )
1687
1704
@@ -1696,14 +1713,6 @@ def _to_dict(self):
1696
1713
_dict ['model_version' ] = self .model_version
1697
1714
if hasattr (self , 'elements' ) and self .elements is not None :
1698
1715
_dict ['elements' ] = [x ._to_dict () for x in self .elements ]
1699
- if hasattr (self , 'tables' ) and self .tables is not None :
1700
- _dict ['tables' ] = [x ._to_dict () for x in self .tables ]
1701
- if hasattr (
1702
- self ,
1703
- 'document_structure' ) and self .document_structure is not None :
1704
- _dict ['document_structure' ] = self .document_structure ._to_dict ()
1705
- if hasattr (self , 'parties' ) and self .parties is not None :
1706
- _dict ['parties' ] = [x ._to_dict () for x in self .parties ]
1707
1716
if hasattr (self ,
1708
1717
'effective_dates' ) and self .effective_dates is not None :
1709
1718
_dict ['effective_dates' ] = [
@@ -1719,8 +1728,24 @@ def _to_dict(self):
1719
1728
_dict ['termination_dates' ] = [
1720
1729
x ._to_dict () for x in self .termination_dates
1721
1730
]
1722
- if hasattr (self , 'contract_type' ) and self .contract_type is not None :
1723
- _dict ['contract_type' ] = [x ._to_dict () for x in self .contract_type ]
1731
+ if hasattr (self , 'contract_types' ) and self .contract_types is not None :
1732
+ _dict ['contract_types' ] = [
1733
+ x ._to_dict () for x in self .contract_types
1734
+ ]
1735
+ if hasattr (self , 'contract_terms' ) and self .contract_terms is not None :
1736
+ _dict ['contract_terms' ] = [
1737
+ x ._to_dict () for x in self .contract_terms
1738
+ ]
1739
+ if hasattr (self , 'payment_terms' ) and self .payment_terms is not None :
1740
+ _dict ['payment_terms' ] = [x ._to_dict () for x in self .payment_terms ]
1741
+ if hasattr (self , 'tables' ) and self .tables is not None :
1742
+ _dict ['tables' ] = [x ._to_dict () for x in self .tables ]
1743
+ if hasattr (
1744
+ self ,
1745
+ 'document_structure' ) and self .document_structure is not None :
1746
+ _dict ['document_structure' ] = self .document_structure ._to_dict ()
1747
+ if hasattr (self , 'parties' ) and self .parties is not None :
1748
+ _dict ['parties' ] = [x ._to_dict () for x in self .parties ]
1724
1749
return _dict
1725
1750
1726
1751
def __str__ (self ):
0 commit comments