Skip to content

Commit

Permalink
chore: update SDK from api-definitions (#636)
Browse files Browse the repository at this point in the history
Co-authored-by: justnero <[email protected]>
Co-authored-by: Arif Kurkchi <[email protected]>
  • Loading branch information
3 people authored Oct 13, 2023
1 parent 552fd94 commit 4ce432c
Show file tree
Hide file tree
Showing 27 changed files with 1,104 additions and 70 deletions.
10 changes: 10 additions & 0 deletions .changeset/lazy-dolphins-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@rebilly/client-php": patch
---

Add dispute credentials for PSiGate
Add quote events to customer timeline
Add PayRedeem gateway config
Add Restrict to customer coupon restriction type
Add customerDocumentCustomField setting to dLocal
Add pricing min quantity
41 changes: 35 additions & 6 deletions src/Model/CouponRestrictionDiscountPerRedemption.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public function __construct(array $data = [])
if (array_key_exists('currency', $data)) {
$this->setCurrency($data['currency']);
}
if (array_key_exists('customerIds', $data)) {
$this->setCustomerIds($data['customerIds']);
}
if (array_key_exists('time', $data)) {
$this->setTime($data['time']);
}
Expand Down Expand Up @@ -119,20 +122,20 @@ public function setAmount(int $amount): static
}

/**
* @return CouponRestrictionRetrictToBxgyBuy[]
* @return CouponRestrictionRestrictToBxgyBuy[]
*/
public function getBuy(): array
{
return $this->fields['buy'];
}

/**
* @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy
* @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy
*/
public function setBuy(array $buy): static
{
$buy = array_map(
fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null,
fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null,
$buy,
);

Expand Down Expand Up @@ -211,20 +214,20 @@ public function setSubscriptionIds(array $subscriptionIds): static
}

/**
* @return CouponRestrictionRetrictToBxgyGet[]
* @return CouponRestrictionRestrictToBxgyGet[]
*/
public function getGet(): array
{
return $this->fields['get'];
}

/**
* @param array[]|CouponRestrictionRetrictToBxgyGet[] $get
* @param array[]|CouponRestrictionRestrictToBxgyGet[] $get
*/
public function setGet(array $get): static
{
$get = array_map(
fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null,
fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null,
$get,
);

Expand All @@ -245,6 +248,29 @@ public function setCurrency(string $currency): static
return $this;
}

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

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

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

return $this;
}

public function getTime(): DateTimeImmutable
{
return $this->fields['time'];
Expand Down Expand Up @@ -328,6 +354,9 @@ public function jsonSerialize(): array
if (array_key_exists('currency', $this->fields)) {
$data['currency'] = $this->fields['currency'];
}
if (array_key_exists('customerIds', $this->fields)) {
$data['customerIds'] = $this->fields['customerIds'];
}
if (array_key_exists('time', $this->fields)) {
$data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Model/CouponRestrictionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ public static function from(array $data = []): CouponRestriction
'minimum-order-amount' => CouponRestrictionMinimumOrderAmount::from($data),
'paid-by-time' => CouponRestrictionPaidByTime::from($data),
'redemptions-per-customer' => CouponRestrictionRedemptionsPerCustomer::from($data),
'restrict-to-bxgy' => CouponRestrictionRetrictToBxgy::from($data),
'restrict-to-bxgy' => CouponRestrictionRestrictToBxgy::from($data),
'restrict-to-countries' => CouponRestrictionRestrictToCountries::from($data),
'restrict-to-customers' => CouponRestrictionRestrictToCustomers::from($data),
'restrict-to-invoices' => CouponRestrictionRestrictToInvoices::from($data),
'restrict-to-plans' => CouponRestrictionRestrictToPlans::from($data),
'restrict-to-products' => CouponRestrictionRestrictToProducts::from($data),
Expand Down
41 changes: 35 additions & 6 deletions src/Model/CouponRestrictionMinimumOrderAmount.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public function __construct(array $data = [])
if (array_key_exists('get', $data)) {
$this->setGet($data['get']);
}
if (array_key_exists('customerIds', $data)) {
$this->setCustomerIds($data['customerIds']);
}
if (array_key_exists('time', $data)) {
$this->setTime($data['time']);
}
Expand Down Expand Up @@ -131,20 +134,20 @@ public function setQuantity(int $quantity): static
}

/**
* @return CouponRestrictionRetrictToBxgyBuy[]
* @return CouponRestrictionRestrictToBxgyBuy[]
*/
public function getBuy(): array
{
return $this->fields['buy'];
}

/**
* @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy
* @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy
*/
public function setBuy(array $buy): static
{
$buy = array_map(
fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null,
fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null,
$buy,
);

Expand Down Expand Up @@ -223,20 +226,20 @@ public function setSubscriptionIds(array $subscriptionIds): static
}

/**
* @return CouponRestrictionRetrictToBxgyGet[]
* @return CouponRestrictionRestrictToBxgyGet[]
*/
public function getGet(): array
{
return $this->fields['get'];
}

/**
* @param array[]|CouponRestrictionRetrictToBxgyGet[] $get
* @param array[]|CouponRestrictionRestrictToBxgyGet[] $get
*/
public function setGet(array $get): static
{
$get = array_map(
fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null,
fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null,
$get,
);

Expand All @@ -245,6 +248,29 @@ public function setGet(array $get): static
return $this;
}

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

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

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

return $this;
}

public function getTime(): DateTimeImmutable
{
return $this->fields['time'];
Expand Down Expand Up @@ -328,6 +354,9 @@ public function jsonSerialize(): array
if (array_key_exists('get', $this->fields)) {
$data['get'] = $this->fields['get'];
}
if (array_key_exists('customerIds', $this->fields)) {
$data['customerIds'] = $this->fields['customerIds'];
}
if (array_key_exists('time', $this->fields)) {
$data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339);
}
Expand Down
41 changes: 35 additions & 6 deletions src/Model/CouponRestrictionPaidByTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public function __construct(array $data = [])
if (array_key_exists('currency', $data)) {
$this->setCurrency($data['currency']);
}
if (array_key_exists('customerIds', $data)) {
$this->setCustomerIds($data['customerIds']);
}
if (array_key_exists('minimumQuantity', $data)) {
$this->setMinimumQuantity($data['minimumQuantity']);
}
Expand Down Expand Up @@ -135,20 +138,20 @@ public function setQuantity(int $quantity): static
}

/**
* @return CouponRestrictionRetrictToBxgyBuy[]
* @return CouponRestrictionRestrictToBxgyBuy[]
*/
public function getBuy(): array
{
return $this->fields['buy'];
}

/**
* @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy
* @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy
*/
public function setBuy(array $buy): static
{
$buy = array_map(
fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null,
fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null,
$buy,
);

Expand Down Expand Up @@ -227,20 +230,20 @@ public function setSubscriptionIds(array $subscriptionIds): static
}

/**
* @return CouponRestrictionRetrictToBxgyGet[]
* @return CouponRestrictionRestrictToBxgyGet[]
*/
public function getGet(): array
{
return $this->fields['get'];
}

/**
* @param array[]|CouponRestrictionRetrictToBxgyGet[] $get
* @param array[]|CouponRestrictionRestrictToBxgyGet[] $get
*/
public function setGet(array $get): static
{
$get = array_map(
fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null,
fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null,
$get,
);

Expand All @@ -261,6 +264,29 @@ public function setCurrency(string $currency): static
return $this;
}

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

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

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

return $this;
}

public function getMinimumQuantity(): ?int
{
return $this->fields['minimumQuantity'] ?? null;
Expand Down Expand Up @@ -331,6 +357,9 @@ public function jsonSerialize(): array
if (array_key_exists('currency', $this->fields)) {
$data['currency'] = $this->fields['currency'];
}
if (array_key_exists('customerIds', $this->fields)) {
$data['customerIds'] = $this->fields['customerIds'];
}
if (array_key_exists('minimumQuantity', $this->fields)) {
$data['minimumQuantity'] = $this->fields['minimumQuantity'];
}
Expand Down
Loading

0 comments on commit 4ce432c

Please sign in to comment.