Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update SDK from api-definitions #651

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shaggy-knives-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add three3dsIO to Airwallex Rebilly/api-definitions#1647
5 changes: 5 additions & 0 deletions .changeset/sweet-news-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add dispute type Rebilly/api-definitions#1646
22 changes: 22 additions & 0 deletions src/Model/Airwallex.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public function __construct(array $data = [])
if (array_key_exists('credentials', $data)) {
$this->setCredentials($data['credentials']);
}
if (array_key_exists('threeDSecureServer', $data)) {
$this->setThreeDSecureServer($data['threeDSecureServer']);
}
}

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

public function getThreeDSecureServer(): ?ThreeDSecureIO3dsServer
{
return $this->fields['threeDSecureServer'] ?? null;
}

public function setThreeDSecureServer(null|ThreeDSecureIO3dsServer|array $threeDSecureServer): static
{
if ($threeDSecureServer !== null && !($threeDSecureServer instanceof ThreeDSecureIO3dsServer)) {
$threeDSecureServer = ThreeDSecureIO3dsServer::from($threeDSecureServer);
}

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

return $this;
}

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

return parent::jsonSerialize() + $data;
}
Expand Down
51 changes: 51 additions & 0 deletions src/Model/CouponRestrictionDiscountPerRedemption.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

class CouponRestrictionDiscountPerRedemption implements CouponRestriction, RedemptionRestriction, JsonSerializable
{
public const REQUIRE_ALL_TAGS_TRUE = 'true';

public const REQUIRE_ALL_TAGS_FALSE = 'false';

private array $fields = [];

public function __construct(array $data = [])
Expand All @@ -38,6 +42,9 @@ public function __construct(array $data = [])
if (array_key_exists('countries', $data)) {
$this->setCountries($data['countries']);
}
if (array_key_exists('tags', $data)) {
$this->setTags($data['tags']);
}
if (array_key_exists('productIds', $data)) {
$this->setProductIds($data['productIds']);
}
Expand All @@ -56,6 +63,9 @@ public function __construct(array $data = [])
if (array_key_exists('time', $data)) {
$this->setTime($data['time']);
}
if (array_key_exists('requireAllTags', $data)) {
$this->setRequireAllTags($data['requireAllTags']);
}
if (array_key_exists('minimumQuantity', $data)) {
$this->setMinimumQuantity($data['minimumQuantity']);
}
Expand Down Expand Up @@ -167,6 +177,29 @@ public function setCountries(array $countries): static
return $this;
}

/**
* @return string[]
*/
public function getTags(): array
{
return $this->fields['tags'];
}

/**
* @param string[] $tags
*/
public function setTags(array $tags): static
{
$tags = array_map(
fn ($value) => $value,
$tags,
);

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

return $this;
}

/**
* @return string[]
*/
Expand Down Expand Up @@ -287,6 +320,18 @@ public function setTime(DateTimeImmutable|string $time): static
return $this;
}

public function getRequireAllTags(): string
{
return $this->fields['requireAllTags'];
}

public function setRequireAllTags(string $requireAllTags): static
{
$this->fields['requireAllTags'] = $requireAllTags;

return $this;
}

public function getMinimumQuantity(): ?int
{
return $this->fields['minimumQuantity'] ?? null;
Expand Down Expand Up @@ -342,6 +387,9 @@ public function jsonSerialize(): array
if (array_key_exists('countries', $this->fields)) {
$data['countries'] = $this->fields['countries'];
}
if (array_key_exists('tags', $this->fields)) {
$data['tags'] = $this->fields['tags'];
}
if (array_key_exists('productIds', $this->fields)) {
$data['productIds'] = $this->fields['productIds'];
}
Expand All @@ -360,6 +408,9 @@ public function jsonSerialize(): array
if (array_key_exists('time', $this->fields)) {
$data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339);
}
if (array_key_exists('requireAllTags', $this->fields)) {
$data['requireAllTags'] = $this->fields['requireAllTags'];
}
if (array_key_exists('minimumQuantity', $this->fields)) {
$data['minimumQuantity'] = $this->fields['minimumQuantity'];
}
Expand Down
51 changes: 51 additions & 0 deletions src/Model/CouponRestrictionExclusiveApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

class CouponRestrictionExclusiveApplication implements CouponRestriction, JsonSerializable
{
public const REQUIRE_ALL_TAGS_TRUE = 'true';

public const REQUIRE_ALL_TAGS_FALSE = 'false';

private array $fields = [];

public function __construct(array $data = [])
Expand All @@ -38,6 +42,9 @@ public function __construct(array $data = [])
if (array_key_exists('countries', $data)) {
$this->setCountries($data['countries']);
}
if (array_key_exists('tags', $data)) {
$this->setTags($data['tags']);
}
if (array_key_exists('productIds', $data)) {
$this->setProductIds($data['productIds']);
}
Expand All @@ -56,6 +63,9 @@ public function __construct(array $data = [])
if (array_key_exists('time', $data)) {
$this->setTime($data['time']);
}
if (array_key_exists('requireAllTags', $data)) {
$this->setRequireAllTags($data['requireAllTags']);
}
if (array_key_exists('minimumQuantity', $data)) {
$this->setMinimumQuantity($data['minimumQuantity']);
}
Expand Down Expand Up @@ -167,6 +177,29 @@ public function setCountries(array $countries): static
return $this;
}

/**
* @return string[]
*/
public function getTags(): array
{
return $this->fields['tags'];
}

/**
* @param string[] $tags
*/
public function setTags(array $tags): static
{
$tags = array_map(
fn ($value) => $value,
$tags,
);

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

return $this;
}

/**
* @return string[]
*/
Expand Down Expand Up @@ -287,6 +320,18 @@ public function setTime(DateTimeImmutable|string $time): static
return $this;
}

public function getRequireAllTags(): string
{
return $this->fields['requireAllTags'];
}

public function setRequireAllTags(string $requireAllTags): static
{
$this->fields['requireAllTags'] = $requireAllTags;

return $this;
}

public function getMinimumQuantity(): ?int
{
return $this->fields['minimumQuantity'] ?? null;
Expand Down Expand Up @@ -342,6 +387,9 @@ public function jsonSerialize(): array
if (array_key_exists('countries', $this->fields)) {
$data['countries'] = $this->fields['countries'];
}
if (array_key_exists('tags', $this->fields)) {
$data['tags'] = $this->fields['tags'];
}
if (array_key_exists('productIds', $this->fields)) {
$data['productIds'] = $this->fields['productIds'];
}
Expand All @@ -360,6 +408,9 @@ public function jsonSerialize(): array
if (array_key_exists('time', $this->fields)) {
$data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339);
}
if (array_key_exists('requireAllTags', $this->fields)) {
$data['requireAllTags'] = $this->fields['requireAllTags'];
}
if (array_key_exists('minimumQuantity', $this->fields)) {
$data['minimumQuantity'] = $this->fields['minimumQuantity'];
}
Expand Down
1 change: 1 addition & 0 deletions src/Model/CouponRestrictionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static function from(array $data = []): CouponRestriction
'redemptions-per-customer' => CouponRestrictionRedemptionsPerCustomer::from($data),
'restrict-to-bxgy' => CouponRestrictionRestrictToBxgy::from($data),
'restrict-to-countries' => CouponRestrictionRestrictToCountries::from($data),
'restrict-to-customer-tags' => CouponRestrictionRestrictToCustomerTags::from($data),
'restrict-to-customers' => CouponRestrictionRestrictToCustomers::from($data),
'restrict-to-exclusive-application' => CouponRestrictionExclusiveApplication::from($data),
'restrict-to-invoices' => CouponRestrictionRestrictToInvoices::from($data),
Expand Down
51 changes: 51 additions & 0 deletions src/Model/CouponRestrictionMinimumOrderAmount.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

class CouponRestrictionMinimumOrderAmount implements CouponRestriction, RedemptionRestriction, JsonSerializable
{
public const REQUIRE_ALL_TAGS_TRUE = 'true';

public const REQUIRE_ALL_TAGS_FALSE = 'false';

private array $fields = [];

public function __construct(array $data = [])
Expand All @@ -41,6 +45,9 @@ public function __construct(array $data = [])
if (array_key_exists('countries', $data)) {
$this->setCountries($data['countries']);
}
if (array_key_exists('tags', $data)) {
$this->setTags($data['tags']);
}
if (array_key_exists('productIds', $data)) {
$this->setProductIds($data['productIds']);
}
Expand All @@ -56,6 +63,9 @@ public function __construct(array $data = [])
if (array_key_exists('time', $data)) {
$this->setTime($data['time']);
}
if (array_key_exists('requireAllTags', $data)) {
$this->setRequireAllTags($data['requireAllTags']);
}
if (array_key_exists('minimumQuantity', $data)) {
$this->setMinimumQuantity($data['minimumQuantity']);
}
Expand Down Expand Up @@ -179,6 +189,29 @@ public function setCountries(array $countries): static
return $this;
}

/**
* @return string[]
*/
public function getTags(): array
{
return $this->fields['tags'];
}

/**
* @param string[] $tags
*/
public function setTags(array $tags): static
{
$tags = array_map(
fn ($value) => $value,
$tags,
);

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

return $this;
}

/**
* @return string[]
*/
Expand Down Expand Up @@ -287,6 +320,18 @@ public function setTime(DateTimeImmutable|string $time): static
return $this;
}

public function getRequireAllTags(): string
{
return $this->fields['requireAllTags'];
}

public function setRequireAllTags(string $requireAllTags): static
{
$this->fields['requireAllTags'] = $requireAllTags;

return $this;
}

public function getMinimumQuantity(): ?int
{
return $this->fields['minimumQuantity'] ?? null;
Expand Down Expand Up @@ -345,6 +390,9 @@ public function jsonSerialize(): array
if (array_key_exists('countries', $this->fields)) {
$data['countries'] = $this->fields['countries'];
}
if (array_key_exists('tags', $this->fields)) {
$data['tags'] = $this->fields['tags'];
}
if (array_key_exists('productIds', $this->fields)) {
$data['productIds'] = $this->fields['productIds'];
}
Expand All @@ -360,6 +408,9 @@ public function jsonSerialize(): array
if (array_key_exists('time', $this->fields)) {
$data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339);
}
if (array_key_exists('requireAllTags', $this->fields)) {
$data['requireAllTags'] = $this->fields['requireAllTags'];
}
if (array_key_exists('minimumQuantity', $this->fields)) {
$data['minimumQuantity'] = $this->fields['minimumQuantity'];
}
Expand Down
Loading