1: <?php
2: /*
3: * This class was auto-generated from the API references found at
4: * https://apireference.connect.worldline-solutions.com/
5: */
6: namespace Worldline\Connect\Sdk\V1\Domain;
7:
8: use UnexpectedValueException;
9: use Worldline\Connect\Sdk\Domain\DataObject;
10:
11: /**
12: * @package Worldline\Connect\Sdk\V1\Domain
13: */
14: class GetIINDetailsResponse extends DataObject
15: {
16: /**
17: * @var string|null
18: */
19: public ?string $binProductType = null;
20:
21: /**
22: * @var IINDetail[]|null
23: */
24: public ?array $coBrands = null;
25:
26: /**
27: * @var string|null
28: */
29: public ?string $countryCode = null;
30:
31: /**
32: * @var bool|null
33: */
34: public ?bool $isAllowedInContext = null;
35:
36: /**
37: * @var string|null
38: */
39: public ?string $issuerName = null;
40:
41: /**
42: * @var int|null
43: */
44: public ?int $paymentProductId = null;
45:
46: /**
47: * @return object
48: */
49: public function toObject(): object
50: {
51: $object = parent::toObject();
52: if (!is_null($this->binProductType)) {
53: $object->binProductType = $this->binProductType;
54: }
55: if (!is_null($this->coBrands)) {
56: $object->coBrands = [];
57: foreach ($this->coBrands as $element) {
58: if (!is_null($element)) {
59: $object->coBrands[] = $element->toObject();
60: }
61: }
62: }
63: if (!is_null($this->countryCode)) {
64: $object->countryCode = $this->countryCode;
65: }
66: if (!is_null($this->isAllowedInContext)) {
67: $object->isAllowedInContext = $this->isAllowedInContext;
68: }
69: if (!is_null($this->issuerName)) {
70: $object->issuerName = $this->issuerName;
71: }
72: if (!is_null($this->paymentProductId)) {
73: $object->paymentProductId = $this->paymentProductId;
74: }
75: return $object;
76: }
77:
78: /**
79: * @param object $object
80: *
81: * @return $this
82: * @throws UnexpectedValueException
83: */
84: public function fromObject(object $object): GetIINDetailsResponse
85: {
86: parent::fromObject($object);
87: if (property_exists($object, 'binProductType')) {
88: $this->binProductType = $object->binProductType;
89: }
90: if (property_exists($object, 'coBrands')) {
91: if (!is_array($object->coBrands) && !is_object($object->coBrands)) {
92: throw new UnexpectedValueException('value \'' . print_r($object->coBrands, true) . '\' is not an array or object');
93: }
94: $this->coBrands = [];
95: foreach ($object->coBrands as $element) {
96: $value = new IINDetail();
97: $this->coBrands[] = $value->fromObject($element);
98: }
99: }
100: if (property_exists($object, 'countryCode')) {
101: $this->countryCode = $object->countryCode;
102: }
103: if (property_exists($object, 'isAllowedInContext')) {
104: $this->isAllowedInContext = $object->isAllowedInContext;
105: }
106: if (property_exists($object, 'issuerName')) {
107: $this->issuerName = $object->issuerName;
108: }
109: if (property_exists($object, 'paymentProductId')) {
110: $this->paymentProductId = $object->paymentProductId;
111: }
112: return $this;
113: }
114: }
115: