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 FraudResults extends DataObject
15: {
16: /**
17: * @var CybersourceDecisionManager|null
18: */
19: public ?CybersourceDecisionManager $cybersourceDecisionManager = null;
20:
21: /**
22: * @var string|null
23: */
24: public ?string $fraudServiceResult = null;
25:
26: /**
27: * @var InAuth|null
28: */
29: public ?InAuth $inAuth = null;
30:
31: /**
32: * @var MicrosoftFraudResults|null
33: */
34: public ?MicrosoftFraudResults $microsoftFraudProtection = null;
35:
36: /**
37: * @return object
38: */
39: public function toObject(): object
40: {
41: $object = parent::toObject();
42: if (!is_null($this->cybersourceDecisionManager)) {
43: $object->cybersourceDecisionManager = $this->cybersourceDecisionManager->toObject();
44: }
45: if (!is_null($this->fraudServiceResult)) {
46: $object->fraudServiceResult = $this->fraudServiceResult;
47: }
48: if (!is_null($this->inAuth)) {
49: $object->inAuth = $this->inAuth->toObject();
50: }
51: if (!is_null($this->microsoftFraudProtection)) {
52: $object->microsoftFraudProtection = $this->microsoftFraudProtection->toObject();
53: }
54: return $object;
55: }
56:
57: /**
58: * @param object $object
59: *
60: * @return $this
61: * @throws UnexpectedValueException
62: */
63: public function fromObject(object $object): FraudResults
64: {
65: parent::fromObject($object);
66: if (property_exists($object, 'cybersourceDecisionManager')) {
67: if (!is_object($object->cybersourceDecisionManager)) {
68: throw new UnexpectedValueException('value \'' . print_r($object->cybersourceDecisionManager, true) . '\' is not an object');
69: }
70: $value = new CybersourceDecisionManager();
71: $this->cybersourceDecisionManager = $value->fromObject($object->cybersourceDecisionManager);
72: }
73: if (property_exists($object, 'fraudServiceResult')) {
74: $this->fraudServiceResult = $object->fraudServiceResult;
75: }
76: if (property_exists($object, 'inAuth')) {
77: if (!is_object($object->inAuth)) {
78: throw new UnexpectedValueException('value \'' . print_r($object->inAuth, true) . '\' is not an object');
79: }
80: $value = new InAuth();
81: $this->inAuth = $value->fromObject($object->inAuth);
82: }
83: if (property_exists($object, 'microsoftFraudProtection')) {
84: if (!is_object($object->microsoftFraudProtection)) {
85: throw new UnexpectedValueException('value \'' . print_r($object->microsoftFraudProtection, true) . '\' is not an object');
86: }
87: $value = new MicrosoftFraudResults();
88: $this->microsoftFraudProtection = $value->fromObject($object->microsoftFraudProtection);
89: }
90: return $this;
91: }
92: }
93: