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 Oct 27, 2023
1 parent 64b4ba5 commit 26fd796
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 35 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-ties-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Make Plan.id readOnly Rebilly/api-definitions#1651
18 changes: 9 additions & 9 deletions src/Model/FlexiblePlan.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@ public function setLinks(null|array $links): static
return $this;
}

public function getRecurringInterval(): ?SubscriptionOrderPlanRecurringInterval
public function getRecurringInterval(): SubscriptionOrderPlanRecurringInterval
{
return $this->fields['recurringInterval'] ?? null;
return $this->fields['recurringInterval'];
}

public function setRecurringInterval(null|SubscriptionOrderPlanRecurringInterval|array $recurringInterval): static
public function setRecurringInterval(SubscriptionOrderPlanRecurringInterval|array $recurringInterval): static
{
if ($recurringInterval !== null && !($recurringInterval instanceof SubscriptionOrderPlanRecurringInterval)) {
if (!($recurringInterval instanceof SubscriptionOrderPlanRecurringInterval)) {
$recurringInterval = SubscriptionOrderPlanRecurringInterval::from($recurringInterval);
}

Expand All @@ -303,15 +303,15 @@ public function setRecurringInterval(null|SubscriptionOrderPlanRecurringInterval
return $this;
}

public function getTrial(): ?PlanTrial
public function getTrial(): TrialOnlyPlanTrial
{
return $this->fields['trial'] ?? null;
return $this->fields['trial'];
}

public function setTrial(null|PlanTrial|array $trial): static
public function setTrial(TrialOnlyPlanTrial|array $trial): static
{
if ($trial !== null && !($trial instanceof PlanTrial)) {
$trial = PlanTrial::from($trial);
if (!($trial instanceof TrialOnlyPlanTrial)) {
$trial = TrialOnlyPlanTrial::from($trial);
}

$this->fields['trial'] = $trial;
Expand Down
18 changes: 9 additions & 9 deletions src/Model/OrderItemPlan.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@ public function setLinks(null|array $links): static
return $this;
}

public function getRecurringInterval(): ?SubscriptionOrderPlanRecurringInterval
public function getRecurringInterval(): SubscriptionOrderPlanRecurringInterval
{
return $this->fields['recurringInterval'] ?? null;
return $this->fields['recurringInterval'];
}

public function setRecurringInterval(null|SubscriptionOrderPlanRecurringInterval|array $recurringInterval): static
public function setRecurringInterval(SubscriptionOrderPlanRecurringInterval|array $recurringInterval): static
{
if ($recurringInterval !== null && !($recurringInterval instanceof SubscriptionOrderPlanRecurringInterval)) {
if (!($recurringInterval instanceof SubscriptionOrderPlanRecurringInterval)) {
$recurringInterval = SubscriptionOrderPlanRecurringInterval::from($recurringInterval);
}

Expand All @@ -303,15 +303,15 @@ public function setRecurringInterval(null|SubscriptionOrderPlanRecurringInterval
return $this;
}

public function getTrial(): ?PlanTrial
public function getTrial(): TrialOnlyPlanTrial
{
return $this->fields['trial'] ?? null;
return $this->fields['trial'];
}

public function setTrial(null|PlanTrial|array $trial): static
public function setTrial(TrialOnlyPlanTrial|array $trial): static
{
if ($trial !== null && !($trial instanceof PlanTrial)) {
$trial = PlanTrial::from($trial);
if (!($trial instanceof TrialOnlyPlanTrial)) {
$trial = TrialOnlyPlanTrial::from($trial);
}

$this->fields['trial'] = $trial;
Expand Down
32 changes: 16 additions & 16 deletions src/Model/Plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ public function getId(): ?string
return $this->fields['id'] ?? null;
}

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

return $this;
}

public function getName(): string
{
return $this->fields['name'];
Expand Down Expand Up @@ -287,14 +280,14 @@ public function setLinks(null|array $links): static
return $this;
}

public function getRecurringInterval(): ?SubscriptionOrderPlanRecurringInterval
public function getRecurringInterval(): SubscriptionOrderPlanRecurringInterval
{
return $this->fields['recurringInterval'] ?? null;
return $this->fields['recurringInterval'];
}

public function setRecurringInterval(null|SubscriptionOrderPlanRecurringInterval|array $recurringInterval): static
public function setRecurringInterval(SubscriptionOrderPlanRecurringInterval|array $recurringInterval): static
{
if ($recurringInterval !== null && !($recurringInterval instanceof SubscriptionOrderPlanRecurringInterval)) {
if (!($recurringInterval instanceof SubscriptionOrderPlanRecurringInterval)) {
$recurringInterval = SubscriptionOrderPlanRecurringInterval::from($recurringInterval);
}

Expand All @@ -303,15 +296,15 @@ public function setRecurringInterval(null|SubscriptionOrderPlanRecurringInterval
return $this;
}

public function getTrial(): ?PlanTrial
public function getTrial(): TrialOnlyPlanTrial
{
return $this->fields['trial'] ?? null;
return $this->fields['trial'];
}

public function setTrial(null|PlanTrial|array $trial): static
public function setTrial(TrialOnlyPlanTrial|array $trial): static
{
if ($trial !== null && !($trial instanceof PlanTrial)) {
$trial = PlanTrial::from($trial);
if (!($trial instanceof TrialOnlyPlanTrial)) {
$trial = TrialOnlyPlanTrial::from($trial);
}

$this->fields['trial'] = $trial;
Expand Down Expand Up @@ -421,6 +414,13 @@ public function jsonSerialize(): array
return $data;
}

private function setId(null|string $id): static
{
$this->fields['id'] = $id;

return $this;
}

private function setCurrencySign(null|string $currencySign): static
{
$this->fields['currencySign'] = $currencySign;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use JsonSerializable;

class PlanTrial implements JsonSerializable
class TrialOnlyPlanTrial implements JsonSerializable
{
private array $fields = [];

Expand Down

0 comments on commit 26fd796

Please sign in to comment.