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 MicrosoftFraudResults extends DataObject
15: {
16: /**
17: * @var string|null
18: */
19: public ?string $clauseName = null;
20:
21: /**
22: * @var string|null
23: */
24: public ?string $deviceCountryCode = null;
25:
26: /**
27: * @var string|null
28: */
29: public ?string $deviceId = null;
30:
31: /**
32: * @var int|null
33: */
34: public ?int $fraudScore = null;
35:
36: /**
37: * @var string|null
38: */
39: public ?string $policyApplied = null;
40:
41: /**
42: * @var string[]|null
43: */
44: public ?array $reasonCodes = null;
45:
46: /**
47: * @var string|null
48: */
49: public ?string $trueIpAddress = null;
50:
51: /**
52: * @var string|null
53: */
54: public ?string $userDeviceType = null;
55:
56: /**
57: * @return object
58: */
59: public function toObject(): object
60: {
61: $object = parent::toObject();
62: if (!is_null($this->clauseName)) {
63: $object->clauseName = $this->clauseName;
64: }
65: if (!is_null($this->deviceCountryCode)) {
66: $object->deviceCountryCode = $this->deviceCountryCode;
67: }
68: if (!is_null($this->deviceId)) {
69: $object->deviceId = $this->deviceId;
70: }
71: if (!is_null($this->fraudScore)) {
72: $object->fraudScore = $this->fraudScore;
73: }
74: if (!is_null($this->policyApplied)) {
75: $object->policyApplied = $this->policyApplied;
76: }
77: if (!is_null($this->reasonCodes)) {
78: $object->reasonCodes = [];
79: foreach ($this->reasonCodes as $element) {
80: if (!is_null($element)) {
81: $object->reasonCodes[] = $element;
82: }
83: }
84: }
85: if (!is_null($this->trueIpAddress)) {
86: $object->trueIpAddress = $this->trueIpAddress;
87: }
88: if (!is_null($this->userDeviceType)) {
89: $object->userDeviceType = $this->userDeviceType;
90: }
91: return $object;
92: }
93:
94: /**
95: * @param object $object
96: *
97: * @return $this
98: * @throws UnexpectedValueException
99: */
100: public function fromObject(object $object): MicrosoftFraudResults
101: {
102: parent::fromObject($object);
103: if (property_exists($object, 'clauseName')) {
104: $this->clauseName = $object->clauseName;
105: }
106: if (property_exists($object, 'deviceCountryCode')) {
107: $this->deviceCountryCode = $object->deviceCountryCode;
108: }
109: if (property_exists($object, 'deviceId')) {
110: $this->deviceId = $object->deviceId;
111: }
112: if (property_exists($object, 'fraudScore')) {
113: $this->fraudScore = $object->fraudScore;
114: }
115: if (property_exists($object, 'policyApplied')) {
116: $this->policyApplied = $object->policyApplied;
117: }
118: if (property_exists($object, 'reasonCodes')) {
119: if (!is_array($object->reasonCodes) && !is_object($object->reasonCodes)) {
120: throw new UnexpectedValueException('value \'' . print_r($object->reasonCodes, true) . '\' is not an array or object');
121: }
122: $this->reasonCodes = [];
123: foreach ($object->reasonCodes as $element) {
124: $this->reasonCodes[] = $element;
125: }
126: }
127: if (property_exists($object, 'trueIpAddress')) {
128: $this->trueIpAddress = $object->trueIpAddress;
129: }
130: if (property_exists($object, 'userDeviceType')) {
131: $this->userDeviceType = $object->userDeviceType;
132: }
133: return $this;
134: }
135: }
136: