validateCurrentBalanceForChoiceConstraintsFromSetCurrentBalance()   A
last analyzed

Complexity

Conditions 5
Paths 4

Size

Total Lines 34
Code Lines 27

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 27
c 0
b 0
f 0
nc 4
nop 1
dl 0
loc 34
rs 9.1768
1
<?php
2
3
namespace PayPal\StructType;
4
5
use \WsdlToPhp\PackageBase\AbstractStructBase;
6
7
/**
8
 * This class stands for AccountSummaryType StructType
9
 * Meta information extracted from the WSDL
10
 * - documentation: User's current balance. Can be 0.00, positive, or negative. | Amount past due, 0.00 if not past due. | Includes account summary for the user.
11
 * - mixed: true
12
 * @subpackage Structs
13
 * @author WsdlToPhp <[email protected]>
14
 */
15
class AccountSummaryType extends AbstractStructBase
16
{
17
    /**
18
     * The AccountState
19
     * Meta information extracted from the WSDL
20
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
21
     * LastPaymentDate | PastDue | PaymentMethod
22
     * - choiceMaxOccurs: unbounded
23
     * - choiceMinOccurs: 0
24
     * - minOccurs: 0
25
     * @var string
26
     */
27
    public $AccountState;
28
    /**
29
     * The AdditionalAccount
30
     * Meta information extracted from the WSDL
31
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
32
     * LastPaymentDate | PastDue | PaymentMethod
33
     * - choiceMaxOccurs: unbounded
34
     * - choiceMinOccurs: 0
35
     * - maxOccurs: unbounded
36
     * - minOccurs: 0
37
     * @var \PayPal\StructType\AdditionalAccountType[]
38
     */
39
    public $AdditionalAccount;
40
    /**
41
     * The AdditionalAccountsCount
42
     * Meta information extracted from the WSDL
43
     * - documentation: Number of additional accounts.
44
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
45
     * LastPaymentDate | PastDue | PaymentMethod
46
     * - choiceMaxOccurs: unbounded
47
     * - choiceMinOccurs: 0
48
     * @var int
49
     */
50
    public $AdditionalAccountsCount;
51
    /**
52
     * The AmountPastDue
53
     * Meta information extracted from the WSDL
54
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
55
     * LastPaymentDate | PastDue | PaymentMethod
56
     * - choiceMaxOccurs: unbounded
57
     * - choiceMinOccurs: 0
58
     * - minOccurs: 0
59
     * - ref: ns:AmountPastDue
60
     * @var \PayPal\StructType\AmountType
61
     */
62
    public $AmountPastDue;
63
    /**
64
     * The BankAccountInfo
65
     * Meta information extracted from the WSDL
66
     * - documentation: First four digits (with remainder Xed-out). This may be an empty string depending upon the value of the payment type for the user account (e.g, if no debit-card specified).
67
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
68
     * LastPaymentDate | PastDue | PaymentMethod
69
     * - choiceMaxOccurs: unbounded
70
     * - choiceMinOccurs: 0
71
     * @var string
72
     */
73
    public $BankAccountInfo;
74
    /**
75
     * The BankModifyDate
76
     * Meta information extracted from the WSDL
77
     * - documentation: Last time/day BankAccountInfo and/or BankRoutingInfo was modified, in GMT. This may be an empty string depending upon the value of the payment type for the user account (e.g, if no debit-card specified).
78
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
79
     * LastPaymentDate | PastDue | PaymentMethod
80
     * - choiceMaxOccurs: unbounded
81
     * - choiceMinOccurs: 0
82
     * @var string
83
     */
84
    public $BankModifyDate;
85
    /**
86
     * The BillingCycleDate
87
     * Meta information extracted from the WSDL
88
     * - documentation: Indicates the billing cycle in which eBay sends a billing invoice to the specified user. Possible values: 0 = On the last day of the month. 15 = On the 15th day of the month.
89
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
90
     * LastPaymentDate | PastDue | PaymentMethod
91
     * - choiceMaxOccurs: unbounded
92
     * - choiceMinOccurs: 0
93
     * @var string
94
     */
95
    public $BillingCycleDate;
96
    /**
97
     * The CCExp
98
     * Meta information extracted from the WSDL
99
     * - documentation: Expiration date for the credit card selected as payment method, in GMT. Empty string if no credit card is on file or if account is inactive -- even if there is a credit card on file.
100
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
101
     * LastPaymentDate | PastDue | PaymentMethod
102
     * - choiceMaxOccurs: unbounded
103
     * - choiceMinOccurs: 0
104
     * @var string
105
     */
106
    public $CCExp;
107
    /**
108
     * The CCInfo
109
     * Meta information extracted from the WSDL
110
     * - documentation: Last four digits of user's credit card selected as payment type. Empty string if no credit is on file. This may be an empty string depending upon the value of the payment type for the user account (e.g, if no debit-card specified).
111
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
112
     * LastPaymentDate | PastDue | PaymentMethod
113
     * - choiceMaxOccurs: unbounded
114
     * - choiceMinOccurs: 0
115
     * @var string
116
     */
117
    public $CCInfo;
118
    /**
119
     * The CCModifyDate
120
     * Meta information extracted from the WSDL
121
     * - documentation: Last date credit card or credit card expiration date was modified, in GMT. This may be an empty string depending upon the value of the payment type for the user account (e.g, Empty string if no credit card is on file.
122
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
123
     * LastPaymentDate | PastDue | PaymentMethod
124
     * - choiceMaxOccurs: unbounded
125
     * - choiceMinOccurs: 0
126
     * @var string
127
     */
128
    public $CCModifyDate;
129
    /**
130
     * The CurrentBalance
131
     * Meta information extracted from the WSDL
132
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
133
     * LastPaymentDate | PastDue | PaymentMethod
134
     * - choiceMaxOccurs: unbounded
135
     * - choiceMinOccurs: 0
136
     * - ref: ns:CurrentBalance
137
     * @var \PayPal\StructType\AmountType
138
     */
139
    public $CurrentBalance;
140
    /**
141
     * The LastAmountPaid
142
     * Meta information extracted from the WSDL
143
     * - documentation: Amount of last payment posted, 0.00 if no payments posted.
144
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
145
     * LastPaymentDate | PastDue | PaymentMethod
146
     * - choiceMaxOccurs: unbounded
147
     * - choiceMinOccurs: 0
148
     * @var \PayPal\StructType\AmountType
149
     */
150
    public $LastAmountPaid;
151
    /**
152
     * The LastInvoiceAmount
153
     * Meta information extracted from the WSDL
154
     * - documentation: Amount of last invoice. 0.00 if account not yet invoiced.
155
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
156
     * LastPaymentDate | PastDue | PaymentMethod
157
     * - choiceMaxOccurs: unbounded
158
     * - choiceMinOccurs: 0
159
     * @var \PayPal\StructType\AmountType
160
     */
161
    public $LastInvoiceAmount;
162
    /**
163
     * The LastInvoiceDate
164
     * Meta information extracted from the WSDL
165
     * - documentation: Date of last invoice sent by eBay to the user, in GMT. Empty string if this account has not been invoiced yet.
166
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
167
     * LastPaymentDate | PastDue | PaymentMethod
168
     * - choiceMaxOccurs: unbounded
169
     * - choiceMinOccurs: 0
170
     * @var string
171
     */
172
    public $LastInvoiceDate;
173
    /**
174
     * The LastPaymentDate
175
     * Meta information extracted from the WSDL
176
     * - documentation: Date of last payment by specified user to eBay, in GMT. Empty string if no payments posted.
177
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
178
     * LastPaymentDate | PastDue | PaymentMethod
179
     * - choiceMaxOccurs: unbounded
180
     * - choiceMinOccurs: 0
181
     * @var string
182
     */
183
    public $LastPaymentDate;
184
    /**
185
     * The PastDue
186
     * Meta information extracted from the WSDL
187
     * - documentation: Indicates whether the account has past due amounts outstanding. Possible values: true = Account is past due. false = Account is current.
188
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
189
     * LastPaymentDate | PastDue | PaymentMethod
190
     * - choiceMaxOccurs: unbounded
191
     * - choiceMinOccurs: 0
192
     * @var bool
193
     */
194
    public $PastDue;
195
    /**
196
     * The PaymentMethod
197
     * Meta information extracted from the WSDL
198
     * - documentation: Indicates the method the specified user selected for paying eBay. The values for PaymentType vary for each SiteID.
199
     * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate |
200
     * LastPaymentDate | PastDue | PaymentMethod
201
     * - choiceMaxOccurs: unbounded
202
     * - choiceMinOccurs: 0
203
     * @var string
204
     */
205
    public $PaymentMethod;
206
    /**
207
     * Constructor method for AccountSummaryType
208
     * @uses AccountSummaryType::setAccountState()
209
     * @uses AccountSummaryType::setAdditionalAccount()
210
     * @uses AccountSummaryType::setAdditionalAccountsCount()
211
     * @uses AccountSummaryType::setAmountPastDue()
212
     * @uses AccountSummaryType::setBankAccountInfo()
213
     * @uses AccountSummaryType::setBankModifyDate()
214
     * @uses AccountSummaryType::setBillingCycleDate()
215
     * @uses AccountSummaryType::setCCExp()
216
     * @uses AccountSummaryType::setCCInfo()
217
     * @uses AccountSummaryType::setCCModifyDate()
218
     * @uses AccountSummaryType::setCurrentBalance()
219
     * @uses AccountSummaryType::setLastAmountPaid()
220
     * @uses AccountSummaryType::setLastInvoiceAmount()
221
     * @uses AccountSummaryType::setLastInvoiceDate()
222
     * @uses AccountSummaryType::setLastPaymentDate()
223
     * @uses AccountSummaryType::setPastDue()
224
     * @uses AccountSummaryType::setPaymentMethod()
225
     * @param string $accountState
226
     * @param \PayPal\StructType\AdditionalAccountType[] $additionalAccount
227
     * @param int $additionalAccountsCount
228
     * @param \PayPal\StructType\AmountType $amountPastDue
229
     * @param string $bankAccountInfo
230
     * @param string $bankModifyDate
231
     * @param string $billingCycleDate
232
     * @param string $cCExp
233
     * @param string $cCInfo
234
     * @param string $cCModifyDate
235
     * @param \PayPal\StructType\AmountType $currentBalance
236
     * @param \PayPal\StructType\AmountType $lastAmountPaid
237
     * @param \PayPal\StructType\AmountType $lastInvoiceAmount
238
     * @param string $lastInvoiceDate
239
     * @param string $lastPaymentDate
240
     * @param bool $pastDue
241
     * @param string $paymentMethod
242
     */
243
    public function __construct($accountState = null, array $additionalAccount = array(), $additionalAccountsCount = null, \PayPal\StructType\AmountType $amountPastDue = null, $bankAccountInfo = null, $bankModifyDate = null, $billingCycleDate = null, $cCExp = null, $cCInfo = null, $cCModifyDate = null, \PayPal\StructType\AmountType $currentBalance = null, \PayPal\StructType\AmountType $lastAmountPaid = null, \PayPal\StructType\AmountType $lastInvoiceAmount = null, $lastInvoiceDate = null, $lastPaymentDate = null, $pastDue = null, $paymentMethod = null)
244
    {
245
        $this
246
            ->setAccountState($accountState)
247
            ->setAdditionalAccount($additionalAccount)
248
            ->setAdditionalAccountsCount($additionalAccountsCount)
249
            ->setAmountPastDue($amountPastDue)
250
            ->setBankAccountInfo($bankAccountInfo)
251
            ->setBankModifyDate($bankModifyDate)
252
            ->setBillingCycleDate($billingCycleDate)
253
            ->setCCExp($cCExp)
254
            ->setCCInfo($cCInfo)
255
            ->setCCModifyDate($cCModifyDate)
256
            ->setCurrentBalance($currentBalance)
257
            ->setLastAmountPaid($lastAmountPaid)
258
            ->setLastInvoiceAmount($lastInvoiceAmount)
259
            ->setLastInvoiceDate($lastInvoiceDate)
260
            ->setLastPaymentDate($lastPaymentDate)
261
            ->setPastDue($pastDue)
262
            ->setPaymentMethod($paymentMethod);
263
    }
264
    /**
265
     * Get AccountState value
266
     * @return string|null
267
     */
268
    public function getAccountState()
269
    {
270
        return isset($this->AccountState) ? $this->AccountState : null;
271
    }
272
    /**
273
     * This method is responsible for validating the value passed to the setAccountState method
274
     * This method is willingly generated in order to preserve the one-line inline validation within the setAccountState method
275
     * This has to validate that the property which is being set is the only one among the given choices
276
     * @param mixed $value
277
     * @return string A non-empty message if the values does not match the validation rules
278
     */
279
    public function validateAccountStateForChoiceConstraintsFromSetAccountState($value)
280
    {
281
        $message = '';
282
        if (is_null($value)) {
283
            return $message;
284
        }
285
        $properties = [
286
            'AdditionalAccount',
287
            'AdditionalAccountsCount',
288
            'AmountPastDue',
289
            'BankAccountInfo',
290
            'BankModifyDate',
291
            'BillingCycleDate',
292
            'CCExp',
293
            'CCInfo',
294
            'CCModifyDate',
295
            'CurrentBalance',
296
            'LastAmountPaid',
297
            'LastInvoiceAmount',
298
            'LastInvoiceDate',
299
            'LastPaymentDate',
300
            'PastDue',
301
            'PaymentMethod',
302
        ];
303
        try {
304
            foreach ($properties as $property) {
305
                if (isset($this->{$property})) {
306
                    throw new \InvalidArgumentException(sprintf('The property AccountState can\'t be set as the property %s is already set. Only one property must be set among these properties: AccountState, %s.', $property, implode(', ', $properties)), __LINE__);
307
                }
308
            }
309
        } catch (\InvalidArgumentException $e) {
310
            $message = $e->getMessage();
311
        }
312
        return $message;
313
    }
314
    /**
315
     * Set AccountState value
316
     * This property belongs to a choice that allows only one property to exist. It is
317
     * therefore removable from the request, consequently if the value assigned to this
318
     * property is null, the property is removed from this object
319
     * @throws \InvalidArgumentException
320
     * @uses \PayPal\EnumType\AccountStateCodeType::valueIsValid()
321
     * @uses \PayPal\EnumType\AccountStateCodeType::getValidValues()
322
     * @throws \InvalidArgumentException
323
     * @param string $accountState
324
     * @return \PayPal\StructType\AccountSummaryType
325
     */
326
    public function setAccountState($accountState = null)
327
    {
328
        // validation for constraint: enumeration
329
        if (!\PayPal\EnumType\AccountStateCodeType::valueIsValid($accountState)) {
330
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AccountStateCodeType', is_array($accountState) ? implode(', ', $accountState) : var_export($accountState, true), implode(', ', \PayPal\EnumType\AccountStateCodeType::getValidValues())), __LINE__);
0 ignored issues
show
introduced by
The condition is_array($accountState) is always false.
Loading history...
331
        }
332
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
333
        if ('' !== ($accountStateChoiceErrorMessage = self::validateAccountStateForChoiceConstraintsFromSetAccountState($accountState))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...tsFromSetAccountState() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

333
        if ('' !== ($accountStateChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateAccountStateForChoiceConstraintsFromSetAccountState($accountState))) {
Loading history...
334
            throw new \InvalidArgumentException($accountStateChoiceErrorMessage, __LINE__);
335
        }
336
        if (is_null($accountState) || (is_array($accountState) && empty($accountState))) {
337
            unset($this->AccountState);
338
        } else {
339
            $this->AccountState = $accountState;
340
        }
341
        return $this;
342
    }
343
    /**
344
     * Get AdditionalAccount value
345
     * @return \PayPal\StructType\AdditionalAccountType[]|null
346
     */
347
    public function getAdditionalAccount()
348
    {
349
        return isset($this->AdditionalAccount) ? $this->AdditionalAccount : null;
350
    }
351
    /**
352
     * This method is responsible for validating the values passed to the setAdditionalAccount method
353
     * This method is willingly generated in order to preserve the one-line inline validation within the setAdditionalAccount method
354
     * @param array $values
355
     * @return string A non-empty message if the values does not match the validation rules
356
     */
357
    public static function validateAdditionalAccountForArrayConstraintsFromSetAdditionalAccount(array $values = array())
358
    {
359
        $message = '';
360
        $invalidValues = [];
361
        foreach ($values as $accountSummaryTypeAdditionalAccountItem) {
362
            // validation for constraint: itemType
363
            if (!$accountSummaryTypeAdditionalAccountItem instanceof \PayPal\StructType\AdditionalAccountType) {
364
                $invalidValues[] = is_object($accountSummaryTypeAdditionalAccountItem) ? get_class($accountSummaryTypeAdditionalAccountItem) : sprintf('%s(%s)', gettype($accountSummaryTypeAdditionalAccountItem), var_export($accountSummaryTypeAdditionalAccountItem, true));
365
            }
366
        }
367
        if (!empty($invalidValues)) {
368
            $message = sprintf('The AdditionalAccount property can only contain items of type \PayPal\StructType\AdditionalAccountType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
0 ignored issues
show
introduced by
The condition is_array($invalidValues) is always true.
Loading history...
introduced by
The condition is_object($invalidValues) is always false.
Loading history...
369
        }
370
        unset($invalidValues);
371
        return $message;
372
    }
373
    /**
374
     * This method is responsible for validating the value passed to the setAdditionalAccount method
375
     * This method is willingly generated in order to preserve the one-line inline validation within the setAdditionalAccount method
376
     * This has to validate that the property which is being set is the only one among the given choices
377
     * @param mixed $value
378
     * @return string A non-empty message if the values does not match the validation rules
379
     */
380
    public function validateAdditionalAccountForChoiceConstraintsFromSetAdditionalAccount($value)
381
    {
382
        $message = '';
383
        if (is_null($value)) {
384
            return $message;
385
        }
386
        $properties = [
387
            'AccountState',
388
            'AdditionalAccountsCount',
389
            'AmountPastDue',
390
            'BankAccountInfo',
391
            'BankModifyDate',
392
            'BillingCycleDate',
393
            'CCExp',
394
            'CCInfo',
395
            'CCModifyDate',
396
            'CurrentBalance',
397
            'LastAmountPaid',
398
            'LastInvoiceAmount',
399
            'LastInvoiceDate',
400
            'LastPaymentDate',
401
            'PastDue',
402
            'PaymentMethod',
403
        ];
404
        try {
405
            foreach ($properties as $property) {
406
                if (isset($this->{$property})) {
407
                    throw new \InvalidArgumentException(sprintf('The property AdditionalAccount can\'t be set as the property %s is already set. Only one property must be set among these properties: AdditionalAccount, %s.', $property, implode(', ', $properties)), __LINE__);
408
                }
409
            }
410
        } catch (\InvalidArgumentException $e) {
411
            $message = $e->getMessage();
412
        }
413
        return $message;
414
    }
415
    /**
416
     * Set AdditionalAccount value
417
     * This property belongs to a choice that allows only one property to exist. It is
418
     * therefore removable from the request, consequently if the value assigned to this
419
     * property is null, the property is removed from this object
420
     * @throws \InvalidArgumentException
421
     * @throws \InvalidArgumentException
422
     * @param \PayPal\StructType\AdditionalAccountType[] $additionalAccount
423
     * @return \PayPal\StructType\AccountSummaryType
424
     */
425
    public function setAdditionalAccount(array $additionalAccount = array())
426
    {
427
        // validation for constraint: array
428
        if ('' !== ($additionalAccountArrayErrorMessage = self::validateAdditionalAccountForArrayConstraintsFromSetAdditionalAccount($additionalAccount))) {
429
            throw new \InvalidArgumentException($additionalAccountArrayErrorMessage, __LINE__);
430
        }
431
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
432
        if ('' !== ($additionalAccountChoiceErrorMessage = self::validateAdditionalAccountForChoiceConstraintsFromSetAdditionalAccount($additionalAccount))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...mSetAdditionalAccount() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

432
        if ('' !== ($additionalAccountChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateAdditionalAccountForChoiceConstraintsFromSetAdditionalAccount($additionalAccount))) {
Loading history...
433
            throw new \InvalidArgumentException($additionalAccountChoiceErrorMessage, __LINE__);
434
        }
435
        if (is_null($additionalAccount) || (is_array($additionalAccount) && empty($additionalAccount))) {
436
            unset($this->AdditionalAccount);
437
        } else {
438
            $this->AdditionalAccount = $additionalAccount;
439
        }
440
        return $this;
441
    }
442
    /**
443
     * This method is responsible for validating the value passed to the addToAdditionalAccount method
444
     * This method is willingly generated in order to preserve the one-line inline validation within the addToAdditionalAccount method
445
     * This has to validate that the property which is being set is the only one among the given choices
446
     * @param mixed $value
447
     * @return string A non-empty message if the values does not match the validation rules
448
     */
449
    public function validateItemForChoiceConstraintsFromAddToAdditionalAccount($value)
450
    {
451
        $message = '';
452
        if (is_null($value)) {
453
            return $message;
454
        }
455
        $properties = [
456
            'AccountState',
457
            'AdditionalAccountsCount',
458
            'AmountPastDue',
459
            'BankAccountInfo',
460
            'BankModifyDate',
461
            'BillingCycleDate',
462
            'CCExp',
463
            'CCInfo',
464
            'CCModifyDate',
465
            'CurrentBalance',
466
            'LastAmountPaid',
467
            'LastInvoiceAmount',
468
            'LastInvoiceDate',
469
            'LastPaymentDate',
470
            'PastDue',
471
            'PaymentMethod',
472
        ];
473
        try {
474
            foreach ($properties as $property) {
475
                if (isset($this->{$property})) {
476
                    throw new \InvalidArgumentException(sprintf('The property AdditionalAccount can\'t be set as the property %s is already set. Only one property must be set among these properties: AdditionalAccount, %s.', $property, implode(', ', $properties)), __LINE__);
477
                }
478
            }
479
        } catch (\InvalidArgumentException $e) {
480
            $message = $e->getMessage();
481
        }
482
        return $message;
483
    }
484
    /**
485
     * Add item to AdditionalAccount value
486
     * @throws \InvalidArgumentException
487
     * @param \PayPal\StructType\AdditionalAccountType $item
488
     * @return \PayPal\StructType\AccountSummaryType
489
     */
490
    public function addToAdditionalAccount(\PayPal\StructType\AdditionalAccountType $item)
491
    {
492
        // validation for constraint: itemType
493
        if (!$item instanceof \PayPal\StructType\AdditionalAccountType) {
0 ignored issues
show
introduced by
$item is always a sub-type of PayPal\StructType\AdditionalAccountType.
Loading history...
494
            throw new \InvalidArgumentException(sprintf('The AdditionalAccount property can only contain items of type \PayPal\StructType\AdditionalAccountType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
495
        }
496
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
497
        if ('' !== ($itemChoiceErrorMessage = self::validateItemForChoiceConstraintsFromAddToAdditionalAccount($item))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...ddToAdditionalAccount() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

497
        if ('' !== ($itemChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateItemForChoiceConstraintsFromAddToAdditionalAccount($item))) {
Loading history...
498
            throw new \InvalidArgumentException($itemChoiceErrorMessage, __LINE__);
499
        }
500
        $this->AdditionalAccount[] = $item;
501
        return $this;
502
    }
503
    /**
504
     * Get AdditionalAccountsCount value
505
     * @return int|null
506
     */
507
    public function getAdditionalAccountsCount()
508
    {
509
        return isset($this->AdditionalAccountsCount) ? $this->AdditionalAccountsCount : null;
510
    }
511
    /**
512
     * This method is responsible for validating the value passed to the setAdditionalAccountsCount method
513
     * This method is willingly generated in order to preserve the one-line inline validation within the setAdditionalAccountsCount method
514
     * This has to validate that the property which is being set is the only one among the given choices
515
     * @param mixed $value
516
     * @return string A non-empty message if the values does not match the validation rules
517
     */
518
    public function validateAdditionalAccountsCountForChoiceConstraintsFromSetAdditionalAccountsCount($value)
519
    {
520
        $message = '';
521
        if (is_null($value)) {
522
            return $message;
523
        }
524
        $properties = [
525
            'AccountState',
526
            'AdditionalAccount',
527
            'AmountPastDue',
528
            'BankAccountInfo',
529
            'BankModifyDate',
530
            'BillingCycleDate',
531
            'CCExp',
532
            'CCInfo',
533
            'CCModifyDate',
534
            'CurrentBalance',
535
            'LastAmountPaid',
536
            'LastInvoiceAmount',
537
            'LastInvoiceDate',
538
            'LastPaymentDate',
539
            'PastDue',
540
            'PaymentMethod',
541
        ];
542
        try {
543
            foreach ($properties as $property) {
544
                if (isset($this->{$property})) {
545
                    throw new \InvalidArgumentException(sprintf('The property AdditionalAccountsCount can\'t be set as the property %s is already set. Only one property must be set among these properties: AdditionalAccountsCount, %s.', $property, implode(', ', $properties)), __LINE__);
546
                }
547
            }
548
        } catch (\InvalidArgumentException $e) {
549
            $message = $e->getMessage();
550
        }
551
        return $message;
552
    }
553
    /**
554
     * Set AdditionalAccountsCount value
555
     * This property belongs to a choice that allows only one property to exist. It is
556
     * therefore removable from the request, consequently if the value assigned to this
557
     * property is null, the property is removed from this object
558
     * @throws \InvalidArgumentException
559
     * @param int $additionalAccountsCount
560
     * @return \PayPal\StructType\AccountSummaryType
561
     */
562
    public function setAdditionalAccountsCount($additionalAccountsCount = null)
563
    {
564
        // validation for constraint: int
565
        if (!is_null($additionalAccountsCount) && !(is_int($additionalAccountsCount) || ctype_digit($additionalAccountsCount))) {
0 ignored issues
show
introduced by
The condition is_int($additionalAccountsCount) is always true.
Loading history...
566
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($additionalAccountsCount, true), gettype($additionalAccountsCount)), __LINE__);
567
        }
568
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
569
        if ('' !== ($additionalAccountsCountChoiceErrorMessage = self::validateAdditionalAccountsCountForChoiceConstraintsFromSetAdditionalAccountsCount($additionalAccountsCount))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...ditionalAccountsCount() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

569
        if ('' !== ($additionalAccountsCountChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateAdditionalAccountsCountForChoiceConstraintsFromSetAdditionalAccountsCount($additionalAccountsCount))) {
Loading history...
570
            throw new \InvalidArgumentException($additionalAccountsCountChoiceErrorMessage, __LINE__);
571
        }
572
        if (is_null($additionalAccountsCount) || (is_array($additionalAccountsCount) && empty($additionalAccountsCount))) {
573
            unset($this->AdditionalAccountsCount);
574
        } else {
575
            $this->AdditionalAccountsCount = $additionalAccountsCount;
576
        }
577
        return $this;
578
    }
579
    /**
580
     * Get AmountPastDue value
581
     * @return \PayPal\StructType\AmountType|null
582
     */
583
    public function getAmountPastDue()
584
    {
585
        return isset($this->AmountPastDue) ? $this->AmountPastDue : null;
586
    }
587
    /**
588
     * This method is responsible for validating the value passed to the setAmountPastDue method
589
     * This method is willingly generated in order to preserve the one-line inline validation within the setAmountPastDue method
590
     * This has to validate that the property which is being set is the only one among the given choices
591
     * @param mixed $value
592
     * @return string A non-empty message if the values does not match the validation rules
593
     */
594
    public function validateAmountPastDueForChoiceConstraintsFromSetAmountPastDue($value)
595
    {
596
        $message = '';
597
        if (is_null($value)) {
598
            return $message;
599
        }
600
        $properties = [
601
            'AccountState',
602
            'AdditionalAccount',
603
            'AdditionalAccountsCount',
604
            'BankAccountInfo',
605
            'BankModifyDate',
606
            'BillingCycleDate',
607
            'CCExp',
608
            'CCInfo',
609
            'CCModifyDate',
610
            'CurrentBalance',
611
            'LastAmountPaid',
612
            'LastInvoiceAmount',
613
            'LastInvoiceDate',
614
            'LastPaymentDate',
615
            'PastDue',
616
            'PaymentMethod',
617
        ];
618
        try {
619
            foreach ($properties as $property) {
620
                if (isset($this->{$property})) {
621
                    throw new \InvalidArgumentException(sprintf('The property AmountPastDue can\'t be set as the property %s is already set. Only one property must be set among these properties: AmountPastDue, %s.', $property, implode(', ', $properties)), __LINE__);
622
                }
623
            }
624
        } catch (\InvalidArgumentException $e) {
625
            $message = $e->getMessage();
626
        }
627
        return $message;
628
    }
629
    /**
630
     * Set AmountPastDue value
631
     * This property belongs to a choice that allows only one property to exist. It is
632
     * therefore removable from the request, consequently if the value assigned to this
633
     * property is null, the property is removed from this object
634
     * @throws \InvalidArgumentException
635
     * @param \PayPal\StructType\AmountType $amountPastDue
636
     * @return \PayPal\StructType\AccountSummaryType
637
     */
638
    public function setAmountPastDue(\PayPal\StructType\AmountType $amountPastDue = null)
639
    {
640
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
641
        if ('' !== ($amountPastDueChoiceErrorMessage = self::validateAmountPastDueForChoiceConstraintsFromSetAmountPastDue($amountPastDue))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...sFromSetAmountPastDue() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

641
        if ('' !== ($amountPastDueChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateAmountPastDueForChoiceConstraintsFromSetAmountPastDue($amountPastDue))) {
Loading history...
642
            throw new \InvalidArgumentException($amountPastDueChoiceErrorMessage, __LINE__);
643
        }
644
        if (is_null($amountPastDue) || (is_array($amountPastDue) && empty($amountPastDue))) {
645
            unset($this->AmountPastDue);
646
        } else {
647
            $this->AmountPastDue = $amountPastDue;
648
        }
649
        return $this;
650
    }
651
    /**
652
     * Get BankAccountInfo value
653
     * @return string|null
654
     */
655
    public function getBankAccountInfo()
656
    {
657
        return isset($this->BankAccountInfo) ? $this->BankAccountInfo : null;
658
    }
659
    /**
660
     * This method is responsible for validating the value passed to the setBankAccountInfo method
661
     * This method is willingly generated in order to preserve the one-line inline validation within the setBankAccountInfo method
662
     * This has to validate that the property which is being set is the only one among the given choices
663
     * @param mixed $value
664
     * @return string A non-empty message if the values does not match the validation rules
665
     */
666
    public function validateBankAccountInfoForChoiceConstraintsFromSetBankAccountInfo($value)
667
    {
668
        $message = '';
669
        if (is_null($value)) {
670
            return $message;
671
        }
672
        $properties = [
673
            'AccountState',
674
            'AdditionalAccount',
675
            'AdditionalAccountsCount',
676
            'AmountPastDue',
677
            'BankModifyDate',
678
            'BillingCycleDate',
679
            'CCExp',
680
            'CCInfo',
681
            'CCModifyDate',
682
            'CurrentBalance',
683
            'LastAmountPaid',
684
            'LastInvoiceAmount',
685
            'LastInvoiceDate',
686
            'LastPaymentDate',
687
            'PastDue',
688
            'PaymentMethod',
689
        ];
690
        try {
691
            foreach ($properties as $property) {
692
                if (isset($this->{$property})) {
693
                    throw new \InvalidArgumentException(sprintf('The property BankAccountInfo can\'t be set as the property %s is already set. Only one property must be set among these properties: BankAccountInfo, %s.', $property, implode(', ', $properties)), __LINE__);
694
                }
695
            }
696
        } catch (\InvalidArgumentException $e) {
697
            $message = $e->getMessage();
698
        }
699
        return $message;
700
    }
701
    /**
702
     * Set BankAccountInfo value
703
     * This property belongs to a choice that allows only one property to exist. It is
704
     * therefore removable from the request, consequently if the value assigned to this
705
     * property is null, the property is removed from this object
706
     * @throws \InvalidArgumentException
707
     * @param string $bankAccountInfo
708
     * @return \PayPal\StructType\AccountSummaryType
709
     */
710
    public function setBankAccountInfo($bankAccountInfo = null)
711
    {
712
        // validation for constraint: string
713
        if (!is_null($bankAccountInfo) && !is_string($bankAccountInfo)) {
0 ignored issues
show
introduced by
The condition is_string($bankAccountInfo) is always true.
Loading history...
714
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($bankAccountInfo, true), gettype($bankAccountInfo)), __LINE__);
715
        }
716
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
717
        if ('' !== ($bankAccountInfoChoiceErrorMessage = self::validateBankAccountInfoForChoiceConstraintsFromSetBankAccountInfo($bankAccountInfo))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...romSetBankAccountInfo() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

717
        if ('' !== ($bankAccountInfoChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateBankAccountInfoForChoiceConstraintsFromSetBankAccountInfo($bankAccountInfo))) {
Loading history...
718
            throw new \InvalidArgumentException($bankAccountInfoChoiceErrorMessage, __LINE__);
719
        }
720
        if (is_null($bankAccountInfo) || (is_array($bankAccountInfo) && empty($bankAccountInfo))) {
721
            unset($this->BankAccountInfo);
722
        } else {
723
            $this->BankAccountInfo = $bankAccountInfo;
724
        }
725
        return $this;
726
    }
727
    /**
728
     * Get BankModifyDate value
729
     * @return string|null
730
     */
731
    public function getBankModifyDate()
732
    {
733
        return isset($this->BankModifyDate) ? $this->BankModifyDate : null;
734
    }
735
    /**
736
     * This method is responsible for validating the value passed to the setBankModifyDate method
737
     * This method is willingly generated in order to preserve the one-line inline validation within the setBankModifyDate method
738
     * This has to validate that the property which is being set is the only one among the given choices
739
     * @param mixed $value
740
     * @return string A non-empty message if the values does not match the validation rules
741
     */
742
    public function validateBankModifyDateForChoiceConstraintsFromSetBankModifyDate($value)
743
    {
744
        $message = '';
745
        if (is_null($value)) {
746
            return $message;
747
        }
748
        $properties = [
749
            'AccountState',
750
            'AdditionalAccount',
751
            'AdditionalAccountsCount',
752
            'AmountPastDue',
753
            'BankAccountInfo',
754
            'BillingCycleDate',
755
            'CCExp',
756
            'CCInfo',
757
            'CCModifyDate',
758
            'CurrentBalance',
759
            'LastAmountPaid',
760
            'LastInvoiceAmount',
761
            'LastInvoiceDate',
762
            'LastPaymentDate',
763
            'PastDue',
764
            'PaymentMethod',
765
        ];
766
        try {
767
            foreach ($properties as $property) {
768
                if (isset($this->{$property})) {
769
                    throw new \InvalidArgumentException(sprintf('The property BankModifyDate can\'t be set as the property %s is already set. Only one property must be set among these properties: BankModifyDate, %s.', $property, implode(', ', $properties)), __LINE__);
770
                }
771
            }
772
        } catch (\InvalidArgumentException $e) {
773
            $message = $e->getMessage();
774
        }
775
        return $message;
776
    }
777
    /**
778
     * Set BankModifyDate value
779
     * This property belongs to a choice that allows only one property to exist. It is
780
     * therefore removable from the request, consequently if the value assigned to this
781
     * property is null, the property is removed from this object
782
     * @throws \InvalidArgumentException
783
     * @param string $bankModifyDate
784
     * @return \PayPal\StructType\AccountSummaryType
785
     */
786
    public function setBankModifyDate($bankModifyDate = null)
787
    {
788
        // validation for constraint: string
789
        if (!is_null($bankModifyDate) && !is_string($bankModifyDate)) {
0 ignored issues
show
introduced by
The condition is_string($bankModifyDate) is always true.
Loading history...
790
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($bankModifyDate, true), gettype($bankModifyDate)), __LINE__);
791
        }
792
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
793
        if ('' !== ($bankModifyDateChoiceErrorMessage = self::validateBankModifyDateForChoiceConstraintsFromSetBankModifyDate($bankModifyDate))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...FromSetBankModifyDate() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

793
        if ('' !== ($bankModifyDateChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateBankModifyDateForChoiceConstraintsFromSetBankModifyDate($bankModifyDate))) {
Loading history...
794
            throw new \InvalidArgumentException($bankModifyDateChoiceErrorMessage, __LINE__);
795
        }
796
        if (is_null($bankModifyDate) || (is_array($bankModifyDate) && empty($bankModifyDate))) {
797
            unset($this->BankModifyDate);
798
        } else {
799
            $this->BankModifyDate = $bankModifyDate;
800
        }
801
        return $this;
802
    }
803
    /**
804
     * Get BillingCycleDate value
805
     * @return string|null
806
     */
807
    public function getBillingCycleDate()
808
    {
809
        return isset($this->BillingCycleDate) ? $this->BillingCycleDate : null;
810
    }
811
    /**
812
     * This method is responsible for validating the value passed to the setBillingCycleDate method
813
     * This method is willingly generated in order to preserve the one-line inline validation within the setBillingCycleDate method
814
     * This has to validate that the property which is being set is the only one among the given choices
815
     * @param mixed $value
816
     * @return string A non-empty message if the values does not match the validation rules
817
     */
818
    public function validateBillingCycleDateForChoiceConstraintsFromSetBillingCycleDate($value)
819
    {
820
        $message = '';
821
        if (is_null($value)) {
822
            return $message;
823
        }
824
        $properties = [
825
            'AccountState',
826
            'AdditionalAccount',
827
            'AdditionalAccountsCount',
828
            'AmountPastDue',
829
            'BankAccountInfo',
830
            'BankModifyDate',
831
            'CCExp',
832
            'CCInfo',
833
            'CCModifyDate',
834
            'CurrentBalance',
835
            'LastAmountPaid',
836
            'LastInvoiceAmount',
837
            'LastInvoiceDate',
838
            'LastPaymentDate',
839
            'PastDue',
840
            'PaymentMethod',
841
        ];
842
        try {
843
            foreach ($properties as $property) {
844
                if (isset($this->{$property})) {
845
                    throw new \InvalidArgumentException(sprintf('The property BillingCycleDate can\'t be set as the property %s is already set. Only one property must be set among these properties: BillingCycleDate, %s.', $property, implode(', ', $properties)), __LINE__);
846
                }
847
            }
848
        } catch (\InvalidArgumentException $e) {
849
            $message = $e->getMessage();
850
        }
851
        return $message;
852
    }
853
    /**
854
     * Set BillingCycleDate value
855
     * This property belongs to a choice that allows only one property to exist. It is
856
     * therefore removable from the request, consequently if the value assigned to this
857
     * property is null, the property is removed from this object
858
     * @throws \InvalidArgumentException
859
     * @param string $billingCycleDate
860
     * @return \PayPal\StructType\AccountSummaryType
861
     */
862
    public function setBillingCycleDate($billingCycleDate = null)
863
    {
864
        // validation for constraint: string
865
        if (!is_null($billingCycleDate) && !is_string($billingCycleDate)) {
0 ignored issues
show
introduced by
The condition is_string($billingCycleDate) is always true.
Loading history...
866
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingCycleDate, true), gettype($billingCycleDate)), __LINE__);
867
        }
868
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
869
        if ('' !== ($billingCycleDateChoiceErrorMessage = self::validateBillingCycleDateForChoiceConstraintsFromSetBillingCycleDate($billingCycleDate))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...omSetBillingCycleDate() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

869
        if ('' !== ($billingCycleDateChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateBillingCycleDateForChoiceConstraintsFromSetBillingCycleDate($billingCycleDate))) {
Loading history...
870
            throw new \InvalidArgumentException($billingCycleDateChoiceErrorMessage, __LINE__);
871
        }
872
        if (is_null($billingCycleDate) || (is_array($billingCycleDate) && empty($billingCycleDate))) {
873
            unset($this->BillingCycleDate);
874
        } else {
875
            $this->BillingCycleDate = $billingCycleDate;
876
        }
877
        return $this;
878
    }
879
    /**
880
     * Get CCExp value
881
     * @return string|null
882
     */
883
    public function getCCExp()
884
    {
885
        return isset($this->CCExp) ? $this->CCExp : null;
886
    }
887
    /**
888
     * This method is responsible for validating the value passed to the setCCExp method
889
     * This method is willingly generated in order to preserve the one-line inline validation within the setCCExp method
890
     * This has to validate that the property which is being set is the only one among the given choices
891
     * @param mixed $value
892
     * @return string A non-empty message if the values does not match the validation rules
893
     */
894
    public function validateCCExpForChoiceConstraintsFromSetCCExp($value)
895
    {
896
        $message = '';
897
        if (is_null($value)) {
898
            return $message;
899
        }
900
        $properties = [
901
            'AccountState',
902
            'AdditionalAccount',
903
            'AdditionalAccountsCount',
904
            'AmountPastDue',
905
            'BankAccountInfo',
906
            'BankModifyDate',
907
            'BillingCycleDate',
908
            'CCInfo',
909
            'CCModifyDate',
910
            'CurrentBalance',
911
            'LastAmountPaid',
912
            'LastInvoiceAmount',
913
            'LastInvoiceDate',
914
            'LastPaymentDate',
915
            'PastDue',
916
            'PaymentMethod',
917
        ];
918
        try {
919
            foreach ($properties as $property) {
920
                if (isset($this->{$property})) {
921
                    throw new \InvalidArgumentException(sprintf('The property CCExp can\'t be set as the property %s is already set. Only one property must be set among these properties: CCExp, %s.', $property, implode(', ', $properties)), __LINE__);
922
                }
923
            }
924
        } catch (\InvalidArgumentException $e) {
925
            $message = $e->getMessage();
926
        }
927
        return $message;
928
    }
929
    /**
930
     * Set CCExp value
931
     * This property belongs to a choice that allows only one property to exist. It is
932
     * therefore removable from the request, consequently if the value assigned to this
933
     * property is null, the property is removed from this object
934
     * @throws \InvalidArgumentException
935
     * @param string $cCExp
936
     * @return \PayPal\StructType\AccountSummaryType
937
     */
938
    public function setCCExp($cCExp = null)
939
    {
940
        // validation for constraint: string
941
        if (!is_null($cCExp) && !is_string($cCExp)) {
0 ignored issues
show
introduced by
The condition is_string($cCExp) is always true.
Loading history...
942
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cCExp, true), gettype($cCExp)), __LINE__);
943
        }
944
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
945
        if ('' !== ($cCExpChoiceErrorMessage = self::validateCCExpForChoiceConstraintsFromSetCCExp($cCExp))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...nstraintsFromSetCCExp() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

945
        if ('' !== ($cCExpChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateCCExpForChoiceConstraintsFromSetCCExp($cCExp))) {
Loading history...
946
            throw new \InvalidArgumentException($cCExpChoiceErrorMessage, __LINE__);
947
        }
948
        if (is_null($cCExp) || (is_array($cCExp) && empty($cCExp))) {
949
            unset($this->CCExp);
950
        } else {
951
            $this->CCExp = $cCExp;
952
        }
953
        return $this;
954
    }
955
    /**
956
     * Get CCInfo value
957
     * @return string|null
958
     */
959
    public function getCCInfo()
960
    {
961
        return isset($this->CCInfo) ? $this->CCInfo : null;
962
    }
963
    /**
964
     * This method is responsible for validating the value passed to the setCCInfo method
965
     * This method is willingly generated in order to preserve the one-line inline validation within the setCCInfo method
966
     * This has to validate that the property which is being set is the only one among the given choices
967
     * @param mixed $value
968
     * @return string A non-empty message if the values does not match the validation rules
969
     */
970
    public function validateCCInfoForChoiceConstraintsFromSetCCInfo($value)
971
    {
972
        $message = '';
973
        if (is_null($value)) {
974
            return $message;
975
        }
976
        $properties = [
977
            'AccountState',
978
            'AdditionalAccount',
979
            'AdditionalAccountsCount',
980
            'AmountPastDue',
981
            'BankAccountInfo',
982
            'BankModifyDate',
983
            'BillingCycleDate',
984
            'CCExp',
985
            'CCModifyDate',
986
            'CurrentBalance',
987
            'LastAmountPaid',
988
            'LastInvoiceAmount',
989
            'LastInvoiceDate',
990
            'LastPaymentDate',
991
            'PastDue',
992
            'PaymentMethod',
993
        ];
994
        try {
995
            foreach ($properties as $property) {
996
                if (isset($this->{$property})) {
997
                    throw new \InvalidArgumentException(sprintf('The property CCInfo can\'t be set as the property %s is already set. Only one property must be set among these properties: CCInfo, %s.', $property, implode(', ', $properties)), __LINE__);
998
                }
999
            }
1000
        } catch (\InvalidArgumentException $e) {
1001
            $message = $e->getMessage();
1002
        }
1003
        return $message;
1004
    }
1005
    /**
1006
     * Set CCInfo value
1007
     * This property belongs to a choice that allows only one property to exist. It is
1008
     * therefore removable from the request, consequently if the value assigned to this
1009
     * property is null, the property is removed from this object
1010
     * @throws \InvalidArgumentException
1011
     * @param string $cCInfo
1012
     * @return \PayPal\StructType\AccountSummaryType
1013
     */
1014
    public function setCCInfo($cCInfo = null)
1015
    {
1016
        // validation for constraint: string
1017
        if (!is_null($cCInfo) && !is_string($cCInfo)) {
0 ignored issues
show
introduced by
The condition is_string($cCInfo) is always true.
Loading history...
1018
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cCInfo, true), gettype($cCInfo)), __LINE__);
1019
        }
1020
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
1021
        if ('' !== ($cCInfoChoiceErrorMessage = self::validateCCInfoForChoiceConstraintsFromSetCCInfo($cCInfo))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...straintsFromSetCCInfo() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

1021
        if ('' !== ($cCInfoChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateCCInfoForChoiceConstraintsFromSetCCInfo($cCInfo))) {
Loading history...
1022
            throw new \InvalidArgumentException($cCInfoChoiceErrorMessage, __LINE__);
1023
        }
1024
        if (is_null($cCInfo) || (is_array($cCInfo) && empty($cCInfo))) {
1025
            unset($this->CCInfo);
1026
        } else {
1027
            $this->CCInfo = $cCInfo;
1028
        }
1029
        return $this;
1030
    }
1031
    /**
1032
     * Get CCModifyDate value
1033
     * @return string|null
1034
     */
1035
    public function getCCModifyDate()
1036
    {
1037
        return isset($this->CCModifyDate) ? $this->CCModifyDate : null;
1038
    }
1039
    /**
1040
     * This method is responsible for validating the value passed to the setCCModifyDate method
1041
     * This method is willingly generated in order to preserve the one-line inline validation within the setCCModifyDate method
1042
     * This has to validate that the property which is being set is the only one among the given choices
1043
     * @param mixed $value
1044
     * @return string A non-empty message if the values does not match the validation rules
1045
     */
1046
    public function validateCCModifyDateForChoiceConstraintsFromSetCCModifyDate($value)
1047
    {
1048
        $message = '';
1049
        if (is_null($value)) {
1050
            return $message;
1051
        }
1052
        $properties = [
1053
            'AccountState',
1054
            'AdditionalAccount',
1055
            'AdditionalAccountsCount',
1056
            'AmountPastDue',
1057
            'BankAccountInfo',
1058
            'BankModifyDate',
1059
            'BillingCycleDate',
1060
            'CCExp',
1061
            'CCInfo',
1062
            'CurrentBalance',
1063
            'LastAmountPaid',
1064
            'LastInvoiceAmount',
1065
            'LastInvoiceDate',
1066
            'LastPaymentDate',
1067
            'PastDue',
1068
            'PaymentMethod',
1069
        ];
1070
        try {
1071
            foreach ($properties as $property) {
1072
                if (isset($this->{$property})) {
1073
                    throw new \InvalidArgumentException(sprintf('The property CCModifyDate can\'t be set as the property %s is already set. Only one property must be set among these properties: CCModifyDate, %s.', $property, implode(', ', $properties)), __LINE__);
1074
                }
1075
            }
1076
        } catch (\InvalidArgumentException $e) {
1077
            $message = $e->getMessage();
1078
        }
1079
        return $message;
1080
    }
1081
    /**
1082
     * Set CCModifyDate value
1083
     * This property belongs to a choice that allows only one property to exist. It is
1084
     * therefore removable from the request, consequently if the value assigned to this
1085
     * property is null, the property is removed from this object
1086
     * @throws \InvalidArgumentException
1087
     * @param string $cCModifyDate
1088
     * @return \PayPal\StructType\AccountSummaryType
1089
     */
1090
    public function setCCModifyDate($cCModifyDate = null)
1091
    {
1092
        // validation for constraint: string
1093
        if (!is_null($cCModifyDate) && !is_string($cCModifyDate)) {
0 ignored issues
show
introduced by
The condition is_string($cCModifyDate) is always true.
Loading history...
1094
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cCModifyDate, true), gettype($cCModifyDate)), __LINE__);
1095
        }
1096
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
1097
        if ('' !== ($cCModifyDateChoiceErrorMessage = self::validateCCModifyDateForChoiceConstraintsFromSetCCModifyDate($cCModifyDate))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...tsFromSetCCModifyDate() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

1097
        if ('' !== ($cCModifyDateChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateCCModifyDateForChoiceConstraintsFromSetCCModifyDate($cCModifyDate))) {
Loading history...
1098
            throw new \InvalidArgumentException($cCModifyDateChoiceErrorMessage, __LINE__);
1099
        }
1100
        if (is_null($cCModifyDate) || (is_array($cCModifyDate) && empty($cCModifyDate))) {
1101
            unset($this->CCModifyDate);
1102
        } else {
1103
            $this->CCModifyDate = $cCModifyDate;
1104
        }
1105
        return $this;
1106
    }
1107
    /**
1108
     * Get CurrentBalance value
1109
     * @return \PayPal\StructType\AmountType|null
1110
     */
1111
    public function getCurrentBalance()
1112
    {
1113
        return isset($this->CurrentBalance) ? $this->CurrentBalance : null;
1114
    }
1115
    /**
1116
     * This method is responsible for validating the value passed to the setCurrentBalance method
1117
     * This method is willingly generated in order to preserve the one-line inline validation within the setCurrentBalance method
1118
     * This has to validate that the property which is being set is the only one among the given choices
1119
     * @param mixed $value
1120
     * @return string A non-empty message if the values does not match the validation rules
1121
     */
1122
    public function validateCurrentBalanceForChoiceConstraintsFromSetCurrentBalance($value)
1123
    {
1124
        $message = '';
1125
        if (is_null($value)) {
1126
            return $message;
1127
        }
1128
        $properties = [
1129
            'AccountState',
1130
            'AdditionalAccount',
1131
            'AdditionalAccountsCount',
1132
            'AmountPastDue',
1133
            'BankAccountInfo',
1134
            'BankModifyDate',
1135
            'BillingCycleDate',
1136
            'CCExp',
1137
            'CCInfo',
1138
            'CCModifyDate',
1139
            'LastAmountPaid',
1140
            'LastInvoiceAmount',
1141
            'LastInvoiceDate',
1142
            'LastPaymentDate',
1143
            'PastDue',
1144
            'PaymentMethod',
1145
        ];
1146
        try {
1147
            foreach ($properties as $property) {
1148
                if (isset($this->{$property})) {
1149
                    throw new \InvalidArgumentException(sprintf('The property CurrentBalance can\'t be set as the property %s is already set. Only one property must be set among these properties: CurrentBalance, %s.', $property, implode(', ', $properties)), __LINE__);
1150
                }
1151
            }
1152
        } catch (\InvalidArgumentException $e) {
1153
            $message = $e->getMessage();
1154
        }
1155
        return $message;
1156
    }
1157
    /**
1158
     * Set CurrentBalance value
1159
     * This property belongs to a choice that allows only one property to exist. It is
1160
     * therefore removable from the request, consequently if the value assigned to this
1161
     * property is null, the property is removed from this object
1162
     * @throws \InvalidArgumentException
1163
     * @param \PayPal\StructType\AmountType $currentBalance
1164
     * @return \PayPal\StructType\AccountSummaryType
1165
     */
1166
    public function setCurrentBalance(\PayPal\StructType\AmountType $currentBalance = null)
1167
    {
1168
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
1169
        if ('' !== ($currentBalanceChoiceErrorMessage = self::validateCurrentBalanceForChoiceConstraintsFromSetCurrentBalance($currentBalance))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...FromSetCurrentBalance() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

1169
        if ('' !== ($currentBalanceChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateCurrentBalanceForChoiceConstraintsFromSetCurrentBalance($currentBalance))) {
Loading history...
1170
            throw new \InvalidArgumentException($currentBalanceChoiceErrorMessage, __LINE__);
1171
        }
1172
        if (is_null($currentBalance) || (is_array($currentBalance) && empty($currentBalance))) {
1173
            unset($this->CurrentBalance);
1174
        } else {
1175
            $this->CurrentBalance = $currentBalance;
1176
        }
1177
        return $this;
1178
    }
1179
    /**
1180
     * Get LastAmountPaid value
1181
     * @return \PayPal\StructType\AmountType|null
1182
     */
1183
    public function getLastAmountPaid()
1184
    {
1185
        return isset($this->LastAmountPaid) ? $this->LastAmountPaid : null;
1186
    }
1187
    /**
1188
     * This method is responsible for validating the value passed to the setLastAmountPaid method
1189
     * This method is willingly generated in order to preserve the one-line inline validation within the setLastAmountPaid method
1190
     * This has to validate that the property which is being set is the only one among the given choices
1191
     * @param mixed $value
1192
     * @return string A non-empty message if the values does not match the validation rules
1193
     */
1194
    public function validateLastAmountPaidForChoiceConstraintsFromSetLastAmountPaid($value)
1195
    {
1196
        $message = '';
1197
        if (is_null($value)) {
1198
            return $message;
1199
        }
1200
        $properties = [
1201
            'AccountState',
1202
            'AdditionalAccount',
1203
            'AdditionalAccountsCount',
1204
            'AmountPastDue',
1205
            'BankAccountInfo',
1206
            'BankModifyDate',
1207
            'BillingCycleDate',
1208
            'CCExp',
1209
            'CCInfo',
1210
            'CCModifyDate',
1211
            'CurrentBalance',
1212
            'LastInvoiceAmount',
1213
            'LastInvoiceDate',
1214
            'LastPaymentDate',
1215
            'PastDue',
1216
            'PaymentMethod',
1217
        ];
1218
        try {
1219
            foreach ($properties as $property) {
1220
                if (isset($this->{$property})) {
1221
                    throw new \InvalidArgumentException(sprintf('The property LastAmountPaid can\'t be set as the property %s is already set. Only one property must be set among these properties: LastAmountPaid, %s.', $property, implode(', ', $properties)), __LINE__);
1222
                }
1223
            }
1224
        } catch (\InvalidArgumentException $e) {
1225
            $message = $e->getMessage();
1226
        }
1227
        return $message;
1228
    }
1229
    /**
1230
     * Set LastAmountPaid value
1231
     * This property belongs to a choice that allows only one property to exist. It is
1232
     * therefore removable from the request, consequently if the value assigned to this
1233
     * property is null, the property is removed from this object
1234
     * @throws \InvalidArgumentException
1235
     * @param \PayPal\StructType\AmountType $lastAmountPaid
1236
     * @return \PayPal\StructType\AccountSummaryType
1237
     */
1238
    public function setLastAmountPaid(\PayPal\StructType\AmountType $lastAmountPaid = null)
1239
    {
1240
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
1241
        if ('' !== ($lastAmountPaidChoiceErrorMessage = self::validateLastAmountPaidForChoiceConstraintsFromSetLastAmountPaid($lastAmountPaid))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...FromSetLastAmountPaid() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

1241
        if ('' !== ($lastAmountPaidChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateLastAmountPaidForChoiceConstraintsFromSetLastAmountPaid($lastAmountPaid))) {
Loading history...
1242
            throw new \InvalidArgumentException($lastAmountPaidChoiceErrorMessage, __LINE__);
1243
        }
1244
        if (is_null($lastAmountPaid) || (is_array($lastAmountPaid) && empty($lastAmountPaid))) {
1245
            unset($this->LastAmountPaid);
1246
        } else {
1247
            $this->LastAmountPaid = $lastAmountPaid;
1248
        }
1249
        return $this;
1250
    }
1251
    /**
1252
     * Get LastInvoiceAmount value
1253
     * @return \PayPal\StructType\AmountType|null
1254
     */
1255
    public function getLastInvoiceAmount()
1256
    {
1257
        return isset($this->LastInvoiceAmount) ? $this->LastInvoiceAmount : null;
1258
    }
1259
    /**
1260
     * This method is responsible for validating the value passed to the setLastInvoiceAmount method
1261
     * This method is willingly generated in order to preserve the one-line inline validation within the setLastInvoiceAmount method
1262
     * This has to validate that the property which is being set is the only one among the given choices
1263
     * @param mixed $value
1264
     * @return string A non-empty message if the values does not match the validation rules
1265
     */
1266
    public function validateLastInvoiceAmountForChoiceConstraintsFromSetLastInvoiceAmount($value)
1267
    {
1268
        $message = '';
1269
        if (is_null($value)) {
1270
            return $message;
1271
        }
1272
        $properties = [
1273
            'AccountState',
1274
            'AdditionalAccount',
1275
            'AdditionalAccountsCount',
1276
            'AmountPastDue',
1277
            'BankAccountInfo',
1278
            'BankModifyDate',
1279
            'BillingCycleDate',
1280
            'CCExp',
1281
            'CCInfo',
1282
            'CCModifyDate',
1283
            'CurrentBalance',
1284
            'LastAmountPaid',
1285
            'LastInvoiceDate',
1286
            'LastPaymentDate',
1287
            'PastDue',
1288
            'PaymentMethod',
1289
        ];
1290
        try {
1291
            foreach ($properties as $property) {
1292
                if (isset($this->{$property})) {
1293
                    throw new \InvalidArgumentException(sprintf('The property LastInvoiceAmount can\'t be set as the property %s is already set. Only one property must be set among these properties: LastInvoiceAmount, %s.', $property, implode(', ', $properties)), __LINE__);
1294
                }
1295
            }
1296
        } catch (\InvalidArgumentException $e) {
1297
            $message = $e->getMessage();
1298
        }
1299
        return $message;
1300
    }
1301
    /**
1302
     * Set LastInvoiceAmount value
1303
     * This property belongs to a choice that allows only one property to exist. It is
1304
     * therefore removable from the request, consequently if the value assigned to this
1305
     * property is null, the property is removed from this object
1306
     * @throws \InvalidArgumentException
1307
     * @param \PayPal\StructType\AmountType $lastInvoiceAmount
1308
     * @return \PayPal\StructType\AccountSummaryType
1309
     */
1310
    public function setLastInvoiceAmount(\PayPal\StructType\AmountType $lastInvoiceAmount = null)
1311
    {
1312
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
1313
        if ('' !== ($lastInvoiceAmountChoiceErrorMessage = self::validateLastInvoiceAmountForChoiceConstraintsFromSetLastInvoiceAmount($lastInvoiceAmount))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...mSetLastInvoiceAmount() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

1313
        if ('' !== ($lastInvoiceAmountChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateLastInvoiceAmountForChoiceConstraintsFromSetLastInvoiceAmount($lastInvoiceAmount))) {
Loading history...
1314
            throw new \InvalidArgumentException($lastInvoiceAmountChoiceErrorMessage, __LINE__);
1315
        }
1316
        if (is_null($lastInvoiceAmount) || (is_array($lastInvoiceAmount) && empty($lastInvoiceAmount))) {
1317
            unset($this->LastInvoiceAmount);
1318
        } else {
1319
            $this->LastInvoiceAmount = $lastInvoiceAmount;
1320
        }
1321
        return $this;
1322
    }
1323
    /**
1324
     * Get LastInvoiceDate value
1325
     * @return string|null
1326
     */
1327
    public function getLastInvoiceDate()
1328
    {
1329
        return isset($this->LastInvoiceDate) ? $this->LastInvoiceDate : null;
1330
    }
1331
    /**
1332
     * This method is responsible for validating the value passed to the setLastInvoiceDate method
1333
     * This method is willingly generated in order to preserve the one-line inline validation within the setLastInvoiceDate method
1334
     * This has to validate that the property which is being set is the only one among the given choices
1335
     * @param mixed $value
1336
     * @return string A non-empty message if the values does not match the validation rules
1337
     */
1338
    public function validateLastInvoiceDateForChoiceConstraintsFromSetLastInvoiceDate($value)
1339
    {
1340
        $message = '';
1341
        if (is_null($value)) {
1342
            return $message;
1343
        }
1344
        $properties = [
1345
            'AccountState',
1346
            'AdditionalAccount',
1347
            'AdditionalAccountsCount',
1348
            'AmountPastDue',
1349
            'BankAccountInfo',
1350
            'BankModifyDate',
1351
            'BillingCycleDate',
1352
            'CCExp',
1353
            'CCInfo',
1354
            'CCModifyDate',
1355
            'CurrentBalance',
1356
            'LastAmountPaid',
1357
            'LastInvoiceAmount',
1358
            'LastPaymentDate',
1359
            'PastDue',
1360
            'PaymentMethod',
1361
        ];
1362
        try {
1363
            foreach ($properties as $property) {
1364
                if (isset($this->{$property})) {
1365
                    throw new \InvalidArgumentException(sprintf('The property LastInvoiceDate can\'t be set as the property %s is already set. Only one property must be set among these properties: LastInvoiceDate, %s.', $property, implode(', ', $properties)), __LINE__);
1366
                }
1367
            }
1368
        } catch (\InvalidArgumentException $e) {
1369
            $message = $e->getMessage();
1370
        }
1371
        return $message;
1372
    }
1373
    /**
1374
     * Set LastInvoiceDate value
1375
     * This property belongs to a choice that allows only one property to exist. It is
1376
     * therefore removable from the request, consequently if the value assigned to this
1377
     * property is null, the property is removed from this object
1378
     * @throws \InvalidArgumentException
1379
     * @param string $lastInvoiceDate
1380
     * @return \PayPal\StructType\AccountSummaryType
1381
     */
1382
    public function setLastInvoiceDate($lastInvoiceDate = null)
1383
    {
1384
        // validation for constraint: string
1385
        if (!is_null($lastInvoiceDate) && !is_string($lastInvoiceDate)) {
0 ignored issues
show
introduced by
The condition is_string($lastInvoiceDate) is always true.
Loading history...
1386
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lastInvoiceDate, true), gettype($lastInvoiceDate)), __LINE__);
1387
        }
1388
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
1389
        if ('' !== ($lastInvoiceDateChoiceErrorMessage = self::validateLastInvoiceDateForChoiceConstraintsFromSetLastInvoiceDate($lastInvoiceDate))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...romSetLastInvoiceDate() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

1389
        if ('' !== ($lastInvoiceDateChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateLastInvoiceDateForChoiceConstraintsFromSetLastInvoiceDate($lastInvoiceDate))) {
Loading history...
1390
            throw new \InvalidArgumentException($lastInvoiceDateChoiceErrorMessage, __LINE__);
1391
        }
1392
        if (is_null($lastInvoiceDate) || (is_array($lastInvoiceDate) && empty($lastInvoiceDate))) {
1393
            unset($this->LastInvoiceDate);
1394
        } else {
1395
            $this->LastInvoiceDate = $lastInvoiceDate;
1396
        }
1397
        return $this;
1398
    }
1399
    /**
1400
     * Get LastPaymentDate value
1401
     * @return string|null
1402
     */
1403
    public function getLastPaymentDate()
1404
    {
1405
        return isset($this->LastPaymentDate) ? $this->LastPaymentDate : null;
1406
    }
1407
    /**
1408
     * This method is responsible for validating the value passed to the setLastPaymentDate method
1409
     * This method is willingly generated in order to preserve the one-line inline validation within the setLastPaymentDate method
1410
     * This has to validate that the property which is being set is the only one among the given choices
1411
     * @param mixed $value
1412
     * @return string A non-empty message if the values does not match the validation rules
1413
     */
1414
    public function validateLastPaymentDateForChoiceConstraintsFromSetLastPaymentDate($value)
1415
    {
1416
        $message = '';
1417
        if (is_null($value)) {
1418
            return $message;
1419
        }
1420
        $properties = [
1421
            'AccountState',
1422
            'AdditionalAccount',
1423
            'AdditionalAccountsCount',
1424
            'AmountPastDue',
1425
            'BankAccountInfo',
1426
            'BankModifyDate',
1427
            'BillingCycleDate',
1428
            'CCExp',
1429
            'CCInfo',
1430
            'CCModifyDate',
1431
            'CurrentBalance',
1432
            'LastAmountPaid',
1433
            'LastInvoiceAmount',
1434
            'LastInvoiceDate',
1435
            'PastDue',
1436
            'PaymentMethod',
1437
        ];
1438
        try {
1439
            foreach ($properties as $property) {
1440
                if (isset($this->{$property})) {
1441
                    throw new \InvalidArgumentException(sprintf('The property LastPaymentDate can\'t be set as the property %s is already set. Only one property must be set among these properties: LastPaymentDate, %s.', $property, implode(', ', $properties)), __LINE__);
1442
                }
1443
            }
1444
        } catch (\InvalidArgumentException $e) {
1445
            $message = $e->getMessage();
1446
        }
1447
        return $message;
1448
    }
1449
    /**
1450
     * Set LastPaymentDate value
1451
     * This property belongs to a choice that allows only one property to exist. It is
1452
     * therefore removable from the request, consequently if the value assigned to this
1453
     * property is null, the property is removed from this object
1454
     * @throws \InvalidArgumentException
1455
     * @param string $lastPaymentDate
1456
     * @return \PayPal\StructType\AccountSummaryType
1457
     */
1458
    public function setLastPaymentDate($lastPaymentDate = null)
1459
    {
1460
        // validation for constraint: string
1461
        if (!is_null($lastPaymentDate) && !is_string($lastPaymentDate)) {
0 ignored issues
show
introduced by
The condition is_string($lastPaymentDate) is always true.
Loading history...
1462
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lastPaymentDate, true), gettype($lastPaymentDate)), __LINE__);
1463
        }
1464
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
1465
        if ('' !== ($lastPaymentDateChoiceErrorMessage = self::validateLastPaymentDateForChoiceConstraintsFromSetLastPaymentDate($lastPaymentDate))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...romSetLastPaymentDate() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

1465
        if ('' !== ($lastPaymentDateChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validateLastPaymentDateForChoiceConstraintsFromSetLastPaymentDate($lastPaymentDate))) {
Loading history...
1466
            throw new \InvalidArgumentException($lastPaymentDateChoiceErrorMessage, __LINE__);
1467
        }
1468
        if (is_null($lastPaymentDate) || (is_array($lastPaymentDate) && empty($lastPaymentDate))) {
1469
            unset($this->LastPaymentDate);
1470
        } else {
1471
            $this->LastPaymentDate = $lastPaymentDate;
1472
        }
1473
        return $this;
1474
    }
1475
    /**
1476
     * Get PastDue value
1477
     * @return bool|null
1478
     */
1479
    public function getPastDue()
1480
    {
1481
        return isset($this->PastDue) ? $this->PastDue : null;
1482
    }
1483
    /**
1484
     * This method is responsible for validating the value passed to the setPastDue method
1485
     * This method is willingly generated in order to preserve the one-line inline validation within the setPastDue method
1486
     * This has to validate that the property which is being set is the only one among the given choices
1487
     * @param mixed $value
1488
     * @return string A non-empty message if the values does not match the validation rules
1489
     */
1490
    public function validatePastDueForChoiceConstraintsFromSetPastDue($value)
1491
    {
1492
        $message = '';
1493
        if (is_null($value)) {
1494
            return $message;
1495
        }
1496
        $properties = [
1497
            'AccountState',
1498
            'AdditionalAccount',
1499
            'AdditionalAccountsCount',
1500
            'AmountPastDue',
1501
            'BankAccountInfo',
1502
            'BankModifyDate',
1503
            'BillingCycleDate',
1504
            'CCExp',
1505
            'CCInfo',
1506
            'CCModifyDate',
1507
            'CurrentBalance',
1508
            'LastAmountPaid',
1509
            'LastInvoiceAmount',
1510
            'LastInvoiceDate',
1511
            'LastPaymentDate',
1512
            'PaymentMethod',
1513
        ];
1514
        try {
1515
            foreach ($properties as $property) {
1516
                if (isset($this->{$property})) {
1517
                    throw new \InvalidArgumentException(sprintf('The property PastDue can\'t be set as the property %s is already set. Only one property must be set among these properties: PastDue, %s.', $property, implode(', ', $properties)), __LINE__);
1518
                }
1519
            }
1520
        } catch (\InvalidArgumentException $e) {
1521
            $message = $e->getMessage();
1522
        }
1523
        return $message;
1524
    }
1525
    /**
1526
     * Set PastDue value
1527
     * This property belongs to a choice that allows only one property to exist. It is
1528
     * therefore removable from the request, consequently if the value assigned to this
1529
     * property is null, the property is removed from this object
1530
     * @throws \InvalidArgumentException
1531
     * @param bool $pastDue
1532
     * @return \PayPal\StructType\AccountSummaryType
1533
     */
1534
    public function setPastDue($pastDue = null)
1535
    {
1536
        // validation for constraint: boolean
1537
        if (!is_null($pastDue) && !is_bool($pastDue)) {
0 ignored issues
show
introduced by
The condition is_bool($pastDue) is always true.
Loading history...
1538
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($pastDue, true), gettype($pastDue)), __LINE__);
1539
        }
1540
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
1541
        if ('' !== ($pastDueChoiceErrorMessage = self::validatePastDueForChoiceConstraintsFromSetPastDue($pastDue))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...traintsFromSetPastDue() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

1541
        if ('' !== ($pastDueChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validatePastDueForChoiceConstraintsFromSetPastDue($pastDue))) {
Loading history...
1542
            throw new \InvalidArgumentException($pastDueChoiceErrorMessage, __LINE__);
1543
        }
1544
        if (is_null($pastDue) || (is_array($pastDue) && empty($pastDue))) {
1545
            unset($this->PastDue);
1546
        } else {
1547
            $this->PastDue = $pastDue;
1548
        }
1549
        return $this;
1550
    }
1551
    /**
1552
     * Get PaymentMethod value
1553
     * @return string|null
1554
     */
1555
    public function getPaymentMethod()
1556
    {
1557
        return isset($this->PaymentMethod) ? $this->PaymentMethod : null;
1558
    }
1559
    /**
1560
     * This method is responsible for validating the value passed to the setPaymentMethod method
1561
     * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentMethod method
1562
     * This has to validate that the property which is being set is the only one among the given choices
1563
     * @param mixed $value
1564
     * @return string A non-empty message if the values does not match the validation rules
1565
     */
1566
    public function validatePaymentMethodForChoiceConstraintsFromSetPaymentMethod($value)
1567
    {
1568
        $message = '';
1569
        if (is_null($value)) {
1570
            return $message;
1571
        }
1572
        $properties = [
1573
            'AccountState',
1574
            'AdditionalAccount',
1575
            'AdditionalAccountsCount',
1576
            'AmountPastDue',
1577
            'BankAccountInfo',
1578
            'BankModifyDate',
1579
            'BillingCycleDate',
1580
            'CCExp',
1581
            'CCInfo',
1582
            'CCModifyDate',
1583
            'CurrentBalance',
1584
            'LastAmountPaid',
1585
            'LastInvoiceAmount',
1586
            'LastInvoiceDate',
1587
            'LastPaymentDate',
1588
            'PastDue',
1589
        ];
1590
        try {
1591
            foreach ($properties as $property) {
1592
                if (isset($this->{$property})) {
1593
                    throw new \InvalidArgumentException(sprintf('The property PaymentMethod can\'t be set as the property %s is already set. Only one property must be set among these properties: PaymentMethod, %s.', $property, implode(', ', $properties)), __LINE__);
1594
                }
1595
            }
1596
        } catch (\InvalidArgumentException $e) {
1597
            $message = $e->getMessage();
1598
        }
1599
        return $message;
1600
    }
1601
    /**
1602
     * Set PaymentMethod value
1603
     * This property belongs to a choice that allows only one property to exist. It is
1604
     * therefore removable from the request, consequently if the value assigned to this
1605
     * property is null, the property is removed from this object
1606
     * @throws \InvalidArgumentException
1607
     * @uses \PayPal\EnumType\SellerPaymentMethodCodeType::valueIsValid()
1608
     * @uses \PayPal\EnumType\SellerPaymentMethodCodeType::getValidValues()
1609
     * @throws \InvalidArgumentException
1610
     * @param string $paymentMethod
1611
     * @return \PayPal\StructType\AccountSummaryType
1612
     */
1613
    public function setPaymentMethod($paymentMethod = null)
1614
    {
1615
        // validation for constraint: enumeration
1616
        if (!\PayPal\EnumType\SellerPaymentMethodCodeType::valueIsValid($paymentMethod)) {
1617
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SellerPaymentMethodCodeType', is_array($paymentMethod) ? implode(', ', $paymentMethod) : var_export($paymentMethod, true), implode(', ', \PayPal\EnumType\SellerPaymentMethodCodeType::getValidValues())), __LINE__);
0 ignored issues
show
introduced by
The condition is_array($paymentMethod) is always false.
Loading history...
1618
        }
1619
        // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod)
1620
        if ('' !== ($paymentMethodChoiceErrorMessage = self::validatePaymentMethodForChoiceConstraintsFromSetPaymentMethod($paymentMethod))) {
0 ignored issues
show
Bug Best Practice introduced by
The method PayPal\StructType\Accoun...sFromSetPaymentMethod() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

1620
        if ('' !== ($paymentMethodChoiceErrorMessage = self::/** @scrutinizer ignore-call */ validatePaymentMethodForChoiceConstraintsFromSetPaymentMethod($paymentMethod))) {
Loading history...
1621
            throw new \InvalidArgumentException($paymentMethodChoiceErrorMessage, __LINE__);
1622
        }
1623
        if (is_null($paymentMethod) || (is_array($paymentMethod) && empty($paymentMethod))) {
1624
            unset($this->PaymentMethod);
1625
        } else {
1626
            $this->PaymentMethod = $paymentMethod;
1627
        }
1628
        return $this;
1629
    }
1630
}
1631