From 7de26414d7937dd1f6c6951b504a6ab5f8d2e260 Mon Sep 17 00:00:00 2001 From: SDK Distribution Bot Date: Thu, 18 Dec 2025 02:25:07 +0000 Subject: [PATCH] fix: Update SDK from generator (2025-12-18 02:25:03 UTC) --- README.md | 2 +- composer.lock | 2 +- lib/Model/BalanceListResponse.php | 12 +++ lib/Model/BalanceResponse.php | 32 +++++++ lib/Model/BalanceState.php | 21 ++--- lib/Model/BalanceURLResponse.php | 8 ++ lib/Model/BankInfoResponse.php | 24 +++++ lib/Model/CaptureMethod.php | 17 ++-- lib/Model/CheckoutSessionCreateRequest.php | 4 + lib/Model/CheckoutSessionDetailsResponse.php | 40 +++++++++ .../CheckoutSessionLineItemDataResponse.php | 32 +++++++ .../CheckoutSessionLineItemListResponse.php | 12 +++ lib/Model/CheckoutSessionListResponse.php | 12 +++ lib/Model/CheckoutSessionMode.php | 17 ++-- lib/Model/CheckoutSessionStatus.php | 21 ++--- lib/Model/CheckoutSessionSubmitType.php | 25 ++---- lib/Model/CheckoutSessionUIMode.php | 13 +-- lib/Model/Country.php | 13 +-- lib/Model/Currency.php | 13 +-- lib/Model/CustomerCreation.php | 17 ++-- lib/Model/CustomerListResponse.php | 12 +++ lib/Model/CustomerResponse.php | 20 +++++ lib/Model/DisplayPreferenceRequest.php | 4 + lib/Model/ErrorResponse.php | 12 +++ lib/Model/EventListResponse.php | 12 +++ lib/Model/EventResponse.php | 28 ++++++ lib/Model/LineItemRequest.php | 8 ++ lib/Model/Locale.php | 17 ++-- lib/Model/PaymentFlowCreateRequest.php | 8 ++ lib/Model/PaymentFlowListResponse.php | 12 +++ lib/Model/PaymentFlowResponse.php | 44 +++++++++ lib/Model/PaymentFlowStatus.php | 37 +++----- .../PaymentMethodApplePayCreateRequest.php | 8 ++ .../PaymentMethodApplePayUpdateRequest.php | 4 + lib/Model/PaymentMethodAttachRequest.php | 4 + .../PaymentMethodBillingDetailsResponse.php | 4 + lib/Model/PaymentMethodCardCreateRequest.php | 12 +++ .../PaymentMethodCardDetailsResponse.php | 20 +++++ lib/Model/PaymentMethodCardResponse.php | 32 +++++++ lib/Model/PaymentMethodCardUpdateRequest.php | 4 + ...mentMethodConfigurationDetailsResponse.php | 20 +++++ ...PaymentMethodConfigurationListResponse.php | 12 +++ .../PaymentMethodCreateCardDetailsRequest.php | 16 ++++ lib/Model/PaymentMethodCreateRequest.php | 16 ++++ lib/Model/PaymentMethodListResponse.php | 12 +++ .../PaymentMethodPayPayCreateRequest.php | 4 + lib/Model/PaymentMethodPayPayResponse.php | 28 ++++++ .../PaymentMethodPayPayUpdateRequest.php | 4 + lib/Model/PaymentMethodResponse.php | 40 +++++++++ lib/Model/PaymentMethodTypes.php | 21 ++--- lib/Model/PaymentMethodUpdateRequest.php | 4 + lib/Model/PaymentRefundCreateRequest.php | 4 + lib/Model/PaymentRefundListResponse.php | 12 +++ lib/Model/PaymentRefundReason.php | 21 ++--- lib/Model/PaymentRefundResponse.php | 32 +++++++ lib/Model/PaymentRefundStatus.php | 29 ++---- lib/Model/PaymentTransactionListResponse.php | 12 +++ lib/Model/PaymentTransactionResponse.php | 48 ++++++++++ lib/Model/PaymentTransactionType.php | 25 ++---- lib/Model/PriceCreateRequest.php | 12 +++ lib/Model/PriceDetailsResponse.php | 40 +++++++++ lib/Model/PriceListResponse.php | 12 +++ lib/Model/PriceType.php | 13 +-- lib/Model/ProductCreateRequest.php | 4 + lib/Model/ProductDeletedResponse.php | 8 ++ lib/Model/ProductDetailsResponse.php | 12 +++ lib/Model/ProductListResponse.php | 12 +++ lib/Model/SetupFlowCancellationReason.php | 21 ++--- lib/Model/SetupFlowListResponse.php | 12 +++ lib/Model/SetupFlowResponse.php | 32 +++++++ lib/Model/SetupFlowStatus.php | 33 ++----- lib/Model/StatementItemResponse.php | 8 ++ lib/Model/StatementListResponse.php | 12 +++ lib/Model/StatementResponse.php | 28 ++++++ lib/Model/StatementSubject.php | 77 +++++----------- lib/Model/StatementType.php | 29 ++---- lib/Model/StatementURLResponse.php | 8 ++ lib/Model/TaxRateCreateRequest.php | 12 +++ lib/Model/TaxRateDetailsResponse.php | 24 +++++ lib/Model/TaxRateListResponse.php | 12 +++ lib/Model/TermListResponse.php | 12 +++ lib/Model/TermResponse.php | 20 +++++ lib/Model/Usage.php | 17 ++-- lib/ObjectSerializer.php | 90 +++++++++++-------- 84 files changed, 1162 insertions(+), 397 deletions(-) diff --git a/README.md b/README.md index 743b285..c98d930 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ PHP 8.1 and later. ### Composer -To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: +To install the bindings via [Composer](https://getcomposer.org/): ```bash composer require payjp/payjpv2-php diff --git a/composer.lock b/composer.lock index ac106c3..17fe7f4 100644 --- a/composer.lock +++ b/composer.lock @@ -4947,5 +4947,5 @@ "platform-overrides": { "php": "8.1" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/lib/Model/BalanceListResponse.php b/lib/Model/BalanceListResponse.php index 13af74d..8eb19b6 100644 --- a/lib/Model/BalanceListResponse.php +++ b/lib/Model/BalanceListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/BalanceResponse.php b/lib/Model/BalanceResponse.php index 216a0e1..e0f81bd 100644 --- a/lib/Model/BalanceResponse.php +++ b/lib/Model/BalanceResponse.php @@ -467,6 +467,10 @@ public function setObject(?string $object): self */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -494,6 +498,10 @@ public function setId(string $id): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -521,6 +529,10 @@ public function setLivemode(bool $livemode): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -548,6 +560,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } @@ -575,6 +591,10 @@ public function setUpdatedAt(\DateTime $updatedAt): self */ public function getState(): \PAYJPV2\Model\BalanceState { + if ($this->container['state'] === null) { + throw new \LogicException('Property "state" is required but has not been set.'); + } + return $this->container['state']; } @@ -602,6 +622,10 @@ public function setState(\PAYJPV2\Model\BalanceState $state): self */ public function getStatements(): array { + if ($this->container['statements'] === null) { + throw new \LogicException('Property "statements" is required but has not been set.'); + } + return $this->container['statements']; } @@ -629,6 +653,10 @@ public function setStatements(array $statements): self */ public function getClosed(): bool { + if ($this->container['closed'] === null) { + throw new \LogicException('Property "closed" is required but has not been set.'); + } + return $this->container['closed']; } @@ -724,6 +752,10 @@ public function setDueDate(?\DateTime $dueDate): self */ public function getNet(): int { + if ($this->container['net'] === null) { + throw new \LogicException('Property "net" is required but has not been set.'); + } + return $this->container['net']; } diff --git a/lib/Model/BalanceState.php b/lib/Model/BalanceState.php index cc6f89a..a04211c 100644 --- a/lib/Model/BalanceState.php +++ b/lib/Model/BalanceState.php @@ -38,27 +38,18 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class BalanceState +enum BalanceState: string { - /** - * Possible values of this enum - */ - public const COLLECTING = 'collecting'; - - public const TRANSFER = 'transfer'; - - public const CLAIM = 'claim'; + case COLLECTING = 'collecting'; + case TRANSFER = 'transfer'; + case CLAIM = 'claim'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::COLLECTING, - self::TRANSFER, - self::CLAIM, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/BalanceURLResponse.php b/lib/Model/BalanceURLResponse.php index 718e6b3..feff007 100644 --- a/lib/Model/BalanceURLResponse.php +++ b/lib/Model/BalanceURLResponse.php @@ -377,6 +377,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -404,6 +408,10 @@ public function setUrl(string $url): self */ public function getExpires(): \DateTime { + if ($this->container['expires'] === null) { + throw new \LogicException('Property "expires" is required but has not been set.'); + } + return $this->container['expires']; } diff --git a/lib/Model/BankInfoResponse.php b/lib/Model/BankInfoResponse.php index 921cab4..63b6857 100644 --- a/lib/Model/BankInfoResponse.php +++ b/lib/Model/BankInfoResponse.php @@ -351,6 +351,10 @@ public function valid() */ public function getBankCode(): string { + if ($this->container['bankCode'] === null) { + throw new \LogicException('Property "bankCode" is required but has not been set.'); + } + return $this->container['bankCode']; } @@ -378,6 +382,10 @@ public function setBankCode(string $bankCode): self */ public function getBankBranchCode(): string { + if ($this->container['bankBranchCode'] === null) { + throw new \LogicException('Property "bankBranchCode" is required but has not been set.'); + } + return $this->container['bankBranchCode']; } @@ -405,6 +413,10 @@ public function setBankBranchCode(string $bankBranchCode): self */ public function getBankAccountType(): string { + if ($this->container['bankAccountType'] === null) { + throw new \LogicException('Property "bankAccountType" is required but has not been set.'); + } + return $this->container['bankAccountType']; } @@ -432,6 +444,10 @@ public function setBankAccountType(string $bankAccountType): self */ public function getBankAccountNumber(): string { + if ($this->container['bankAccountNumber'] === null) { + throw new \LogicException('Property "bankAccountNumber" is required but has not been set.'); + } + return $this->container['bankAccountNumber']; } @@ -459,6 +475,10 @@ public function setBankAccountNumber(string $bankAccountNumber): self */ public function getBankAccountHolderName(): string { + if ($this->container['bankAccountHolderName'] === null) { + throw new \LogicException('Property "bankAccountHolderName" is required but has not been set.'); + } + return $this->container['bankAccountHolderName']; } @@ -486,6 +506,10 @@ public function setBankAccountHolderName(string $bankAccountHolderName): self */ public function getBankAccountStatus(): string { + if ($this->container['bankAccountStatus'] === null) { + throw new \LogicException('Property "bankAccountStatus" is required but has not been set.'); + } + return $this->container['bankAccountStatus']; } diff --git a/lib/Model/CaptureMethod.php b/lib/Model/CaptureMethod.php index 028d59a..752173a 100644 --- a/lib/Model/CaptureMethod.php +++ b/lib/Model/CaptureMethod.php @@ -37,24 +37,17 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CaptureMethod +enum CaptureMethod: string { - /** - * Possible values of this enum - */ - public const AUTOMATIC = 'automatic'; - - public const MANUAL = 'manual'; + case AUTOMATIC = 'automatic'; + case MANUAL = 'manual'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::AUTOMATIC, - self::MANUAL, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/CheckoutSessionCreateRequest.php b/lib/Model/CheckoutSessionCreateRequest.php index 49de775..6484b2d 100644 --- a/lib/Model/CheckoutSessionCreateRequest.php +++ b/lib/Model/CheckoutSessionCreateRequest.php @@ -563,6 +563,10 @@ public function setLineItems(?array $lineItems): self */ public function getMode(): \PAYJPV2\Model\CheckoutSessionMode { + if ($this->container['mode'] === null) { + throw new \LogicException('Property "mode" is required but has not been set.'); + } + return $this->container['mode']; } diff --git a/lib/Model/CheckoutSessionDetailsResponse.php b/lib/Model/CheckoutSessionDetailsResponse.php index f78d0d0..4cdbe5c 100644 --- a/lib/Model/CheckoutSessionDetailsResponse.php +++ b/lib/Model/CheckoutSessionDetailsResponse.php @@ -544,6 +544,10 @@ public function valid() */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -608,6 +612,10 @@ public function setObject(?string $object): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -839,6 +847,10 @@ public function setExpiresAt(?\DateTime $expiresAt): self */ public function getCurrency(): \PAYJPV2\Model\Currency { + if ($this->container['currency'] === null) { + throw new \LogicException('Property "currency" is required but has not been set.'); + } + return $this->container['currency']; } @@ -1070,6 +1082,10 @@ public function setSubmitType(?\PAYJPV2\Model\CheckoutSessionSubmitType $submitT */ public function getMode(): \PAYJPV2\Model\CheckoutSessionMode { + if ($this->container['mode'] === null) { + throw new \LogicException('Property "mode" is required but has not been set.'); + } + return $this->container['mode']; } @@ -1097,6 +1113,10 @@ public function setMode(\PAYJPV2\Model\CheckoutSessionMode $mode): self */ public function getUiMode(): \PAYJPV2\Model\CheckoutSessionUIMode { + if ($this->container['uiMode'] === null) { + throw new \LogicException('Property "uiMode" is required but has not been set.'); + } + return $this->container['uiMode']; } @@ -1124,6 +1144,10 @@ public function setUiMode(\PAYJPV2\Model\CheckoutSessionUIMode $uiMode): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -1151,6 +1175,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } @@ -1178,6 +1206,10 @@ public function setUpdatedAt(\DateTime $updatedAt): self */ public function getMetadata(): array { + if ($this->container['metadata'] === null) { + throw new \LogicException('Property "metadata" is required but has not been set.'); + } + return $this->container['metadata']; } @@ -1205,6 +1237,10 @@ public function setMetadata(array $metadata): self */ public function getStatus(): \PAYJPV2\Model\CheckoutSessionStatus { + if ($this->container['status'] === null) { + throw new \LogicException('Property "status" is required but has not been set.'); + } + return $this->container['status']; } @@ -1266,6 +1302,10 @@ public function setSuccessUrl(?string $successUrl): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } diff --git a/lib/Model/CheckoutSessionLineItemDataResponse.php b/lib/Model/CheckoutSessionLineItemDataResponse.php index e12afee..1777665 100644 --- a/lib/Model/CheckoutSessionLineItemDataResponse.php +++ b/lib/Model/CheckoutSessionLineItemDataResponse.php @@ -437,6 +437,10 @@ public function setObject(?string $object): self */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -464,6 +468,10 @@ public function setId(string $id): self */ public function getAmountSubtotal(): int { + if ($this->container['amountSubtotal'] === null) { + throw new \LogicException('Property "amountSubtotal" is required but has not been set.'); + } + return $this->container['amountSubtotal']; } @@ -491,6 +499,10 @@ public function setAmountSubtotal(int $amountSubtotal): self */ public function getAmountTax(): int { + if ($this->container['amountTax'] === null) { + throw new \LogicException('Property "amountTax" is required but has not been set.'); + } + return $this->container['amountTax']; } @@ -518,6 +530,10 @@ public function setAmountTax(int $amountTax): self */ public function getAmountTotal(): int { + if ($this->container['amountTotal'] === null) { + throw new \LogicException('Property "amountTotal" is required but has not been set.'); + } + return $this->container['amountTotal']; } @@ -545,6 +561,10 @@ public function setAmountTotal(int $amountTotal): self */ public function getCurrency(): \PAYJPV2\Model\Currency { + if ($this->container['currency'] === null) { + throw new \LogicException('Property "currency" is required but has not been set.'); + } + return $this->container['currency']; } @@ -572,6 +592,10 @@ public function setCurrency(\PAYJPV2\Model\Currency $currency): self */ public function getDescription(): string { + if ($this->container['description'] === null) { + throw new \LogicException('Property "description" is required but has not been set.'); + } + return $this->container['description']; } @@ -599,6 +623,10 @@ public function setDescription(string $description): self */ public function getPrice(): \PAYJPV2\Model\PriceDetailsResponse { + if ($this->container['price'] === null) { + throw new \LogicException('Property "price" is required but has not been set.'); + } + return $this->container['price']; } @@ -626,6 +654,10 @@ public function setPrice(\PAYJPV2\Model\PriceDetailsResponse $price): self */ public function getQuantity(): int { + if ($this->container['quantity'] === null) { + throw new \LogicException('Property "quantity" is required but has not been set.'); + } + return $this->container['quantity']; } diff --git a/lib/Model/CheckoutSessionLineItemListResponse.php b/lib/Model/CheckoutSessionLineItemListResponse.php index 9a1388f..a4cbd46 100644 --- a/lib/Model/CheckoutSessionLineItemListResponse.php +++ b/lib/Model/CheckoutSessionLineItemListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/CheckoutSessionListResponse.php b/lib/Model/CheckoutSessionListResponse.php index eb51254..9200484 100644 --- a/lib/Model/CheckoutSessionListResponse.php +++ b/lib/Model/CheckoutSessionListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/CheckoutSessionMode.php b/lib/Model/CheckoutSessionMode.php index c780d9f..1d76ddd 100644 --- a/lib/Model/CheckoutSessionMode.php +++ b/lib/Model/CheckoutSessionMode.php @@ -37,24 +37,17 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CheckoutSessionMode +enum CheckoutSessionMode: string { - /** - * Possible values of this enum - */ - public const PAYMENT = 'payment'; - - public const SETUP = 'setup'; + case PAYMENT = 'payment'; + case SETUP = 'setup'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::PAYMENT, - self::SETUP, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/CheckoutSessionStatus.php b/lib/Model/CheckoutSessionStatus.php index 54d1cfa..dc1af67 100644 --- a/lib/Model/CheckoutSessionStatus.php +++ b/lib/Model/CheckoutSessionStatus.php @@ -37,27 +37,18 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CheckoutSessionStatus +enum CheckoutSessionStatus: string { - /** - * Possible values of this enum - */ - public const OPEN = 'open'; - - public const COMPLETE = 'complete'; - - public const EXPIRED = 'expired'; + case OPEN = 'open'; + case COMPLETE = 'complete'; + case EXPIRED = 'expired'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::OPEN, - self::COMPLETE, - self::EXPIRED, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/CheckoutSessionSubmitType.php b/lib/Model/CheckoutSessionSubmitType.php index c470778..59e99a7 100644 --- a/lib/Model/CheckoutSessionSubmitType.php +++ b/lib/Model/CheckoutSessionSubmitType.php @@ -37,30 +37,19 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CheckoutSessionSubmitType +enum CheckoutSessionSubmitType: string { - /** - * Possible values of this enum - */ - public const AUTO = 'auto'; - - public const BOOK = 'book'; - - public const DONATE = 'donate'; - - public const PAY = 'pay'; + case AUTO = 'auto'; + case BOOK = 'book'; + case DONATE = 'donate'; + case PAY = 'pay'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::AUTO, - self::BOOK, - self::DONATE, - self::PAY, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/CheckoutSessionUIMode.php b/lib/Model/CheckoutSessionUIMode.php index 6cb7c86..e801bff 100644 --- a/lib/Model/CheckoutSessionUIMode.php +++ b/lib/Model/CheckoutSessionUIMode.php @@ -37,21 +37,16 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CheckoutSessionUIMode +enum CheckoutSessionUIMode: string { - /** - * Possible values of this enum - */ - public const HOSTED = 'hosted'; + case HOSTED = 'hosted'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::HOSTED, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/Country.php b/lib/Model/Country.php index db06f50..92b03ed 100644 --- a/lib/Model/Country.php +++ b/lib/Model/Country.php @@ -37,21 +37,16 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class Country +enum Country: string { - /** - * Possible values of this enum - */ - public const JP = 'JP'; + case JP = 'JP'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::JP, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/Currency.php b/lib/Model/Currency.php index c4d74a7..3594013 100644 --- a/lib/Model/Currency.php +++ b/lib/Model/Currency.php @@ -37,21 +37,16 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class Currency +enum Currency: string { - /** - * Possible values of this enum - */ - public const JPY = 'jpy'; + case JPY = 'jpy'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::JPY, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/CustomerCreation.php b/lib/Model/CustomerCreation.php index d0f1784..af7ba8f 100644 --- a/lib/Model/CustomerCreation.php +++ b/lib/Model/CustomerCreation.php @@ -37,24 +37,17 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CustomerCreation +enum CustomerCreation: string { - /** - * Possible values of this enum - */ - public const ALWAYS = 'always'; - - public const IF_REQUIRED = 'if_required'; + case ALWAYS = 'always'; + case IF_REQUIRED = 'if_required'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::ALWAYS, - self::IF_REQUIRED, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/CustomerListResponse.php b/lib/Model/CustomerListResponse.php index 22e515d..6626820 100644 --- a/lib/Model/CustomerListResponse.php +++ b/lib/Model/CustomerListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/CustomerResponse.php b/lib/Model/CustomerResponse.php index 09f4d1c..efe2322 100644 --- a/lib/Model/CustomerResponse.php +++ b/lib/Model/CustomerResponse.php @@ -400,6 +400,10 @@ public function valid() */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -464,6 +468,10 @@ public function setObject(?string $object): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -593,6 +601,10 @@ public function setDefaultPaymentMethodId(?string $defaultPaymentMethodId): self */ public function getMetadata(): array { + if ($this->container['metadata'] === null) { + throw new \LogicException('Property "metadata" is required but has not been set.'); + } + return $this->container['metadata']; } @@ -620,6 +632,10 @@ public function setMetadata(array $metadata): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -647,6 +663,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } diff --git a/lib/Model/DisplayPreferenceRequest.php b/lib/Model/DisplayPreferenceRequest.php index f956f74..54b2bb3 100644 --- a/lib/Model/DisplayPreferenceRequest.php +++ b/lib/Model/DisplayPreferenceRequest.php @@ -326,6 +326,10 @@ public function valid() */ public function getPreference(): string { + if ($this->container['preference'] === null) { + throw new \LogicException('Property "preference" is required but has not been set.'); + } + return $this->container['preference']; } diff --git a/lib/Model/ErrorResponse.php b/lib/Model/ErrorResponse.php index 969a2b5..c913a38 100644 --- a/lib/Model/ErrorResponse.php +++ b/lib/Model/ErrorResponse.php @@ -342,6 +342,10 @@ public function valid() */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } @@ -369,6 +373,10 @@ public function setType(string $type): self */ public function getTitle(): string { + if ($this->container['title'] === null) { + throw new \LogicException('Property "title" is required but has not been set.'); + } + return $this->container['title']; } @@ -396,6 +404,10 @@ public function setTitle(string $title): self */ public function getStatus(): int { + if ($this->container['status'] === null) { + throw new \LogicException('Property "status" is required but has not been set.'); + } + return $this->container['status']; } diff --git a/lib/Model/EventListResponse.php b/lib/Model/EventListResponse.php index e2e5004..876b4bf 100644 --- a/lib/Model/EventListResponse.php +++ b/lib/Model/EventListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/EventResponse.php b/lib/Model/EventResponse.php index 8acc2c7..077b26e 100644 --- a/lib/Model/EventResponse.php +++ b/lib/Model/EventResponse.php @@ -390,6 +390,10 @@ public function valid() */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -454,6 +458,10 @@ public function setObject(?string $object): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -481,6 +489,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } @@ -508,6 +520,10 @@ public function setUpdatedAt(\DateTime $updatedAt): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -535,6 +551,10 @@ public function setLivemode(bool $livemode): self */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } @@ -562,6 +582,10 @@ public function setType(string $type): self */ public function getPendingWebhooks(): int { + if ($this->container['pendingWebhooks'] === null) { + throw new \LogicException('Property "pendingWebhooks" is required but has not been set.'); + } + return $this->container['pendingWebhooks']; } @@ -589,6 +613,10 @@ public function setPendingWebhooks(int $pendingWebhooks): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/LineItemRequest.php b/lib/Model/LineItemRequest.php index b9795f3..3acca5c 100644 --- a/lib/Model/LineItemRequest.php +++ b/lib/Model/LineItemRequest.php @@ -318,6 +318,10 @@ public function valid() */ public function getPriceId(): string { + if ($this->container['priceId'] === null) { + throw new \LogicException('Property "priceId" is required but has not been set.'); + } + return $this->container['priceId']; } @@ -345,6 +349,10 @@ public function setPriceId(string $priceId): self */ public function getQuantity(): int { + if ($this->container['quantity'] === null) { + throw new \LogicException('Property "quantity" is required but has not been set.'); + } + return $this->container['quantity']; } diff --git a/lib/Model/Locale.php b/lib/Model/Locale.php index e31e5c1..1bff841 100644 --- a/lib/Model/Locale.php +++ b/lib/Model/Locale.php @@ -38,24 +38,17 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class Locale +enum Locale: string { - /** - * Possible values of this enum - */ - public const AUTO = 'auto'; - - public const JA = 'ja'; + case AUTO = 'auto'; + case JA = 'ja'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::AUTO, - self::JA, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/PaymentFlowCreateRequest.php b/lib/Model/PaymentFlowCreateRequest.php index fb74ccb..4b02173 100644 --- a/lib/Model/PaymentFlowCreateRequest.php +++ b/lib/Model/PaymentFlowCreateRequest.php @@ -382,6 +382,10 @@ public function valid() */ public function getAmount(): int { + if ($this->container['amount'] === null) { + throw new \LogicException('Property "amount" is required but has not been set.'); + } + return $this->container['amount']; } @@ -525,6 +529,10 @@ public function setPaymentMethodTypes(?array $paymentMethodTypes): self */ public function getCurrency(): \PAYJPV2\Model\Currency { + if ($this->container['currency'] === null) { + throw new \LogicException('Property "currency" is required but has not been set.'); + } + return $this->container['currency']; } diff --git a/lib/Model/PaymentFlowListResponse.php b/lib/Model/PaymentFlowListResponse.php index 6693dbd..249234e 100644 --- a/lib/Model/PaymentFlowListResponse.php +++ b/lib/Model/PaymentFlowListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/PaymentFlowResponse.php b/lib/Model/PaymentFlowResponse.php index d9d9a20..823096f 100644 --- a/lib/Model/PaymentFlowResponse.php +++ b/lib/Model/PaymentFlowResponse.php @@ -520,6 +520,10 @@ public function valid() */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -584,6 +588,10 @@ public function setObject(?string $object): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -611,6 +619,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } @@ -638,6 +650,10 @@ public function setUpdatedAt(\DateTime $updatedAt): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -665,6 +681,10 @@ public function setLivemode(bool $livemode): self */ public function getAmount(): int { + if ($this->container['amount'] === null) { + throw new \LogicException('Property "amount" is required but has not been set.'); + } + return $this->container['amount']; } @@ -692,6 +712,10 @@ public function setAmount(int $amount): self */ public function getCurrency(): \PAYJPV2\Model\Currency { + if ($this->container['currency'] === null) { + throw new \LogicException('Property "currency" is required but has not been set.'); + } + return $this->container['currency']; } @@ -787,6 +811,10 @@ public function setAmountReceived(?int $amountReceived): self */ public function getClientSecret(): string { + if ($this->container['clientSecret'] === null) { + throw new \LogicException('Property "clientSecret" is required but has not been set.'); + } + return $this->container['clientSecret']; } @@ -882,6 +910,10 @@ public function setDescription(?string $description): self */ public function getMetadata(): array { + if ($this->container['metadata'] === null) { + throw new \LogicException('Property "metadata" is required but has not been set.'); + } + return $this->container['metadata']; } @@ -977,6 +1009,10 @@ public function setPaymentMethodOptions(?array $paymentMethodOptions): self */ public function getPaymentMethodTypes(): array { + if ($this->container['paymentMethodTypes'] === null) { + throw new \LogicException('Property "paymentMethodTypes" is required but has not been set.'); + } + return $this->container['paymentMethodTypes']; } @@ -1004,6 +1040,10 @@ public function setPaymentMethodTypes(array $paymentMethodTypes): self */ public function getStatus(): \PAYJPV2\Model\PaymentFlowStatus { + if ($this->container['status'] === null) { + throw new \LogicException('Property "status" is required but has not been set.'); + } + return $this->container['status']; } @@ -1099,6 +1139,10 @@ public function setReturnUrl(?string $returnUrl): self */ public function getCaptureMethod(): \PAYJPV2\Model\CaptureMethod { + if ($this->container['captureMethod'] === null) { + throw new \LogicException('Property "captureMethod" is required but has not been set.'); + } + return $this->container['captureMethod']; } diff --git a/lib/Model/PaymentFlowStatus.php b/lib/Model/PaymentFlowStatus.php index 2152f27..d12bc53 100644 --- a/lib/Model/PaymentFlowStatus.php +++ b/lib/Model/PaymentFlowStatus.php @@ -37,39 +37,22 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class PaymentFlowStatus +enum PaymentFlowStatus: string { - /** - * Possible values of this enum - */ - public const CANCELED = 'canceled'; - - public const PROCESSING = 'processing'; - - public const REQUIRES_ACTION = 'requires_action'; - - public const REQUIRES_CAPTURE = 'requires_capture'; - - public const REQUIRES_CONFIRMATION = 'requires_confirmation'; - - public const REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; - - public const SUCCEEDED = 'succeeded'; + case CANCELED = 'canceled'; + case PROCESSING = 'processing'; + case REQUIRES_ACTION = 'requires_action'; + case REQUIRES_CAPTURE = 'requires_capture'; + case REQUIRES_CONFIRMATION = 'requires_confirmation'; + case REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; + case SUCCEEDED = 'succeeded'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::CANCELED, - self::PROCESSING, - self::REQUIRES_ACTION, - self::REQUIRES_CAPTURE, - self::REQUIRES_CONFIRMATION, - self::REQUIRES_PAYMENT_METHOD, - self::SUCCEEDED, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/PaymentMethodApplePayCreateRequest.php b/lib/Model/PaymentMethodApplePayCreateRequest.php index ab79a34..01c0845 100644 --- a/lib/Model/PaymentMethodApplePayCreateRequest.php +++ b/lib/Model/PaymentMethodApplePayCreateRequest.php @@ -435,6 +435,10 @@ public function setMetadata(?array $metadata): self */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } @@ -472,6 +476,10 @@ public function setType(string $type): self */ public function getToken(): string { + if ($this->container['token'] === null) { + throw new \LogicException('Property "token" is required but has not been set.'); + } + return $this->container['token']; } diff --git a/lib/Model/PaymentMethodApplePayUpdateRequest.php b/lib/Model/PaymentMethodApplePayUpdateRequest.php index 69af21e..8d39ba7 100644 --- a/lib/Model/PaymentMethodApplePayUpdateRequest.php +++ b/lib/Model/PaymentMethodApplePayUpdateRequest.php @@ -390,6 +390,10 @@ public function setMetadata(?array $metadata): self */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } diff --git a/lib/Model/PaymentMethodAttachRequest.php b/lib/Model/PaymentMethodAttachRequest.php index 4a76132..47a63e3 100644 --- a/lib/Model/PaymentMethodAttachRequest.php +++ b/lib/Model/PaymentMethodAttachRequest.php @@ -301,6 +301,10 @@ public function valid() */ public function getCustomerId(): string { + if ($this->container['customerId'] === null) { + throw new \LogicException('Property "customerId" is required but has not been set.'); + } + return $this->container['customerId']; } diff --git a/lib/Model/PaymentMethodBillingDetailsResponse.php b/lib/Model/PaymentMethodBillingDetailsResponse.php index 98cadb0..5db042b 100644 --- a/lib/Model/PaymentMethodBillingDetailsResponse.php +++ b/lib/Model/PaymentMethodBillingDetailsResponse.php @@ -433,6 +433,10 @@ public function setEmail(?string $email): self */ public function getAddress(): \PAYJPV2\Model\PaymentMethodBillingAddressResponse { + if ($this->container['address'] === null) { + throw new \LogicException('Property "address" is required but has not been set.'); + } + return $this->container['address']; } diff --git a/lib/Model/PaymentMethodCardCreateRequest.php b/lib/Model/PaymentMethodCardCreateRequest.php index b40d2f6..ef462ff 100644 --- a/lib/Model/PaymentMethodCardCreateRequest.php +++ b/lib/Model/PaymentMethodCardCreateRequest.php @@ -384,6 +384,10 @@ public function setCustomerId(?string $customerId): self */ public function getBillingDetails(): \PAYJPV2\Model\PaymentMethodCardBillingDetailsRequest { + if ($this->container['billingDetails'] === null) { + throw new \LogicException('Property "billingDetails" is required but has not been set.'); + } + return $this->container['billingDetails']; } @@ -438,6 +442,10 @@ public function setMetadata(?array $metadata): self */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } @@ -475,6 +483,10 @@ public function setType(string $type): self */ public function getCard(): \PAYJPV2\Model\PaymentMethodCreateCardDetailsRequest { + if ($this->container['card'] === null) { + throw new \LogicException('Property "card" is required but has not been set.'); + } + return $this->container['card']; } diff --git a/lib/Model/PaymentMethodCardDetailsResponse.php b/lib/Model/PaymentMethodCardDetailsResponse.php index c90ce83..8d2c3dc 100644 --- a/lib/Model/PaymentMethodCardDetailsResponse.php +++ b/lib/Model/PaymentMethodCardDetailsResponse.php @@ -351,6 +351,10 @@ public function valid() */ public function getLast4(): string { + if ($this->container['last4'] === null) { + throw new \LogicException('Property "last4" is required but has not been set.'); + } + return $this->container['last4']; } @@ -378,6 +382,10 @@ public function setLast4(string $last4): self */ public function getBrand(): string { + if ($this->container['brand'] === null) { + throw new \LogicException('Property "brand" is required but has not been set.'); + } + return $this->container['brand']; } @@ -405,6 +413,10 @@ public function setBrand(string $brand): self */ public function getExpMonth(): int { + if ($this->container['expMonth'] === null) { + throw new \LogicException('Property "expMonth" is required but has not been set.'); + } + return $this->container['expMonth']; } @@ -432,6 +444,10 @@ public function setExpMonth(int $expMonth): self */ public function getExpYear(): int { + if ($this->container['expYear'] === null) { + throw new \LogicException('Property "expYear" is required but has not been set.'); + } + return $this->container['expYear']; } @@ -459,6 +475,10 @@ public function setExpYear(int $expYear): self */ public function getFingerprint(): string { + if ($this->container['fingerprint'] === null) { + throw new \LogicException('Property "fingerprint" is required but has not been set.'); + } + return $this->container['fingerprint']; } diff --git a/lib/Model/PaymentMethodCardResponse.php b/lib/Model/PaymentMethodCardResponse.php index 8df23de..48a6c56 100644 --- a/lib/Model/PaymentMethodCardResponse.php +++ b/lib/Model/PaymentMethodCardResponse.php @@ -481,6 +481,10 @@ public function setObject(?string $object): self */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -508,6 +512,10 @@ public function setId(string $id): self */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } @@ -613,6 +621,10 @@ public function setDetachedAt(?\DateTime $detachedAt): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -640,6 +652,10 @@ public function setLivemode(bool $livemode): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -667,6 +683,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } @@ -694,6 +714,10 @@ public function setUpdatedAt(\DateTime $updatedAt): self */ public function getMetadata(): array { + if ($this->container['metadata'] === null) { + throw new \LogicException('Property "metadata" is required but has not been set.'); + } + return $this->container['metadata']; } @@ -721,6 +745,10 @@ public function setMetadata(array $metadata): self */ public function getBillingDetails(): \PAYJPV2\Model\PaymentMethodBillingDetailsResponse { + if ($this->container['billingDetails'] === null) { + throw new \LogicException('Property "billingDetails" is required but has not been set.'); + } + return $this->container['billingDetails']; } @@ -748,6 +776,10 @@ public function setBillingDetails(\PAYJPV2\Model\PaymentMethodBillingDetailsResp */ public function getCard(): \PAYJPV2\Model\PaymentMethodCardDetailsResponse { + if ($this->container['card'] === null) { + throw new \LogicException('Property "card" is required but has not been set.'); + } + return $this->container['card']; } diff --git a/lib/Model/PaymentMethodCardUpdateRequest.php b/lib/Model/PaymentMethodCardUpdateRequest.php index 7faf32d..c692c07 100644 --- a/lib/Model/PaymentMethodCardUpdateRequest.php +++ b/lib/Model/PaymentMethodCardUpdateRequest.php @@ -390,6 +390,10 @@ public function setMetadata(?array $metadata): self */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } diff --git a/lib/Model/PaymentMethodConfigurationDetailsResponse.php b/lib/Model/PaymentMethodConfigurationDetailsResponse.php index b5b9d3d..c831e9f 100644 --- a/lib/Model/PaymentMethodConfigurationDetailsResponse.php +++ b/lib/Model/PaymentMethodConfigurationDetailsResponse.php @@ -380,6 +380,10 @@ public function valid() */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -444,6 +448,10 @@ public function setObject(?string $object): self */ public function getActive(): bool { + if ($this->container['active'] === null) { + throw new \LogicException('Property "active" is required but has not been set.'); + } + return $this->container['active']; } @@ -471,6 +479,10 @@ public function setActive(bool $active): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -532,6 +544,10 @@ public function setName(?string $name): self */ public function getPaypay(): \PAYJPV2\Model\PaymentMethodConfigurationSettingResponse { + if ($this->container['paypay'] === null) { + throw new \LogicException('Property "paypay" is required but has not been set.'); + } + return $this->container['paypay']; } @@ -559,6 +575,10 @@ public function setPaypay(\PAYJPV2\Model\PaymentMethodConfigurationSettingRespon */ public function getCard(): \PAYJPV2\Model\PaymentMethodConfigurationSettingResponse { + if ($this->container['card'] === null) { + throw new \LogicException('Property "card" is required but has not been set.'); + } + return $this->container['card']; } diff --git a/lib/Model/PaymentMethodConfigurationListResponse.php b/lib/Model/PaymentMethodConfigurationListResponse.php index bcf9990..b17bafd 100644 --- a/lib/Model/PaymentMethodConfigurationListResponse.php +++ b/lib/Model/PaymentMethodConfigurationListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/PaymentMethodCreateCardDetailsRequest.php b/lib/Model/PaymentMethodCreateCardDetailsRequest.php index 928d79d..99fcf74 100644 --- a/lib/Model/PaymentMethodCreateCardDetailsRequest.php +++ b/lib/Model/PaymentMethodCreateCardDetailsRequest.php @@ -354,6 +354,10 @@ public function valid() */ public function getNumber(): string { + if ($this->container['number'] === null) { + throw new \LogicException('Property "number" is required but has not been set.'); + } + return $this->container['number']; } @@ -386,6 +390,10 @@ public function setNumber(string $number): self */ public function getExpMonth(): int { + if ($this->container['expMonth'] === null) { + throw new \LogicException('Property "expMonth" is required but has not been set.'); + } + return $this->container['expMonth']; } @@ -421,6 +429,10 @@ public function setExpMonth(int $expMonth): self */ public function getExpYear(): int { + if ($this->container['expYear'] === null) { + throw new \LogicException('Property "expYear" is required but has not been set.'); + } + return $this->container['expYear']; } @@ -456,6 +468,10 @@ public function setExpYear(int $expYear): self */ public function getCvc(): string { + if ($this->container['cvc'] === null) { + throw new \LogicException('Property "cvc" is required but has not been set.'); + } + return $this->container['cvc']; } diff --git a/lib/Model/PaymentMethodCreateRequest.php b/lib/Model/PaymentMethodCreateRequest.php index 7c61d50..83b82dc 100644 --- a/lib/Model/PaymentMethodCreateRequest.php +++ b/lib/Model/PaymentMethodCreateRequest.php @@ -401,6 +401,10 @@ public function setCustomerId(?string $customerId): self */ public function getBillingDetails(): \PAYJPV2\Model\PaymentMethodBillingDetailsRequest { + if ($this->container['billingDetails'] === null) { + throw new \LogicException('Property "billingDetails" is required but has not been set.'); + } + return $this->container['billingDetails']; } @@ -455,6 +459,10 @@ public function setMetadata(?array $metadata): self */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } @@ -492,6 +500,10 @@ public function setType(string $type): self */ public function getCard(): \PAYJPV2\Model\PaymentMethodCreateCardDetailsRequest { + if ($this->container['card'] === null) { + throw new \LogicException('Property "card" is required but has not been set.'); + } + return $this->container['card']; } @@ -519,6 +531,10 @@ public function setCard(\PAYJPV2\Model\PaymentMethodCreateCardDetailsRequest $ca */ public function getToken(): string { + if ($this->container['token'] === null) { + throw new \LogicException('Property "token" is required but has not been set.'); + } + return $this->container['token']; } diff --git a/lib/Model/PaymentMethodListResponse.php b/lib/Model/PaymentMethodListResponse.php index dd97ebe..39597bf 100644 --- a/lib/Model/PaymentMethodListResponse.php +++ b/lib/Model/PaymentMethodListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/PaymentMethodPayPayCreateRequest.php b/lib/Model/PaymentMethodPayPayCreateRequest.php index edf7583..79ba63f 100644 --- a/lib/Model/PaymentMethodPayPayCreateRequest.php +++ b/lib/Model/PaymentMethodPayPayCreateRequest.php @@ -424,6 +424,10 @@ public function setMetadata(?array $metadata): self */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } diff --git a/lib/Model/PaymentMethodPayPayResponse.php b/lib/Model/PaymentMethodPayPayResponse.php index 3b02620..93907dd 100644 --- a/lib/Model/PaymentMethodPayPayResponse.php +++ b/lib/Model/PaymentMethodPayPayResponse.php @@ -469,6 +469,10 @@ public function setObject(?string $object): self */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -496,6 +500,10 @@ public function setId(string $id): self */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } @@ -601,6 +609,10 @@ public function setDetachedAt(?\DateTime $detachedAt): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -628,6 +640,10 @@ public function setLivemode(bool $livemode): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -655,6 +671,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } @@ -682,6 +702,10 @@ public function setUpdatedAt(\DateTime $updatedAt): self */ public function getMetadata(): array { + if ($this->container['metadata'] === null) { + throw new \LogicException('Property "metadata" is required but has not been set.'); + } + return $this->container['metadata']; } @@ -709,6 +733,10 @@ public function setMetadata(array $metadata): self */ public function getBillingDetails(): \PAYJPV2\Model\PaymentMethodBillingDetailsResponse { + if ($this->container['billingDetails'] === null) { + throw new \LogicException('Property "billingDetails" is required but has not been set.'); + } + return $this->container['billingDetails']; } diff --git a/lib/Model/PaymentMethodPayPayUpdateRequest.php b/lib/Model/PaymentMethodPayPayUpdateRequest.php index cdb0aff..31ba1f7 100644 --- a/lib/Model/PaymentMethodPayPayUpdateRequest.php +++ b/lib/Model/PaymentMethodPayPayUpdateRequest.php @@ -390,6 +390,10 @@ public function setMetadata(?array $metadata): self */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } diff --git a/lib/Model/PaymentMethodResponse.php b/lib/Model/PaymentMethodResponse.php index c7b8615..5b9b5d9 100644 --- a/lib/Model/PaymentMethodResponse.php +++ b/lib/Model/PaymentMethodResponse.php @@ -483,6 +483,10 @@ public function setObject(?string $object): self */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -510,6 +514,10 @@ public function setId(string $id): self */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } @@ -547,6 +555,10 @@ public function setType(string $type): self */ public function getCustomerId(): string { + if ($this->container['customerId'] === null) { + throw new \LogicException('Property "customerId" is required but has not been set.'); + } + return $this->container['customerId']; } @@ -574,6 +586,10 @@ public function setCustomerId(string $customerId): self */ public function getDetachedAt(): \DateTime { + if ($this->container['detachedAt'] === null) { + throw new \LogicException('Property "detachedAt" is required but has not been set.'); + } + return $this->container['detachedAt']; } @@ -601,6 +617,10 @@ public function setDetachedAt(\DateTime $detachedAt): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -628,6 +648,10 @@ public function setLivemode(bool $livemode): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -655,6 +679,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } @@ -682,6 +710,10 @@ public function setUpdatedAt(\DateTime $updatedAt): self */ public function getMetadata(): array { + if ($this->container['metadata'] === null) { + throw new \LogicException('Property "metadata" is required but has not been set.'); + } + return $this->container['metadata']; } @@ -709,6 +741,10 @@ public function setMetadata(array $metadata): self */ public function getBillingDetails(): \PAYJPV2\Model\PaymentMethodBillingDetailsResponse { + if ($this->container['billingDetails'] === null) { + throw new \LogicException('Property "billingDetails" is required but has not been set.'); + } + return $this->container['billingDetails']; } @@ -736,6 +772,10 @@ public function setBillingDetails(\PAYJPV2\Model\PaymentMethodBillingDetailsResp */ public function getCard(): \PAYJPV2\Model\PaymentMethodCardDetailsResponse { + if ($this->container['card'] === null) { + throw new \LogicException('Property "card" is required but has not been set.'); + } + return $this->container['card']; } diff --git a/lib/Model/PaymentMethodTypes.php b/lib/Model/PaymentMethodTypes.php index 7f02815..45312f8 100644 --- a/lib/Model/PaymentMethodTypes.php +++ b/lib/Model/PaymentMethodTypes.php @@ -37,27 +37,18 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class PaymentMethodTypes +enum PaymentMethodTypes: string { - /** - * Possible values of this enum - */ - public const CARD = 'card'; - - public const PAYPAY = 'paypay'; - - public const APPLE_PAY = 'apple_pay'; + case CARD = 'card'; + case PAYPAY = 'paypay'; + case APPLE_PAY = 'apple_pay'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::CARD, - self::PAYPAY, - self::APPLE_PAY, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/PaymentMethodUpdateRequest.php b/lib/Model/PaymentMethodUpdateRequest.php index 0bfd11f..bbaf7e9 100644 --- a/lib/Model/PaymentMethodUpdateRequest.php +++ b/lib/Model/PaymentMethodUpdateRequest.php @@ -397,6 +397,10 @@ public function setMetadata(?array $metadata): self */ public function getType(): string { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } diff --git a/lib/Model/PaymentRefundCreateRequest.php b/lib/Model/PaymentRefundCreateRequest.php index 079a987..ac09315 100644 --- a/lib/Model/PaymentRefundCreateRequest.php +++ b/lib/Model/PaymentRefundCreateRequest.php @@ -325,6 +325,10 @@ public function valid() */ public function getPaymentFlowId(): string { + if ($this->container['paymentFlowId'] === null) { + throw new \LogicException('Property "paymentFlowId" is required but has not been set.'); + } + return $this->container['paymentFlowId']; } diff --git a/lib/Model/PaymentRefundListResponse.php b/lib/Model/PaymentRefundListResponse.php index 891f25d..6174896 100644 --- a/lib/Model/PaymentRefundListResponse.php +++ b/lib/Model/PaymentRefundListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/PaymentRefundReason.php b/lib/Model/PaymentRefundReason.php index b928d7b..c28f5a7 100644 --- a/lib/Model/PaymentRefundReason.php +++ b/lib/Model/PaymentRefundReason.php @@ -37,27 +37,18 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class PaymentRefundReason +enum PaymentRefundReason: string { - /** - * Possible values of this enum - */ - public const DUPLICATE = 'duplicate'; - - public const FRAUDULENT = 'fraudulent'; - - public const REQUESTED_BY_CUSTOMER = 'requested_by_customer'; + case DUPLICATE = 'duplicate'; + case FRAUDULENT = 'fraudulent'; + case REQUESTED_BY_CUSTOMER = 'requested_by_customer'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::DUPLICATE, - self::FRAUDULENT, - self::REQUESTED_BY_CUSTOMER, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/PaymentRefundResponse.php b/lib/Model/PaymentRefundResponse.php index 33e4a39..1416cc9 100644 --- a/lib/Model/PaymentRefundResponse.php +++ b/lib/Model/PaymentRefundResponse.php @@ -410,6 +410,10 @@ public function valid() */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -474,6 +478,10 @@ public function setObject(?string $object): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -501,6 +509,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } @@ -528,6 +540,10 @@ public function setUpdatedAt(\DateTime $updatedAt): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -555,6 +571,10 @@ public function setLivemode(bool $livemode): self */ public function getAmount(): int { + if ($this->container['amount'] === null) { + throw new \LogicException('Property "amount" is required but has not been set.'); + } + return $this->container['amount']; } @@ -582,6 +602,10 @@ public function setAmount(int $amount): self */ public function getStatus(): \PAYJPV2\Model\PaymentRefundStatus { + if ($this->container['status'] === null) { + throw new \LogicException('Property "status" is required but has not been set.'); + } + return $this->container['status']; } @@ -609,6 +633,10 @@ public function setStatus(\PAYJPV2\Model\PaymentRefundStatus $status): self */ public function getPaymentFlowId(): string { + if ($this->container['paymentFlowId'] === null) { + throw new \LogicException('Property "paymentFlowId" is required but has not been set.'); + } + return $this->container['paymentFlowId']; } @@ -670,6 +698,10 @@ public function setReason(?\PAYJPV2\Model\PaymentRefundReason $reason): self */ public function getMetadata(): array { + if ($this->container['metadata'] === null) { + throw new \LogicException('Property "metadata" is required but has not been set.'); + } + return $this->container['metadata']; } diff --git a/lib/Model/PaymentRefundStatus.php b/lib/Model/PaymentRefundStatus.php index 86be57e..f9f41a4 100644 --- a/lib/Model/PaymentRefundStatus.php +++ b/lib/Model/PaymentRefundStatus.php @@ -37,33 +37,20 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class PaymentRefundStatus +enum PaymentRefundStatus: string { - /** - * Possible values of this enum - */ - public const SUCCEEDED = 'succeeded'; - - public const FAILED = 'failed'; - - public const PENDING = 'pending'; - - public const CANCELED = 'canceled'; - - public const REQUIRES_ACTION = 'requires_action'; + case SUCCEEDED = 'succeeded'; + case FAILED = 'failed'; + case PENDING = 'pending'; + case CANCELED = 'canceled'; + case REQUIRES_ACTION = 'requires_action'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::SUCCEEDED, - self::FAILED, - self::PENDING, - self::CANCELED, - self::REQUIRES_ACTION, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/PaymentTransactionListResponse.php b/lib/Model/PaymentTransactionListResponse.php index bc31bcd..3f91a91 100644 --- a/lib/Model/PaymentTransactionListResponse.php +++ b/lib/Model/PaymentTransactionListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/PaymentTransactionResponse.php b/lib/Model/PaymentTransactionResponse.php index 7a19355..976685b 100644 --- a/lib/Model/PaymentTransactionResponse.php +++ b/lib/Model/PaymentTransactionResponse.php @@ -444,6 +444,10 @@ public function valid() */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -508,6 +512,10 @@ public function setObject(?string $object): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -535,6 +543,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } @@ -562,6 +574,10 @@ public function setUpdatedAt(\DateTime $updatedAt): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -589,6 +605,10 @@ public function setLivemode(bool $livemode): self */ public function getResourceId(): string { + if ($this->container['resourceId'] === null) { + throw new \LogicException('Property "resourceId" is required but has not been set.'); + } + return $this->container['resourceId']; } @@ -616,6 +636,10 @@ public function setResourceId(string $resourceId): self */ public function getAmount(): int { + if ($this->container['amount'] === null) { + throw new \LogicException('Property "amount" is required but has not been set.'); + } + return $this->container['amount']; } @@ -643,6 +667,10 @@ public function setAmount(int $amount): self */ public function getCurrency(): \PAYJPV2\Model\Currency { + if ($this->container['currency'] === null) { + throw new \LogicException('Property "currency" is required but has not been set.'); + } + return $this->container['currency']; } @@ -670,6 +698,10 @@ public function setCurrency(\PAYJPV2\Model\Currency $currency): self */ public function getFeeRate(): string { + if ($this->container['feeRate'] === null) { + throw new \LogicException('Property "feeRate" is required but has not been set.'); + } + return $this->container['feeRate']; } @@ -702,6 +734,10 @@ public function setFeeRate(string $feeRate): self */ public function getFee(): int { + if ($this->container['fee'] === null) { + throw new \LogicException('Property "fee" is required but has not been set.'); + } + return $this->container['fee']; } @@ -729,6 +765,10 @@ public function setFee(int $fee): self */ public function getType(): \PAYJPV2\Model\PaymentTransactionType { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } @@ -756,6 +796,10 @@ public function setType(\PAYJPV2\Model\PaymentTransactionType $type): self */ public function getPaymentMethodType(): \PAYJPV2\Model\PaymentMethodTypes { + if ($this->container['paymentMethodType'] === null) { + throw new \LogicException('Property "paymentMethodType" is required but has not been set.'); + } + return $this->container['paymentMethodType']; } @@ -783,6 +827,10 @@ public function setPaymentMethodType(\PAYJPV2\Model\PaymentMethodTypes $paymentM */ public function getTermId(): string { + if ($this->container['termId'] === null) { + throw new \LogicException('Property "termId" is required but has not been set.'); + } + return $this->container['termId']; } diff --git a/lib/Model/PaymentTransactionType.php b/lib/Model/PaymentTransactionType.php index 45a8c8f..2d4a46f 100644 --- a/lib/Model/PaymentTransactionType.php +++ b/lib/Model/PaymentTransactionType.php @@ -37,30 +37,19 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class PaymentTransactionType +enum PaymentTransactionType: string { - /** - * Possible values of this enum - */ - public const PAYMENT = 'payment'; - - public const REFUND = 'refund'; - - public const CHARGEBACK = 'chargeback'; - - public const CHARGEBACK_CANCEL = 'chargeback_cancel'; + case PAYMENT = 'payment'; + case REFUND = 'refund'; + case CHARGEBACK = 'chargeback'; + case CHARGEBACK_CANCEL = 'chargeback_cancel'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::PAYMENT, - self::REFUND, - self::CHARGEBACK, - self::CHARGEBACK_CANCEL, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/PriceCreateRequest.php b/lib/Model/PriceCreateRequest.php index a628d74..497de41 100644 --- a/lib/Model/PriceCreateRequest.php +++ b/lib/Model/PriceCreateRequest.php @@ -467,6 +467,10 @@ public function setId(?string $id): self */ public function getCurrency(): \PAYJPV2\Model\Currency { + if ($this->container['currency'] === null) { + throw new \LogicException('Property "currency" is required but has not been set.'); + } + return $this->container['currency']; } @@ -521,6 +525,10 @@ public function setActive(?bool $active): self */ public function getProductId(): string { + if ($this->container['productId'] === null) { + throw new \LogicException('Property "productId" is required but has not been set.'); + } + return $this->container['productId']; } @@ -548,6 +556,10 @@ public function setProductId(string $productId): self */ public function getUnitAmount(): int { + if ($this->container['unitAmount'] === null) { + throw new \LogicException('Property "unitAmount" is required but has not been set.'); + } + return $this->container['unitAmount']; } diff --git a/lib/Model/PriceDetailsResponse.php b/lib/Model/PriceDetailsResponse.php index 50689e5..8ddb94d 100644 --- a/lib/Model/PriceDetailsResponse.php +++ b/lib/Model/PriceDetailsResponse.php @@ -440,6 +440,10 @@ public function valid() */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -504,6 +508,10 @@ public function setObject(?string $object): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -531,6 +539,10 @@ public function setLivemode(bool $livemode): self */ public function getActive(): bool { + if ($this->container['active'] === null) { + throw new \LogicException('Property "active" is required but has not been set.'); + } + return $this->container['active']; } @@ -558,6 +570,10 @@ public function setActive(bool $active): self */ public function getMetadata(): array { + if ($this->container['metadata'] === null) { + throw new \LogicException('Property "metadata" is required but has not been set.'); + } + return $this->container['metadata']; } @@ -619,6 +635,10 @@ public function setNickname(?string $nickname): self */ public function getType(): \PAYJPV2\Model\PriceType { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } @@ -680,6 +700,10 @@ public function setLookupKey(?string $lookupKey): self */ public function getCurrency(): \PAYJPV2\Model\Currency { + if ($this->container['currency'] === null) { + throw new \LogicException('Property "currency" is required but has not been set.'); + } + return $this->container['currency']; } @@ -707,6 +731,10 @@ public function setCurrency(\PAYJPV2\Model\Currency $currency): self */ public function getProductId(): string { + if ($this->container['productId'] === null) { + throw new \LogicException('Property "productId" is required but has not been set.'); + } + return $this->container['productId']; } @@ -734,6 +762,10 @@ public function setProductId(string $productId): self */ public function getUnitAmount(): int { + if ($this->container['unitAmount'] === null) { + throw new \LogicException('Property "unitAmount" is required but has not been set.'); + } + return $this->container['unitAmount']; } @@ -761,6 +793,10 @@ public function setUnitAmount(int $unitAmount): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -788,6 +824,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } diff --git a/lib/Model/PriceListResponse.php b/lib/Model/PriceListResponse.php index f355ea0..ceca9ee 100644 --- a/lib/Model/PriceListResponse.php +++ b/lib/Model/PriceListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/PriceType.php b/lib/Model/PriceType.php index 269e77d..77f2de9 100644 --- a/lib/Model/PriceType.php +++ b/lib/Model/PriceType.php @@ -37,21 +37,16 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class PriceType +enum PriceType: string { - /** - * Possible values of this enum - */ - public const ONE_TIME = 'one_time'; + case ONE_TIME = 'one_time'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::ONE_TIME, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/ProductCreateRequest.php b/lib/Model/ProductCreateRequest.php index ab2cf07..886ab1e 100644 --- a/lib/Model/ProductCreateRequest.php +++ b/lib/Model/ProductCreateRequest.php @@ -478,6 +478,10 @@ public function setId(?string $id): self */ public function getName(): string { + if ($this->container['name'] === null) { + throw new \LogicException('Property "name" is required but has not been set.'); + } + return $this->container['name']; } diff --git a/lib/Model/ProductDeletedResponse.php b/lib/Model/ProductDeletedResponse.php index 2eeaef6..5cacaf3 100644 --- a/lib/Model/ProductDeletedResponse.php +++ b/lib/Model/ProductDeletedResponse.php @@ -340,6 +340,10 @@ public function valid() */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -404,6 +408,10 @@ public function setObject(?string $object): self */ public function getDeleted(): bool { + if ($this->container['deleted'] === null) { + throw new \LogicException('Property "deleted" is required but has not been set.'); + } + return $this->container['deleted']; } diff --git a/lib/Model/ProductDetailsResponse.php b/lib/Model/ProductDetailsResponse.php index a5958f8..c2ad494 100644 --- a/lib/Model/ProductDetailsResponse.php +++ b/lib/Model/ProductDetailsResponse.php @@ -390,6 +390,10 @@ public function valid() */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -454,6 +458,10 @@ public function setObject(?string $object): self */ public function getName(): string { + if ($this->container['name'] === null) { + throw new \LogicException('Property "name" is required but has not been set.'); + } + return $this->container['name']; } @@ -481,6 +489,10 @@ public function setName(string $name): self */ public function getActive(): bool { + if ($this->container['active'] === null) { + throw new \LogicException('Property "active" is required but has not been set.'); + } + return $this->container['active']; } diff --git a/lib/Model/ProductListResponse.php b/lib/Model/ProductListResponse.php index cdae858..8449f81 100644 --- a/lib/Model/ProductListResponse.php +++ b/lib/Model/ProductListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/SetupFlowCancellationReason.php b/lib/Model/SetupFlowCancellationReason.php index 9b785cb..16e3ad2 100644 --- a/lib/Model/SetupFlowCancellationReason.php +++ b/lib/Model/SetupFlowCancellationReason.php @@ -37,27 +37,18 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class SetupFlowCancellationReason +enum SetupFlowCancellationReason: string { - /** - * Possible values of this enum - */ - public const ABANDONED = 'abandoned'; - - public const DUPLICATE = 'duplicate'; - - public const REQUESTED_BY_CUSTOMER = 'requested_by_customer'; + case ABANDONED = 'abandoned'; + case DUPLICATE = 'duplicate'; + case REQUESTED_BY_CUSTOMER = 'requested_by_customer'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::ABANDONED, - self::DUPLICATE, - self::REQUESTED_BY_CUSTOMER, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/SetupFlowListResponse.php b/lib/Model/SetupFlowListResponse.php index 02ed41d..4360334 100644 --- a/lib/Model/SetupFlowListResponse.php +++ b/lib/Model/SetupFlowListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/SetupFlowResponse.php b/lib/Model/SetupFlowResponse.php index c488186..a7b9cc4 100644 --- a/lib/Model/SetupFlowResponse.php +++ b/lib/Model/SetupFlowResponse.php @@ -470,6 +470,10 @@ public function valid() */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -534,6 +538,10 @@ public function setObject(?string $object): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -561,6 +569,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } @@ -588,6 +600,10 @@ public function setUpdatedAt(\DateTime $updatedAt): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -615,6 +631,10 @@ public function setLivemode(bool $livemode): self */ public function getClientSecret(): string { + if ($this->container['clientSecret'] === null) { + throw new \LogicException('Property "clientSecret" is required but has not been set.'); + } + return $this->container['clientSecret']; } @@ -710,6 +730,10 @@ public function setDescription(?string $description): self */ public function getMetadata(): array { + if ($this->container['metadata'] === null) { + throw new \LogicException('Property "metadata" is required but has not been set.'); + } + return $this->container['metadata']; } @@ -805,6 +829,10 @@ public function setPaymentMethodOptions(?array $paymentMethodOptions): self */ public function getPaymentMethodTypes(): array { + if ($this->container['paymentMethodTypes'] === null) { + throw new \LogicException('Property "paymentMethodTypes" is required but has not been set.'); + } + return $this->container['paymentMethodTypes']; } @@ -832,6 +860,10 @@ public function setPaymentMethodTypes(array $paymentMethodTypes): self */ public function getStatus(): \PAYJPV2\Model\SetupFlowStatus { + if ($this->container['status'] === null) { + throw new \LogicException('Property "status" is required but has not been set.'); + } + return $this->container['status']; } diff --git a/lib/Model/SetupFlowStatus.php b/lib/Model/SetupFlowStatus.php index 457a563..88bb2cc 100644 --- a/lib/Model/SetupFlowStatus.php +++ b/lib/Model/SetupFlowStatus.php @@ -37,36 +37,21 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class SetupFlowStatus +enum SetupFlowStatus: string { - /** - * Possible values of this enum - */ - public const CANCELED = 'canceled'; - - public const PROCESSING = 'processing'; - - public const REQUIRES_ACTION = 'requires_action'; - - public const REQUIRES_CONFIRMATION = 'requires_confirmation'; - - public const REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; - - public const SUCCEEDED = 'succeeded'; + case CANCELED = 'canceled'; + case PROCESSING = 'processing'; + case REQUIRES_ACTION = 'requires_action'; + case REQUIRES_CONFIRMATION = 'requires_confirmation'; + case REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; + case SUCCEEDED = 'succeeded'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::CANCELED, - self::PROCESSING, - self::REQUIRES_ACTION, - self::REQUIRES_CONFIRMATION, - self::REQUIRES_PAYMENT_METHOD, - self::SUCCEEDED, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/StatementItemResponse.php b/lib/Model/StatementItemResponse.php index 6c65cd4..e386b71 100644 --- a/lib/Model/StatementItemResponse.php +++ b/lib/Model/StatementItemResponse.php @@ -334,6 +334,10 @@ public function valid() */ public function getSubject(): \PAYJPV2\Model\StatementSubject { + if ($this->container['subject'] === null) { + throw new \LogicException('Property "subject" is required but has not been set.'); + } + return $this->container['subject']; } @@ -395,6 +399,10 @@ public function setName(?string $name): self */ public function getAmount(): int { + if ($this->container['amount'] === null) { + throw new \LogicException('Property "amount" is required but has not been set.'); + } + return $this->container['amount']; } diff --git a/lib/Model/StatementListResponse.php b/lib/Model/StatementListResponse.php index f8795e7..4d08d52 100644 --- a/lib/Model/StatementListResponse.php +++ b/lib/Model/StatementListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/StatementResponse.php b/lib/Model/StatementResponse.php index 52c7103..c3c60c7 100644 --- a/lib/Model/StatementResponse.php +++ b/lib/Model/StatementResponse.php @@ -457,6 +457,10 @@ public function setObject(?string $object): self */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -484,6 +488,10 @@ public function setId(string $id): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -545,6 +553,10 @@ public function setTitle(?string $title): self */ public function getType(): \PAYJPV2\Model\StatementType { + if ($this->container['type'] === null) { + throw new \LogicException('Property "type" is required but has not been set.'); + } + return $this->container['type']; } @@ -572,6 +584,10 @@ public function setType(\PAYJPV2\Model\StatementType $type): self */ public function getCreatedAt(): \DateTime { + if ($this->container['createdAt'] === null) { + throw new \LogicException('Property "createdAt" is required but has not been set.'); + } + return $this->container['createdAt']; } @@ -599,6 +615,10 @@ public function setCreatedAt(\DateTime $createdAt): self */ public function getUpdatedAt(): \DateTime { + if ($this->container['updatedAt'] === null) { + throw new \LogicException('Property "updatedAt" is required but has not been set.'); + } + return $this->container['updatedAt']; } @@ -694,6 +714,10 @@ public function setBalanceId(?string $balanceId): self */ public function getItems(): array { + if ($this->container['items'] === null) { + throw new \LogicException('Property "items" is required but has not been set.'); + } + return $this->container['items']; } @@ -721,6 +745,10 @@ public function setItems(array $items): self */ public function getNet(): int { + if ($this->container['net'] === null) { + throw new \LogicException('Property "net" is required but has not been set.'); + } + return $this->container['net']; } diff --git a/lib/Model/StatementSubject.php b/lib/Model/StatementSubject.php index dc85fba..b50386a 100644 --- a/lib/Model/StatementSubject.php +++ b/lib/Model/StatementSubject.php @@ -38,69 +38,32 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class StatementSubject +enum StatementSubject: string { - /** - * Possible values of this enum - */ - public const GROSS_SALES = 'gross_sales'; - - public const FEE = 'fee'; - - public const PLATFORM_FEE = 'platform_fee'; - - public const GROSS_REFUND = 'gross_refund'; - - public const REFUND_FEE_OFFSET = 'refund_fee_offset'; - - public const REFUND_PLATFORM_FEE_OFFSET = 'refund_platform_fee_offset'; - - public const CHARGEBACK = 'chargeback'; - - public const CHARGEBACK_FEE_OFFSET = 'chargeback_fee_offset'; - - public const CHARGEBACK_PLATFORM_FEE_OFFSET = 'chargeback_platform_fee_offset'; - - public const PROPLAN = 'proplan'; - - public const PLAN_FEE = 'plan_fee'; - - public const FORFEIT = 'forfeit'; - - public const REALLOCATION = 'reallocation'; - - public const YELL_BANK_COLLECTION = 'yell_bank_collection'; - - public const PYB_EARLY_DEPOSIT_SERVICE_FEE = 'pyb_early_deposit_service_fee'; - - public const TRANSFER_FEE = 'transfer_fee'; - - public const OTHER = 'other'; + case GROSS_SALES = 'gross_sales'; + case FEE = 'fee'; + case PLATFORM_FEE = 'platform_fee'; + case GROSS_REFUND = 'gross_refund'; + case REFUND_FEE_OFFSET = 'refund_fee_offset'; + case REFUND_PLATFORM_FEE_OFFSET = 'refund_platform_fee_offset'; + case CHARGEBACK = 'chargeback'; + case CHARGEBACK_FEE_OFFSET = 'chargeback_fee_offset'; + case CHARGEBACK_PLATFORM_FEE_OFFSET = 'chargeback_platform_fee_offset'; + case PROPLAN = 'proplan'; + case PLAN_FEE = 'plan_fee'; + case FORFEIT = 'forfeit'; + case REALLOCATION = 'reallocation'; + case YELL_BANK_COLLECTION = 'yell_bank_collection'; + case PYB_EARLY_DEPOSIT_SERVICE_FEE = 'pyb_early_deposit_service_fee'; + case TRANSFER_FEE = 'transfer_fee'; + case OTHER = 'other'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::GROSS_SALES, - self::FEE, - self::PLATFORM_FEE, - self::GROSS_REFUND, - self::REFUND_FEE_OFFSET, - self::REFUND_PLATFORM_FEE_OFFSET, - self::CHARGEBACK, - self::CHARGEBACK_FEE_OFFSET, - self::CHARGEBACK_PLATFORM_FEE_OFFSET, - self::PROPLAN, - self::PLAN_FEE, - self::FORFEIT, - self::REALLOCATION, - self::YELL_BANK_COLLECTION, - self::PYB_EARLY_DEPOSIT_SERVICE_FEE, - self::TRANSFER_FEE, - self::OTHER, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/StatementType.php b/lib/Model/StatementType.php index e619a1f..c46cffc 100644 --- a/lib/Model/StatementType.php +++ b/lib/Model/StatementType.php @@ -38,33 +38,20 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class StatementType +enum StatementType: string { - /** - * Possible values of this enum - */ - public const SALES = 'sales'; - - public const SERVICE_FEE = 'service_fee'; - - public const TRANSFER_FEE = 'transfer_fee'; - - public const FORFEIT = 'forfeit'; - - public const MISC = 'misc'; + case SALES = 'sales'; + case SERVICE_FEE = 'service_fee'; + case TRANSFER_FEE = 'transfer_fee'; + case FORFEIT = 'forfeit'; + case MISC = 'misc'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::SALES, - self::SERVICE_FEE, - self::TRANSFER_FEE, - self::FORFEIT, - self::MISC, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/Model/StatementURLResponse.php b/lib/Model/StatementURLResponse.php index 4fd753a..370ec53 100644 --- a/lib/Model/StatementURLResponse.php +++ b/lib/Model/StatementURLResponse.php @@ -377,6 +377,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -404,6 +408,10 @@ public function setUrl(string $url): self */ public function getExpires(): \DateTime { + if ($this->container['expires'] === null) { + throw new \LogicException('Property "expires" is required but has not been set.'); + } + return $this->container['expires']; } diff --git a/lib/Model/TaxRateCreateRequest.php b/lib/Model/TaxRateCreateRequest.php index 31e4944..b882801 100644 --- a/lib/Model/TaxRateCreateRequest.php +++ b/lib/Model/TaxRateCreateRequest.php @@ -349,6 +349,10 @@ public function valid() */ public function getDisplayName(): string { + if ($this->container['displayName'] === null) { + throw new \LogicException('Property "displayName" is required but has not been set.'); + } + return $this->container['displayName']; } @@ -376,6 +380,10 @@ public function setDisplayName(string $displayName): self */ public function getInclusive(): bool { + if ($this->container['inclusive'] === null) { + throw new \LogicException('Property "inclusive" is required but has not been set.'); + } + return $this->container['inclusive']; } @@ -403,6 +411,10 @@ public function setInclusive(bool $inclusive): self */ public function getPercentage(): float { + if ($this->container['percentage'] === null) { + throw new \LogicException('Property "percentage" is required but has not been set.'); + } + return $this->container['percentage']; } diff --git a/lib/Model/TaxRateDetailsResponse.php b/lib/Model/TaxRateDetailsResponse.php index 9e3fced..a4f5953 100644 --- a/lib/Model/TaxRateDetailsResponse.php +++ b/lib/Model/TaxRateDetailsResponse.php @@ -437,6 +437,10 @@ public function setObject(?string $object): self */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -464,6 +468,10 @@ public function setId(string $id): self */ public function getDisplayName(): string { + if ($this->container['displayName'] === null) { + throw new \LogicException('Property "displayName" is required but has not been set.'); + } + return $this->container['displayName']; } @@ -491,6 +499,10 @@ public function setDisplayName(string $displayName): self */ public function getInclusive(): bool { + if ($this->container['inclusive'] === null) { + throw new \LogicException('Property "inclusive" is required but has not been set.'); + } + return $this->container['inclusive']; } @@ -518,6 +530,10 @@ public function setInclusive(bool $inclusive): self */ public function getPercentage(): float { + if ($this->container['percentage'] === null) { + throw new \LogicException('Property "percentage" is required but has not been set.'); + } + return $this->container['percentage']; } @@ -545,6 +561,10 @@ public function setPercentage(float $percentage): self */ public function getActive(): bool { + if ($this->container['active'] === null) { + throw new \LogicException('Property "active" is required but has not been set.'); + } + return $this->container['active']; } @@ -640,6 +660,10 @@ public function setDescription(?string $description): self */ public function getMetadata(): array { + if ($this->container['metadata'] === null) { + throw new \LogicException('Property "metadata" is required but has not been set.'); + } + return $this->container['metadata']; } diff --git a/lib/Model/TaxRateListResponse.php b/lib/Model/TaxRateListResponse.php index 057cbb8..d12ac11 100644 --- a/lib/Model/TaxRateListResponse.php +++ b/lib/Model/TaxRateListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/TermListResponse.php b/lib/Model/TermListResponse.php index f5c6daf..e19bb5a 100644 --- a/lib/Model/TermListResponse.php +++ b/lib/Model/TermListResponse.php @@ -387,6 +387,10 @@ public function setObject(?string $object): self */ public function getUrl(): string { + if ($this->container['url'] === null) { + throw new \LogicException('Property "url" is required but has not been set.'); + } + return $this->container['url']; } @@ -414,6 +418,10 @@ public function setUrl(string $url): self */ public function getHasMore(): bool { + if ($this->container['hasMore'] === null) { + throw new \LogicException('Property "hasMore" is required but has not been set.'); + } + return $this->container['hasMore']; } @@ -441,6 +449,10 @@ public function setHasMore(bool $hasMore): self */ public function getData(): array { + if ($this->container['data'] === null) { + throw new \LogicException('Property "data" is required but has not been set.'); + } + return $this->container['data']; } diff --git a/lib/Model/TermResponse.php b/lib/Model/TermResponse.php index f500557..4f87b72 100644 --- a/lib/Model/TermResponse.php +++ b/lib/Model/TermResponse.php @@ -370,6 +370,10 @@ public function valid() */ public function getId(): string { + if ($this->container['id'] === null) { + throw new \LogicException('Property "id" is required but has not been set.'); + } + return $this->container['id']; } @@ -434,6 +438,10 @@ public function setObject(?string $object): self */ public function getLivemode(): bool { + if ($this->container['livemode'] === null) { + throw new \LogicException('Property "livemode" is required but has not been set.'); + } + return $this->container['livemode']; } @@ -461,6 +469,10 @@ public function setLivemode(bool $livemode): self */ public function getStartAt(): \DateTime { + if ($this->container['startAt'] === null) { + throw new \LogicException('Property "startAt" is required but has not been set.'); + } + return $this->container['startAt']; } @@ -488,6 +500,10 @@ public function setStartAt(\DateTime $startAt): self */ public function getEndAt(): \DateTime { + if ($this->container['endAt'] === null) { + throw new \LogicException('Property "endAt" is required but has not been set.'); + } + return $this->container['endAt']; } @@ -515,6 +531,10 @@ public function setEndAt(\DateTime $endAt): self */ public function getClosed(): bool { + if ($this->container['closed'] === null) { + throw new \LogicException('Property "closed" is required but has not been set.'); + } + return $this->container['closed']; } diff --git a/lib/Model/Usage.php b/lib/Model/Usage.php index b65644a..1851d15 100644 --- a/lib/Model/Usage.php +++ b/lib/Model/Usage.php @@ -37,24 +37,17 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class Usage +enum Usage: string { - /** - * Possible values of this enum - */ - public const ON_SESSION = 'on_session'; - - public const OFF_SESSION = 'off_session'; + case ON_SESSION = 'on_session'; + case OFF_SESSION = 'off_session'; /** * Gets allowable values of the enum * @return string[] */ - public static function getAllowableEnumValues() + public static function getAllowableEnumValues(): array { - return [ - self::ON_SESSION, - self::OFF_SESSION, - ]; + return array_column(self::cases(), 'value'); } } diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 5f106ce..39bd231 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -70,6 +70,11 @@ public static function sanitizeForSerialization($data, $type = null, $format = n return $data; } + // PHP 8.1+ backed enum support + if ($data instanceof \BackedEnum) { + return $data->value; + } + if ($data instanceof \DateTime) { return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat); } @@ -90,14 +95,17 @@ public static function sanitizeForSerialization($data, $type = null, $format = n $getter = $data::getters()[$property]; $value = $data->$getter(); if ($value !== null && ! in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - $callable = [$openAPIType, 'getAllowableEnumValues']; - if (is_callable($callable)) { - /** array $callable */ - $allowedEnumTypes = $callable(); - if (! in_array($value, $allowedEnumTypes, true)) { - $imploded = implode("', '", $allowedEnumTypes); - - throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + // PHP 8.1+ backed enum - already type-safe, skip validation + if (! ($value instanceof \BackedEnum)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (! in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } } } } @@ -501,6 +509,11 @@ public static function deserialize($data, $class, $httpHeaders = null) } + // PHP 8.1+ backed enum support + if (enum_exists($class)) { + return $class::from($data); + } + if (method_exists($class, 'getAllowableEnumValues')) { if (! in_array($data, $class::getAllowableEnumValues(), true)) { $imploded = implode("', '", $class::getAllowableEnumValues()); @@ -509,47 +522,48 @@ public static function deserialize($data, $class, $httpHeaders = null) } return $data; - } else { - $data = is_string($data) ? json_decode($data) : $data; + } - if (is_array($data)) { - $data = (object)$data; - } + // Model class deserialization + $data = is_string($data) ? json_decode($data) : $data; - // If a discriminator is defined and points to a valid subclass, use it. - $discriminator = $class::DISCRIMINATOR; - if (! empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { - $subclass = '\PAYJPV2\Model\\' . $data->{$discriminator}; - if (is_subclass_of($subclass, $class)) { - $class = $subclass; - } - } + if (is_array($data)) { + $data = (object)$data; + } - /** @var ModelInterface $instance */ - $instance = new $class(); - foreach ($instance::openAPITypes() as $property => $type) { - $propertySetter = $instance::setters()[$property]; + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (! empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\PAYJPV2\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } - if (! isset($propertySetter)) { - continue; - } + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; - if (! isset($data->{$instance::attributeMap()[$property]})) { - if ($instance::isNullable($property)) { - $instance->$propertySetter(null); - } + if (! isset($propertySetter)) { + continue; + } - continue; + if (! isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); } - if (isset($data->{$instance::attributeMap()[$property]})) { - $propertyValue = $data->{$instance::attributeMap()[$property]}; - $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); - } + continue; } - return $instance; + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } } + + return $instance; } /**