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