Skip to content

Commit

Permalink
update SDK from api-definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
rebilly-machine-user authored Jan 14, 2025
1 parent 6f9ca46 commit 9060950
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-laws-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

feat(api-definition): Add Tabby gateway settings Rebilly/rebilly#9588
5 changes: 5 additions & 0 deletions .changeset/sharp-squids-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

fix(api-definitions): Fix column types for Payout requests grid Rebilly/rebilly#9513
18 changes: 18 additions & 0 deletions src/Model/PayoutRequestAllocations.php
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,9 @@ public function __construct(array $data = [])
if (array_key_exists('amount', $data)) {
$this->setAmount($data['amount']);
}
if (array_key_exists('currency', $data)) {
$this->setCurrency($data['currency']);
}
if (array_key_exists('createdTime', $data)) {
$this->setCreatedTime($data['createdTime']);
}
Expand Down Expand Up @@ -918,6 +921,18 @@ public function setAmount(null|float|string $amount): static
return $this;
}

public function getCurrency(): ?string
{
return $this->fields['currency'] ?? null;
}

public function setCurrency(null|string $currency): static
{
$this->fields['currency'] = $currency;

return $this;
}

public function getCreatedTime(): ?DateTimeImmutable
{
return $this->fields['createdTime'] ?? null;
Expand Down Expand Up @@ -949,6 +964,9 @@ public function jsonSerialize(): array
if (array_key_exists('amount', $this->fields)) {
$data['amount'] = $this->fields['amount'];
}
if (array_key_exists('currency', $this->fields)) {
$data['currency'] = $this->fields['currency'];
}
if (array_key_exists('createdTime', $this->fields)) {
$data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339);
}
Expand Down
22 changes: 22 additions & 0 deletions src/Model/Tabby.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public function __construct(array $data = [])
if (array_key_exists('credentials', $data)) {
$this->setCredentials($data['credentials']);
}
if (array_key_exists('settings', $data)) {
$this->setSettings($data['settings']);
}
}

public static function from(array $data = []): self
Expand All @@ -50,12 +53,31 @@ public function setCredentials(TabbyCredentials|array $credentials): static
return $this;
}

public function getSettings(): ?TabbySettings
{
return $this->fields['settings'] ?? null;
}

public function setSettings(null|TabbySettings|array $settings): static
{
if ($settings !== null && !($settings instanceof TabbySettings)) {
$settings = TabbySettings::from($settings);
}

$this->fields['settings'] = $settings;

return $this;
}

public function jsonSerialize(): array
{
$data = [];
if (array_key_exists('credentials', $this->fields)) {
$data['credentials'] = $this->fields['credentials']->jsonSerialize();
}
if (array_key_exists('settings', $this->fields)) {
$data['settings'] = $this->fields['settings']?->jsonSerialize();
}

return parent::jsonSerialize() + $data;
}
Expand Down
56 changes: 56 additions & 0 deletions src/Model/TabbySettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?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 TabbySettings implements JsonSerializable
{
private array $fields = [];

public function __construct(array $data = [])
{
if (array_key_exists('category', $data)) {
$this->setCategory($data['category']);
}
}

public static function from(array $data = []): self
{
return new self($data);
}

public function getCategory(): ?string
{
return $this->fields['category'] ?? null;
}

public function setCategory(null|string $category): static
{
$this->fields['category'] = $category;

return $this;
}

public function jsonSerialize(): array
{
$data = [];
if (array_key_exists('category', $this->fields)) {
$data['category'] = $this->fields['category'];
}

return $data;
}
}

0 comments on commit 9060950

Please sign in to comment.