1: <?php
2:
3: declare(strict_types=1);
4:
5: /*
6: * This file has been auto generated by Jane,
7: *
8: * Do no edit it directly.
9: */
10:
11: namespace NxSys\Library\Clients\Brex\API\Payments\Normalizer;
12:
13: use NxSys\Library\Clients\Brex\API\Payments\Runtime\Normalizer\CheckArray;
14: use NxSys\Library\Clients\Brex\API\Payments\Runtime\Normalizer\ValidatorTrait;
15: use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
16: use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
17: use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
18: use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
19: use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
20: use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
21:
22: class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface
23: {
24: use DenormalizerAwareTrait;
25: use NormalizerAwareTrait;
26: use CheckArray;
27: use ValidatorTrait;
28: protected $normalizers = ['NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\ACHDetailsRequest' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\ACHDetailsRequestNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\ACHDetailsResponse' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\ACHDetailsResponseNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\Address' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\AddressNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\Balance' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BalanceNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BankAccountDetailsResponse' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BankAccountDetailsResponseNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BankAccountDetailsResponsebeneficiaryBank' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BankAccountDetailsResponsebeneficiaryBankNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BankConnection' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BankConnectionNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BankConnectionAvailableBalance' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BankConnectionAvailableBalanceNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BankConnectionCurrentBalance' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BankConnectionCurrentBalanceNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BankDetails' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BankDetailsNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BeneficiaryBank' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BeneficiaryBankNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BeneficiaryBankAddress' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BeneficiaryBankAddressNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BookTransferDetails' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BookTransferDetailsNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BookTransferDetailsResponse' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BookTransferDetailsResponseNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BrexCashAccountDetails' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BrexCashAccountDetailsNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BrexCashAccountDetailsResponse' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BrexCashAccountDetailsResponseNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\BrexCashDetails' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\BrexCashDetailsNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\ChequeDetailsRequest' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\ChequeDetailsRequestNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\ChequeDetailsResponse' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\ChequeDetailsResponseNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\CounterPartyBankDetails' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\CounterPartyBankDetailsNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\CreateIncomingTransferRequest' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\CreateIncomingTransferRequestNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\CreateTransferRequest' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\CreateTransferRequestNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\CreateVendorRequest' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\CreateVendorRequestNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\DomesticWireDetailsRequest' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\DomesticWireDetailsRequestNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\DomesticWireDetailsResponse' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\DomesticWireDetailsResponseNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\InternationalWireDetailsResponse' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\InternationalWireDetailsResponseNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\Money' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\MoneyNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\PageBankConnection' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\PageBankConnectionNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\PageTransfer' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\PageTransferNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\PageVendorResponse' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\PageVendorResponseNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\PaymentAccountRequest' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\PaymentAccountRequestNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\PaymentAccountResponse' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\PaymentAccountResponseNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\Recipient' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\RecipientNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\Transfer' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\TransferNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\TransferCounterparty' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\TransferCounterpartyNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\UpdateVendorRequest' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\UpdateVendorRequestNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\VendorDetails' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\VendorDetailsNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\VendorDetailsResponse' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\VendorDetailsResponseNormalizer', 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Model\\VendorResponse' => 'NxSys\\Library\\Clients\\Brex\\API\\Payments\\Normalizer\\VendorResponseNormalizer', '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => '\\NxSys\\Library\\Clients\\Brex\\API\\Payments\\Runtime\\Normalizer\\ReferenceNormalizer'];
29: protected $normalizersCache = [];
30:
31: public function supportsDenormalization($data, $type, $format = null): bool
32: {
33: return array_key_exists($type, $this->normalizers);
34: }
35:
36: public function supportsNormalization($data, $format = null): bool
37: {
38: return is_object($data) && array_key_exists(get_class($data), $this->normalizers);
39: }
40:
41: /**
42: * @return array|string|int|float|bool|\ArrayObject|null
43: */
44: public function normalize($object, $format = null, array $context = [])
45: {
46: $normalizerClass = $this->normalizers[get_class($object)];
47: $normalizer = $this->getNormalizer($normalizerClass);
48:
49: return $normalizer->normalize($object, $format, $context);
50: }
51:
52: /**
53: * @return mixed
54: */
55: public function denormalize($data, $class, $format = null, array $context = [])
56: {
57: $denormalizerClass = $this->normalizers[$class];
58: $denormalizer = $this->getNormalizer($denormalizerClass);
59:
60: return $denormalizer->denormalize($data, $class, $format, $context);
61: }
62:
63: private function getNormalizer(string $normalizerClass)
64: {
65: return $this->normalizersCache[$normalizerClass] ?? $this->initNormalizer($normalizerClass);
66: }
67:
68: private function initNormalizer(string $normalizerClass)
69: {
70: $normalizer = new $normalizerClass();
71: $normalizer->setNormalizer($this->normalizer);
72: $normalizer->setDenormalizer($this->denormalizer);
73: $this->normalizersCache[$normalizerClass] = $normalizer;
74:
75: return $normalizer;
76: }
77: }
78: