-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update SDK from api-definitions (#678)
Co-authored-by: rebilly-machine-user <[email protected]>
- Loading branch information
1 parent
fe3d930
commit d876527
Showing
6 changed files
with
216 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rebilly/client-php": patch | ||
--- | ||
|
||
Add usage settings for ChangeQuote Rebilly/api-definitions#1840 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
/** | ||
* This source file is proprietary and part of Rebilly. | ||
* | ||
* (c) Rebilly SRL | ||
* Rebilly Ltd. | ||
* Rebilly Inc. | ||
* | ||
* @see https://www.rebilly.com | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rebilly\Sdk\Model; | ||
|
||
use JsonSerializable; | ||
|
||
class QuoteChangeOrderUsageSettings implements JsonSerializable | ||
{ | ||
public const POLICY_RESET = 'reset'; | ||
|
||
public const POLICY_TRANSFER = 'transfer'; | ||
|
||
private array $fields = []; | ||
|
||
public function __construct(array $data = []) | ||
{ | ||
if (array_key_exists('planId', $data)) { | ||
$this->setPlanId($data['planId']); | ||
} | ||
if (array_key_exists('policy', $data)) { | ||
$this->setPolicy($data['policy']); | ||
} | ||
if (array_key_exists('transferTo', $data)) { | ||
$this->setTransferTo($data['transferTo']); | ||
} | ||
} | ||
|
||
public static function from(array $data = []): self | ||
{ | ||
return new self($data); | ||
} | ||
|
||
public function getPlanId(): ?string | ||
{ | ||
return $this->fields['planId'] ?? null; | ||
} | ||
|
||
public function setPlanId(null|string $planId): static | ||
{ | ||
$this->fields['planId'] = $planId; | ||
|
||
return $this; | ||
} | ||
|
||
public function getPolicy(): ?string | ||
{ | ||
return $this->fields['policy'] ?? null; | ||
} | ||
|
||
public function setPolicy(null|string $policy): static | ||
{ | ||
$this->fields['policy'] = $policy; | ||
|
||
return $this; | ||
} | ||
|
||
public function getTransferTo(): ?string | ||
{ | ||
return $this->fields['transferTo'] ?? null; | ||
} | ||
|
||
public function setTransferTo(null|string $transferTo): static | ||
{ | ||
$this->fields['transferTo'] = $transferTo; | ||
|
||
return $this; | ||
} | ||
|
||
public function jsonSerialize(): array | ||
{ | ||
$data = []; | ||
if (array_key_exists('planId', $this->fields)) { | ||
$data['planId'] = $this->fields['planId']; | ||
} | ||
if (array_key_exists('policy', $this->fields)) { | ||
$data['policy'] = $this->fields['policy']; | ||
} | ||
if (array_key_exists('transferTo', $this->fields)) { | ||
$data['transferTo'] = $this->fields['transferTo']; | ||
} | ||
|
||
return $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters