Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
xvantage-integration committed Nov 11, 2024
1 parent 4eba786 commit 049b737
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
17 changes: 16 additions & 1 deletion xi/sdk/resellers/models/price_and_availability_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PriceAndAvailabilityRequest(BaseModel):
special_bid_number: Optional[StrictStr] = Field(default=None, description="Pre-approved special pricing/bid number provided to the reseller by the vendor for special pricing and discounts. Used to track the bid number where different line items have different bid numbers.", alias="specialBidNumber")
availability_by_warehouse: Optional[List[PriceAndAvailabilityRequestAvailabilityByWarehouseInner]] = Field(default=None, alias="availabilityByWarehouse")
products: Optional[List[PriceAndAvailabilityRequestProductsInner]] = None
additional_attributes: Optional[List[PriceAndAvailabilityRequestAdditionalAttributesInner]] = Field(default=None, alias="additionalAttributes")
additional_attributes: Optional[List[Optional[PriceAndAvailabilityRequestAdditionalAttributesInner]]] = Field(default=None, alias="additionalAttributes")
__properties: ClassVar[List[str]] = ["showAvailableDiscounts", "showReserveInventoryDetails", "specialBidNumber", "availabilityByWarehouse", "products", "additionalAttributes"]

model_config = ConfigDict(
Expand Down Expand Up @@ -97,6 +97,21 @@ def to_dict(self) -> Dict[str, Any]:
if _item_additional_attributes:
_items.append(_item_additional_attributes.to_dict())
_dict['additionalAttributes'] = _items
# set to None if special_bid_number (nullable) is None
# and model_fields_set contains the field
if self.special_bid_number is None and "special_bid_number" in self.model_fields_set:
_dict['specialBidNumber'] = None

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

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

return _dict

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# set to None if attribute_name (nullable) is None
# and model_fields_set contains the field
if self.attribute_name is None and "attribute_name" in self.model_fields_set:
_dict['attributeName'] = None

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

return _dict

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# set to None if availability_by_warehouse_id (nullable) is None
# and model_fields_set contains the field
if self.availability_by_warehouse_id is None and "availability_by_warehouse_id" in self.model_fields_set:
_dict['availabilityByWarehouseId'] = None

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

return _dict

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PriceAndAvailabilityRequestProductsInner(BaseModel):
upc: Optional[StrictStr] = Field(default=None, description="The UPC code for the product. Consists of 12 numeric digits that are uniquely assigned to each trade item.")
quantity_requested: Optional[StrictStr] = Field(default=None, description="Number of quantity of the Product.", alias="quantityRequested")
plan_id: Optional[StrictStr] = Field(default=None, description="Id of the plan", alias="planID")
additional_attributes: Optional[List[PriceAndAvailabilityRequestProductsInnerAdditionalAttributesInner]] = Field(default=None, alias="additionalAttributes")
additional_attributes: Optional[List[Optional[PriceAndAvailabilityRequestProductsInnerAdditionalAttributesInner]]] = Field(default=None, alias="additionalAttributes")
__properties: ClassVar[List[str]] = ["ingramPartNumber", "vendorPartNumber", "customerPartNumber", "upc", "quantityRequested", "planID", "additionalAttributes"]

model_config = ConfigDict(
Expand Down Expand Up @@ -112,6 +112,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.plan_id is None and "plan_id" in self.model_fields_set:
_dict['planID'] = None

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

return _dict

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# set to None if attribute_name (nullable) is None
# and model_fields_set contains the field
if self.attribute_name is None and "attribute_name" in self.model_fields_set:
_dict['attributeName'] = None

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

return _dict

@classmethod
Expand Down

0 comments on commit 049b737

Please sign in to comment.