diff --git a/openapi.yaml b/openapi.yaml index 00438097..d46325bc 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -20262,6 +20262,7 @@ components: TotalChargesWithTaxes: $ref: '#/components/schemas/NegotiatedRateCharges_TotalChargesWithTaxes' description: 'Negotiated Rate Charges Container. For tiered rates and promotional discounts, if a particular shipment based on zone, origin, destination or even shipment size doesn''t qualify for the existing discount then no negotiated rates container will be returned. Published rates will be the applicable rate.' + nullable: true xml: name: NegotiatedRateCharges NegotiatedRateCharges_ItemizedCharges: diff --git a/openapi/Rating.yaml b/openapi/Rating.yaml index a1767cd3..eb4601d6 100644 --- a/openapi/Rating.yaml +++ b/openapi/Rating.yaml @@ -5012,6 +5012,7 @@ components: even shipment size doesn't qualify for the existing discount then no negotiated rates container will be returned. Published rates will be the applicable rate. maximum: 1 + nullable: true NegotiatedRateCharges_ItemizedCharges: type: object required: diff --git a/src/Api/Model/RateResponseRatedShipment.php b/src/Api/Model/RateResponseRatedShipment.php index d467d376..cfdbc56d 100644 --- a/src/Api/Model/RateResponseRatedShipment.php +++ b/src/Api/Model/RateResponseRatedShipment.php @@ -126,7 +126,7 @@ public function isInitialized($property): bool /** * Negotiated Rate Charges Container. For tiered rates and promotional discounts, if a particular shipment based on zone, origin, destination or even shipment size doesn't qualify for the existing discount then no negotiated rates container will be returned. Published rates will be the applicable rate. * - * @var RatedShipmentNegotiatedRateCharges + * @var RatedShipmentNegotiatedRateCharges|null */ protected $negotiatedRateCharges; /** @@ -529,20 +529,20 @@ public function setTotalChargesWithTaxes(RatedShipmentTotalChargesWithTaxes $tot /** * Negotiated Rate Charges Container. For tiered rates and promotional discounts, if a particular shipment based on zone, origin, destination or even shipment size doesn't qualify for the existing discount then no negotiated rates container will be returned. Published rates will be the applicable rate. * - * @return RatedShipmentNegotiatedRateCharges + * @return RatedShipmentNegotiatedRateCharges|null */ - public function getNegotiatedRateCharges(): RatedShipmentNegotiatedRateCharges + public function getNegotiatedRateCharges(): ?RatedShipmentNegotiatedRateCharges { return $this->negotiatedRateCharges; } /** * Negotiated Rate Charges Container. For tiered rates and promotional discounts, if a particular shipment based on zone, origin, destination or even shipment size doesn't qualify for the existing discount then no negotiated rates container will be returned. Published rates will be the applicable rate. * - * @param RatedShipmentNegotiatedRateCharges $negotiatedRateCharges + * @param RatedShipmentNegotiatedRateCharges|null $negotiatedRateCharges * * @return self */ - public function setNegotiatedRateCharges(RatedShipmentNegotiatedRateCharges $negotiatedRateCharges): self + public function setNegotiatedRateCharges(?RatedShipmentNegotiatedRateCharges $negotiatedRateCharges): self { $this->initialized['negotiatedRateCharges'] = true; $this->negotiatedRateCharges = $negotiatedRateCharges; diff --git a/src/Api/Normalizer/RateResponseRatedShipmentNormalizer.php b/src/Api/Normalizer/RateResponseRatedShipmentNormalizer.php index e79b26d6..045f57c6 100644 --- a/src/Api/Normalizer/RateResponseRatedShipmentNormalizer.php +++ b/src/Api/Normalizer/RateResponseRatedShipmentNormalizer.php @@ -116,10 +116,13 @@ public function denormalize(mixed $data, string $type, string $format = null, ar $object->setTotalChargesWithTaxes($this->denormalizer->denormalize($data['TotalChargesWithTaxes'], \ShipStream\Ups\Api\Model\RatedShipmentTotalChargesWithTaxes::class, 'json', $context)); unset($data['TotalChargesWithTaxes']); } - if (\array_key_exists('NegotiatedRateCharges', $data)) { + if (\array_key_exists('NegotiatedRateCharges', $data) && $data['NegotiatedRateCharges'] !== null) { $object->setNegotiatedRateCharges($this->denormalizer->denormalize($data['NegotiatedRateCharges'], \ShipStream\Ups\Api\Model\RatedShipmentNegotiatedRateCharges::class, 'json', $context)); unset($data['NegotiatedRateCharges']); } + elseif (\array_key_exists('NegotiatedRateCharges', $data) && $data['NegotiatedRateCharges'] === null) { + $object->setNegotiatedRateCharges(null); + } if (\array_key_exists('RatedPackage', $data)) { $values_4 = []; foreach ($data['RatedPackage'] as $value_4) { @@ -336,10 +339,13 @@ public function denormalize($data, $type, $format = null, array $context = []) $object->setTotalChargesWithTaxes($this->denormalizer->denormalize($data['TotalChargesWithTaxes'], \ShipStream\Ups\Api\Model\RatedShipmentTotalChargesWithTaxes::class, 'json', $context)); unset($data['TotalChargesWithTaxes']); } - if (\array_key_exists('NegotiatedRateCharges', $data)) { + if (\array_key_exists('NegotiatedRateCharges', $data) && $data['NegotiatedRateCharges'] !== null) { $object->setNegotiatedRateCharges($this->denormalizer->denormalize($data['NegotiatedRateCharges'], \ShipStream\Ups\Api\Model\RatedShipmentNegotiatedRateCharges::class, 'json', $context)); unset($data['NegotiatedRateCharges']); } + elseif (\array_key_exists('NegotiatedRateCharges', $data) && $data['NegotiatedRateCharges'] === null) { + $object->setNegotiatedRateCharges(null); + } if (\array_key_exists('RatedPackage', $data)) { $values_4 = []; foreach ($data['RatedPackage'] as $value_4) {