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:
10: /**
11: * @package Worldline\Connect\Sdk\V1\Domain
12: */
13: class SepaDirectDebitPaymentMethodSpecificInput extends AbstractSepaDirectDebitPaymentMethodSpecificInput
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $dateCollect = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $directDebitText = null;
24:
25: /**
26: * @var bool|null
27: */
28: public ?bool $isRecurring = null;
29:
30: /**
31: * @var SepaDirectDebitPaymentProduct771SpecificInput|null
32: */
33: public ?SepaDirectDebitPaymentProduct771SpecificInput $paymentProduct771SpecificInput = null;
34:
35: /**
36: * @var string|null
37: */
38: public ?string $recurringPaymentSequenceIndicator = null;
39:
40: /**
41: * @var bool|null
42: */
43: public ?bool $requiresApproval = null;
44:
45: /**
46: * @var string|null
47: */
48: public ?string $token = null;
49:
50: /**
51: * @var bool|null
52: */
53: public ?bool $tokenize = null;
54:
55: /**
56: * @return object
57: */
58: public function toObject(): object
59: {
60: $object = parent::toObject();
61: if (!is_null($this->dateCollect)) {
62: $object->dateCollect = $this->dateCollect;
63: }
64: if (!is_null($this->directDebitText)) {
65: $object->directDebitText = $this->directDebitText;
66: }
67: if (!is_null($this->isRecurring)) {
68: $object->isRecurring = $this->isRecurring;
69: }
70: if (!is_null($this->paymentProduct771SpecificInput)) {
71: $object->paymentProduct771SpecificInput = $this->paymentProduct771SpecificInput->toObject();
72: }
73: if (!is_null($this->recurringPaymentSequenceIndicator)) {
74: $object->recurringPaymentSequenceIndicator = $this->recurringPaymentSequenceIndicator;
75: }
76: if (!is_null($this->requiresApproval)) {
77: $object->requiresApproval = $this->requiresApproval;
78: }
79: if (!is_null($this->token)) {
80: $object->token = $this->token;
81: }
82: if (!is_null($this->tokenize)) {
83: $object->tokenize = $this->tokenize;
84: }
85: return $object;
86: }
87:
88: /**
89: * @param object $object
90: *
91: * @return $this
92: * @throws UnexpectedValueException
93: */
94: public function fromObject(object $object): SepaDirectDebitPaymentMethodSpecificInput
95: {
96: parent::fromObject($object);
97: if (property_exists($object, 'dateCollect')) {
98: $this->dateCollect = $object->dateCollect;
99: }
100: if (property_exists($object, 'directDebitText')) {
101: $this->directDebitText = $object->directDebitText;
102: }
103: if (property_exists($object, 'isRecurring')) {
104: $this->isRecurring = $object->isRecurring;
105: }
106: if (property_exists($object, 'paymentProduct771SpecificInput')) {
107: if (!is_object($object->paymentProduct771SpecificInput)) {
108: throw new UnexpectedValueException('value \'' . print_r($object->paymentProduct771SpecificInput, true) . '\' is not an object');
109: }
110: $value = new SepaDirectDebitPaymentProduct771SpecificInput();
111: $this->paymentProduct771SpecificInput = $value->fromObject($object->paymentProduct771SpecificInput);
112: }
113: if (property_exists($object, 'recurringPaymentSequenceIndicator')) {
114: $this->recurringPaymentSequenceIndicator = $object->recurringPaymentSequenceIndicator;
115: }
116: if (property_exists($object, 'requiresApproval')) {
117: $this->requiresApproval = $object->requiresApproval;
118: }
119: if (property_exists($object, 'token')) {
120: $this->token = $object->token;
121: }
122: if (property_exists($object, 'tokenize')) {
123: $this->tokenize = $object->tokenize;
124: }
125: return $this;
126: }
127: }
128: