Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 2.0.0
- Package version: 3.8.0
- Package version: 3.9.0
- Generator version: 7.13.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

Expand Down
10 changes: 10 additions & 0 deletions bcoas2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3130,6 +3130,11 @@ components:
anyOf:
- nullable: true
- $ref: '#/components/schemas/account'
dimensionSetLines:
type: array
nullable: true
items:
$ref: '#/components/schemas/dimensionSetLine'
pdfDocument:
type: object
properties:
Expand Down Expand Up @@ -7063,6 +7068,11 @@ components:
format: date
nullable: true
description: (v1.0) The shipmentDate property for the Dynamics 365 Business Central salesCreditMemoLine entity
dimensionSetLines:
type: array
nullable: true
items:
$ref: '#/components/schemas/dimensionSetLine'
salesCreditMemo:
required: true
content:
Expand Down
1 change: 1 addition & 0 deletions docs/PostSalesCreditMemoLineForSalesCreditMemoRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Name | Type | Description | Notes
**net_tax_amount** | **float** | (v1.0) The netTaxAmount property for the Dynamics 365 Business Central salesCreditMemoLine entity | [optional]
**net_amount_including_tax** | **float** | (v1.0) The netAmountIncludingTax property for the Dynamics 365 Business Central salesCreditMemoLine entity | [optional]
**shipment_date** | **date** | (v1.0) The shipmentDate property for the Dynamics 365 Business Central salesCreditMemoLine entity | [optional]
**dimension_set_lines** | [**List[DimensionSetLine]**](DimensionSetLine.md) | | [optional]

## Example

Expand Down
1 change: 1 addition & 0 deletions docs/SalesCreditMemoLine.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Name | Type | Description | Notes
**shipment_date** | **date** | (v1.0) The shipmentDate property for the Dynamics 365 Business Central salesCreditMemoLine entity | [optional]
**item** | [**Item**](Item.md) | | [optional]
**account** | [**Account**](Account.md) | | [optional]
**dimension_set_lines** | [**List[DimensionSetLine]**](DimensionSetLine.md) | | [optional]

## Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing_extensions import Annotated
from pybusinesscentral.model.dimension_set_line import DimensionSetLine
from pybusinesscentral.model.documentlineobjectdetailstype import Documentlineobjectdetailstype
from pybusinesscentral.model.unitofmeasuretype import Unitofmeasuretype
from typing import Optional, Set
Expand Down Expand Up @@ -55,7 +56,8 @@ class PostSalesCreditMemoLineForSalesCreditMemoRequest(BaseModel):
net_tax_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="(v1.0) The netTaxAmount property for the Dynamics 365 Business Central salesCreditMemoLine entity", alias="netTaxAmount")
net_amount_including_tax: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="(v1.0) The netAmountIncludingTax property for the Dynamics 365 Business Central salesCreditMemoLine entity", alias="netAmountIncludingTax")
shipment_date: Optional[date] = Field(default=None, description="(v1.0) The shipmentDate property for the Dynamics 365 Business Central salesCreditMemoLine entity", alias="shipmentDate")
__properties: ClassVar[List[str]] = ["id", "documentId", "sequence", "itemId", "accountId", "lineType", "lineDetails", "description", "unitOfMeasureId", "unitOfMeasure", "unitPrice", "quantity", "discountAmount", "discountPercent", "discountAppliedBeforeTax", "amountExcludingTax", "taxCode", "taxPercent", "totalTaxAmount", "amountIncludingTax", "invoiceDiscountAllocation", "netAmount", "netTaxAmount", "netAmountIncludingTax", "shipmentDate"]
dimension_set_lines: Optional[List[DimensionSetLine]] = Field(default=None, alias="dimensionSetLines")
__properties: ClassVar[List[str]] = ["id", "documentId", "sequence", "itemId", "accountId", "lineType", "lineDetails", "description", "unitOfMeasureId", "unitOfMeasure", "unitPrice", "quantity", "discountAmount", "discountPercent", "discountAppliedBeforeTax", "amountExcludingTax", "taxCode", "taxPercent", "totalTaxAmount", "amountIncludingTax", "invoiceDiscountAllocation", "netAmount", "netTaxAmount", "netAmountIncludingTax", "shipmentDate", "dimensionSetLines"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -102,6 +104,13 @@ def to_dict(self) -> Dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of unit_of_measure
if self.unit_of_measure:
_dict['unitOfMeasure'] = self.unit_of_measure.to_dict()
# override the default output from pydantic by calling `to_dict()` of each item in dimension_set_lines (list)
_items = []
if self.dimension_set_lines:
for _item_dimension_set_lines in self.dimension_set_lines:
if _item_dimension_set_lines:
_items.append(_item_dimension_set_lines.to_dict())
_dict['dimensionSetLines'] = _items
# set to None if document_id (nullable) is None
# and model_fields_set contains the field
if self.document_id is None and "document_id" in self.model_fields_set:
Expand Down Expand Up @@ -222,6 +231,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.shipment_date is None and "shipment_date" in self.model_fields_set:
_dict['shipmentDate'] = None

# set to None if dimension_set_lines (nullable) is None
# and model_fields_set contains the field
if self.dimension_set_lines is None and "dimension_set_lines" in self.model_fields_set:
_dict['dimensionSetLines'] = None

return _dict

@classmethod
Expand Down Expand Up @@ -258,7 +272,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"netAmount": obj.get("netAmount"),
"netTaxAmount": obj.get("netTaxAmount"),
"netAmountIncludingTax": obj.get("netAmountIncludingTax"),
"shipmentDate": obj.get("shipmentDate")
"shipmentDate": obj.get("shipmentDate"),
"dimensionSetLines": [DimensionSetLine.from_dict(_item) for _item in obj["dimensionSetLines"]] if obj.get("dimensionSetLines") is not None else None
})
return _obj

Expand Down
19 changes: 17 additions & 2 deletions pybusinesscentral/model/sales_credit_memo_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing_extensions import Annotated
from pybusinesscentral.model.account import Account
from pybusinesscentral.model.dimension_set_line import DimensionSetLine
from pybusinesscentral.model.documentlineobjectdetailstype import Documentlineobjectdetailstype
from pybusinesscentral.model.item import Item
from pybusinesscentral.model.unitofmeasuretype import Unitofmeasuretype
Expand Down Expand Up @@ -59,7 +60,8 @@ class SalesCreditMemoLine(BaseModel):
shipment_date: Optional[date] = Field(default=None, description="(v1.0) The shipmentDate property for the Dynamics 365 Business Central salesCreditMemoLine entity", alias="shipmentDate")
item: Optional[Item] = None
account: Optional[Account] = None
__properties: ClassVar[List[str]] = ["id", "documentId", "sequence", "itemId", "accountId", "lineType", "lineDetails", "description", "unitOfMeasureId", "unitOfMeasure", "unitPrice", "quantity", "discountAmount", "discountPercent", "discountAppliedBeforeTax", "amountExcludingTax", "taxCode", "taxPercent", "totalTaxAmount", "amountIncludingTax", "invoiceDiscountAllocation", "netAmount", "netTaxAmount", "netAmountIncludingTax", "shipmentDate", "item", "account"]
dimension_set_lines: Optional[List[DimensionSetLine]] = Field(default=None, alias="dimensionSetLines")
__properties: ClassVar[List[str]] = ["id", "documentId", "sequence", "itemId", "accountId", "lineType", "lineDetails", "description", "unitOfMeasureId", "unitOfMeasure", "unitPrice", "quantity", "discountAmount", "discountPercent", "discountAppliedBeforeTax", "amountExcludingTax", "taxCode", "taxPercent", "totalTaxAmount", "amountIncludingTax", "invoiceDiscountAllocation", "netAmount", "netTaxAmount", "netAmountIncludingTax", "shipmentDate", "item", "account", "dimensionSetLines"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -112,6 +114,13 @@ def to_dict(self) -> Dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of account
if self.account:
_dict['account'] = self.account.to_dict()
# override the default output from pydantic by calling `to_dict()` of each item in dimension_set_lines (list)
_items = []
if self.dimension_set_lines:
for _item_dimension_set_lines in self.dimension_set_lines:
if _item_dimension_set_lines:
_items.append(_item_dimension_set_lines.to_dict())
_dict['dimensionSetLines'] = _items
# set to None if document_id (nullable) is None
# and model_fields_set contains the field
if self.document_id is None and "document_id" in self.model_fields_set:
Expand Down Expand Up @@ -242,6 +251,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.account is None and "account" in self.model_fields_set:
_dict['account'] = None

# set to None if dimension_set_lines (nullable) is None
# and model_fields_set contains the field
if self.dimension_set_lines is None and "dimension_set_lines" in self.model_fields_set:
_dict['dimensionSetLines'] = None

return _dict

@classmethod
Expand Down Expand Up @@ -280,7 +294,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"netAmountIncludingTax": obj.get("netAmountIncludingTax"),
"shipmentDate": obj.get("shipmentDate"),
"item": Item.from_dict(obj["item"]) if obj.get("item") is not None else None,
"account": Account.from_dict(obj["account"]) if obj.get("account") is not None else None
"account": Account.from_dict(obj["account"]) if obj.get("account") is not None else None,
"dimensionSetLines": [DimensionSetLine.from_dict(_item) for _item in obj["dimensionSetLines"]] if obj.get("dimensionSetLines") is not None else None
})
return _obj

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pybusinesscentral"
version = "3.8.0"
version = "3.9.0"
description = "(v2.0) Dynamics 365 Business Central"
authors = ["Uptick <support@uptickhq.com>"]
license = "NoLicense"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
NAME = "pybusinesscentral"
VERSION = "3.8.0"
VERSION = "3.9.0"
PYTHON_REQUIRES = ">= 3.9"
REQUIRES = [
"urllib3 >= 2.1.0, < 3.0.0",
Expand Down