From 7e267d7fee81c415213832abf237f807bdafeb3d Mon Sep 17 00:00:00 2001 From: Victor Ndambakuwa Date: Tue, 6 Jul 2021 08:06:14 +0200 Subject: [PATCH] Release 3.0.1 --- composer.json | 2 +- lib/ApiClient.php | 110 +- lib/Configuration.php | 6 +- ...stractShopifySubscriptionProductUpdate.php | 713 ++++++++++ lib/Model/AbstractTransactionPending.php | 16 +- lib/Model/PaymentContract.php | 17 +- lib/Model/PaymentLink.php | 17 +- lib/Model/PaymentLinkCreate.php | 17 +- lib/Model/PaymentTerminal.php | 32 + lib/Model/PaymentTerminalLocation.php | 60 +- lib/Model/PaymentTerminalLocationVersion.php | 32 + lib/Model/PaymentTerminalReceiptType.php | 362 +++++ lib/Model/PaymentTerminalState.php | 2 + lib/Model/RenderedTerminalReceipt.php | 396 ++++++ lib/Model/Role.php | 6 +- lib/Model/RoleState.php | 58 + lib/Model/ShopifyRecurringOrder.php | 708 ++++++++++ lib/Model/ShopifyRecurringOrderState.php | 62 + .../ShopifyRecurringOrderUpdateRequest.php | 330 +++++ lib/Model/ShopifySubscriber.php | 586 ++++++++ lib/Model/ShopifySubscriberActive.php | 432 ++++++ lib/Model/ShopifySubscriberCreation.php | 365 +++++ lib/Model/ShopifySubscriberState.php | 56 + lib/Model/ShopifySubscription.php | 825 ++++++++++++ lib/Model/ShopifySubscriptionAddress.php | 309 +++++ .../ShopifySubscriptionAddressCreate.php | 994 ++++++++++++++ ...ShopifySubscriptionBillingIntervalUnit.php | 62 + .../ShopifySubscriptionCreationRequest.php | 738 ++++++++++ ...ySubscriptionModelBillingConfiguration.php | 554 ++++++++ lib/Model/ShopifySubscriptionModelItem.php | 426 ++++++ lib/Model/ShopifySubscriptionModelTaxLine.php | 330 +++++ lib/Model/ShopifySubscriptionProduct.php | 1194 +++++++++++++++++ .../ShopifySubscriptionProductCreate.php | 365 +++++ ...hopifySubscriptionProductPricingOption.php | 60 + lib/Model/ShopifySubscriptionProductState.php | 62 + .../ShopifySubscriptionProductUpdate.php | 330 +++++ lib/Model/ShopifySubscriptionState.php | 62 + lib/Model/ShopifySubscriptionSuspension.php | 682 ++++++++++ .../ShopifySubscriptionSuspensionCreate.php | 371 +++++ ...ShopifySubscriptionSuspensionInitiator.php | 54 + .../ShopifySubscriptionSuspensionState.php | 54 + .../ShopifySubscriptionSuspensionType.php | 54 + ...pifySubscriptionUpdateAddressesRequest.php | 362 +++++ .../ShopifySubscriptionUpdateRequest.php | 426 ++++++ lib/Model/ShopifySubscriptionVersion.php | 1162 ++++++++++++++++ lib/Model/ShopifySubscriptionVersionItem.php | 426 ++++++ ...fySubscriptionVersionItemPriceStrategy.php | 54 + lib/Model/ShopifySubscriptionVersionState.php | 56 + lib/Model/ShopifySubscriptionWeekday.php | 64 + lib/Model/ShopifyTaxLine.php | 426 ++++++ lib/Model/TerminalReceiptFetchRequest.php | 368 +++++ lib/Model/TerminalReceiptFormat.php | 54 + lib/Model/Token.php | 17 +- lib/Model/TokenCreate.php | 17 +- lib/Model/Transaction.php | 16 +- lib/Model/TransactionCreate.php | 8 +- lib/Model/TransactionPending.php | 8 +- lib/Service/PaymentTerminalService.php | 408 ++++++ lib/Service/PaymentTerminalTillService.php | 355 +++++ lib/Service/ShopifyRecurringOrderService.php | 515 +++++++ lib/Service/ShopifySubscriberService.php | 531 ++++++++ .../ShopifySubscriptionProductService.php | 646 +++++++++ lib/Service/ShopifySubscriptionService.php | 867 ++++++++++++ .../ShopifySubscriptionSuspensionService.php | 628 +++++++++ .../ShopifySubscriptionVersionService.php | 408 ++++++ lib/Service/TokenService.php | 113 ++ lib/Service/TransactionTerminalService.php | 311 +++++ 67 files changed, 19999 insertions(+), 158 deletions(-) create mode 100644 lib/Model/AbstractShopifySubscriptionProductUpdate.php create mode 100644 lib/Model/PaymentTerminalReceiptType.php create mode 100644 lib/Model/RenderedTerminalReceipt.php create mode 100644 lib/Model/RoleState.php create mode 100644 lib/Model/ShopifyRecurringOrder.php create mode 100644 lib/Model/ShopifyRecurringOrderState.php create mode 100644 lib/Model/ShopifyRecurringOrderUpdateRequest.php create mode 100644 lib/Model/ShopifySubscriber.php create mode 100644 lib/Model/ShopifySubscriberActive.php create mode 100644 lib/Model/ShopifySubscriberCreation.php create mode 100644 lib/Model/ShopifySubscriberState.php create mode 100644 lib/Model/ShopifySubscription.php create mode 100644 lib/Model/ShopifySubscriptionAddress.php create mode 100644 lib/Model/ShopifySubscriptionAddressCreate.php create mode 100644 lib/Model/ShopifySubscriptionBillingIntervalUnit.php create mode 100644 lib/Model/ShopifySubscriptionCreationRequest.php create mode 100644 lib/Model/ShopifySubscriptionModelBillingConfiguration.php create mode 100644 lib/Model/ShopifySubscriptionModelItem.php create mode 100644 lib/Model/ShopifySubscriptionModelTaxLine.php create mode 100644 lib/Model/ShopifySubscriptionProduct.php create mode 100644 lib/Model/ShopifySubscriptionProductCreate.php create mode 100644 lib/Model/ShopifySubscriptionProductPricingOption.php create mode 100644 lib/Model/ShopifySubscriptionProductState.php create mode 100644 lib/Model/ShopifySubscriptionProductUpdate.php create mode 100644 lib/Model/ShopifySubscriptionState.php create mode 100644 lib/Model/ShopifySubscriptionSuspension.php create mode 100644 lib/Model/ShopifySubscriptionSuspensionCreate.php create mode 100644 lib/Model/ShopifySubscriptionSuspensionInitiator.php create mode 100644 lib/Model/ShopifySubscriptionSuspensionState.php create mode 100644 lib/Model/ShopifySubscriptionSuspensionType.php create mode 100644 lib/Model/ShopifySubscriptionUpdateAddressesRequest.php create mode 100644 lib/Model/ShopifySubscriptionUpdateRequest.php create mode 100644 lib/Model/ShopifySubscriptionVersion.php create mode 100644 lib/Model/ShopifySubscriptionVersionItem.php create mode 100644 lib/Model/ShopifySubscriptionVersionItemPriceStrategy.php create mode 100644 lib/Model/ShopifySubscriptionVersionState.php create mode 100644 lib/Model/ShopifySubscriptionWeekday.php create mode 100644 lib/Model/ShopifyTaxLine.php create mode 100644 lib/Model/TerminalReceiptFetchRequest.php create mode 100644 lib/Model/TerminalReceiptFormat.php create mode 100644 lib/Service/PaymentTerminalService.php create mode 100644 lib/Service/PaymentTerminalTillService.php create mode 100644 lib/Service/ShopifyRecurringOrderService.php create mode 100644 lib/Service/ShopifySubscriberService.php create mode 100644 lib/Service/ShopifySubscriptionProductService.php create mode 100644 lib/Service/ShopifySubscriptionService.php create mode 100644 lib/Service/ShopifySubscriptionSuspensionService.php create mode 100644 lib/Service/ShopifySubscriptionVersionService.php create mode 100644 lib/Service/TransactionTerminalService.php diff --git a/composer.json b/composer.json index c10c4dc..1f5ebe1 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "postfinancecheckout/sdk", - "version": "3.0.0", + "version": "3.0.1", "description": "PostFinance Checkout SDK for PHP", "keywords": [ "postfinancecheckout", diff --git a/lib/ApiClient.php b/lib/ApiClient.php index b9303b2..65a9cc9 100644 --- a/lib/ApiClient.php +++ b/lib/ApiClient.php @@ -54,7 +54,7 @@ final class ApiClient { * * @var string */ - private $userAgent = 'PHP-Client/3.0.0/php'; + private $userAgent = 'PHP-Client/3.0.1/php'; /** * The path to the certificate authority file. @@ -980,6 +980,30 @@ public function getPaymentProcessorService() { return $this->paymentProcessorService; } + protected $paymentTerminalService; + + /** + * @return \PostFinanceCheckout\Sdk\Service\PaymentTerminalService + */ + public function getPaymentTerminalService() { + if(is_null($this->paymentTerminalService)){ + $this->paymentTerminalService = new \PostFinanceCheckout\Sdk\Service\PaymentTerminalService($this); + } + return $this->paymentTerminalService; + } + + protected $paymentTerminalTillService; + + /** + * @return \PostFinanceCheckout\Sdk\Service\PaymentTerminalTillService + */ + public function getPaymentTerminalTillService() { + if(is_null($this->paymentTerminalTillService)){ + $this->paymentTerminalTillService = new \PostFinanceCheckout\Sdk\Service\PaymentTerminalTillService($this); + } + return $this->paymentTerminalTillService; + } + protected $permissionService; /** @@ -1040,6 +1064,78 @@ public function getRefundService() { return $this->refundService; } + protected $shopifyRecurringOrderService; + + /** + * @return \PostFinanceCheckout\Sdk\Service\ShopifyRecurringOrderService + */ + public function getShopifyRecurringOrderService() { + if(is_null($this->shopifyRecurringOrderService)){ + $this->shopifyRecurringOrderService = new \PostFinanceCheckout\Sdk\Service\ShopifyRecurringOrderService($this); + } + return $this->shopifyRecurringOrderService; + } + + protected $shopifySubscriberService; + + /** + * @return \PostFinanceCheckout\Sdk\Service\ShopifySubscriberService + */ + public function getShopifySubscriberService() { + if(is_null($this->shopifySubscriberService)){ + $this->shopifySubscriberService = new \PostFinanceCheckout\Sdk\Service\ShopifySubscriberService($this); + } + return $this->shopifySubscriberService; + } + + protected $shopifySubscriptionProductService; + + /** + * @return \PostFinanceCheckout\Sdk\Service\ShopifySubscriptionProductService + */ + public function getShopifySubscriptionProductService() { + if(is_null($this->shopifySubscriptionProductService)){ + $this->shopifySubscriptionProductService = new \PostFinanceCheckout\Sdk\Service\ShopifySubscriptionProductService($this); + } + return $this->shopifySubscriptionProductService; + } + + protected $shopifySubscriptionService; + + /** + * @return \PostFinanceCheckout\Sdk\Service\ShopifySubscriptionService + */ + public function getShopifySubscriptionService() { + if(is_null($this->shopifySubscriptionService)){ + $this->shopifySubscriptionService = new \PostFinanceCheckout\Sdk\Service\ShopifySubscriptionService($this); + } + return $this->shopifySubscriptionService; + } + + protected $shopifySubscriptionSuspensionService; + + /** + * @return \PostFinanceCheckout\Sdk\Service\ShopifySubscriptionSuspensionService + */ + public function getShopifySubscriptionSuspensionService() { + if(is_null($this->shopifySubscriptionSuspensionService)){ + $this->shopifySubscriptionSuspensionService = new \PostFinanceCheckout\Sdk\Service\ShopifySubscriptionSuspensionService($this); + } + return $this->shopifySubscriptionSuspensionService; + } + + protected $shopifySubscriptionVersionService; + + /** + * @return \PostFinanceCheckout\Sdk\Service\ShopifySubscriptionVersionService + */ + public function getShopifySubscriptionVersionService() { + if(is_null($this->shopifySubscriptionVersionService)){ + $this->shopifySubscriptionVersionService = new \PostFinanceCheckout\Sdk\Service\ShopifySubscriptionVersionService($this); + } + return $this->shopifySubscriptionVersionService; + } + protected $shopifyTransactionService; /** @@ -1208,6 +1304,18 @@ public function getTransactionService() { return $this->transactionService; } + protected $transactionTerminalService; + + /** + * @return \PostFinanceCheckout\Sdk\Service\TransactionTerminalService + */ + public function getTransactionTerminalService() { + if(is_null($this->transactionTerminalService)){ + $this->transactionTerminalService = new \PostFinanceCheckout\Sdk\Service\TransactionTerminalService($this); + } + return $this->transactionTerminalService; + } + protected $transactionVoidService; /** diff --git a/lib/Configuration.php b/lib/Configuration.php index 37a9be7..ae1afdd 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -80,7 +80,7 @@ class Configuration * * @var string */ - protected $userAgent = 'PostFinanceCheckout\Sdk/3.0.0/php'; + protected $userAgent = 'PostFinanceCheckout\Sdk/3.0.1/php'; /** * Debug switch (default set to false) @@ -388,8 +388,8 @@ public static function toDebugReport() $report = 'PHP SDK (PostFinanceCheckout\Sdk) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' OpenAPI Spec Version: 3.0.0' . PHP_EOL; - $report .= ' SDK Package Version: 3.0.0' . PHP_EOL; + $report .= ' OpenAPI Spec Version: 3.0.1' . PHP_EOL; + $report .= ' SDK Package Version: 3.0.1' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/AbstractShopifySubscriptionProductUpdate.php b/lib/Model/AbstractShopifySubscriptionProductUpdate.php new file mode 100644 index 0000000..ac76ce8 --- /dev/null +++ b/lib/Model/AbstractShopifySubscriptionProductUpdate.php @@ -0,0 +1,713 @@ + 'float', + 'billing_day_of_month' => 'int', + 'billing_interval_amount' => 'int', + 'billing_interval_unit' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionBillingIntervalUnit', + 'billing_weekday' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionWeekday', + 'fixed_price' => 'float', + 'maximal_billing_cycles' => 'int', + 'maximal_suspendable_cycles' => 'int', + 'minimal_billing_cycles' => 'int', + 'pricing_option' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductPricingOption', + 'relative_price_adjustment' => 'float', + 'store_order_confirmation_email_enabled' => 'bool', + 'subscriber_suspension_allowed' => 'bool', + 'termination_billing_cycles' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'absolute_price_adjustment' => null, + 'billing_day_of_month' => 'int32', + 'billing_interval_amount' => 'int32', + 'billing_interval_unit' => null, + 'billing_weekday' => null, + 'fixed_price' => null, + 'maximal_billing_cycles' => 'int32', + 'maximal_suspendable_cycles' => 'int32', + 'minimal_billing_cycles' => 'int32', + 'pricing_option' => null, + 'relative_price_adjustment' => null, + 'store_order_confirmation_email_enabled' => null, + 'subscriber_suspension_allowed' => null, + 'termination_billing_cycles' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'absolute_price_adjustment' => 'absolutePriceAdjustment', + 'billing_day_of_month' => 'billingDayOfMonth', + 'billing_interval_amount' => 'billingIntervalAmount', + 'billing_interval_unit' => 'billingIntervalUnit', + 'billing_weekday' => 'billingWeekday', + 'fixed_price' => 'fixedPrice', + 'maximal_billing_cycles' => 'maximalBillingCycles', + 'maximal_suspendable_cycles' => 'maximalSuspendableCycles', + 'minimal_billing_cycles' => 'minimalBillingCycles', + 'pricing_option' => 'pricingOption', + 'relative_price_adjustment' => 'relativePriceAdjustment', + 'store_order_confirmation_email_enabled' => 'storeOrderConfirmationEmailEnabled', + 'subscriber_suspension_allowed' => 'subscriberSuspensionAllowed', + 'termination_billing_cycles' => 'terminationBillingCycles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'absolute_price_adjustment' => 'setAbsolutePriceAdjustment', + 'billing_day_of_month' => 'setBillingDayOfMonth', + 'billing_interval_amount' => 'setBillingIntervalAmount', + 'billing_interval_unit' => 'setBillingIntervalUnit', + 'billing_weekday' => 'setBillingWeekday', + 'fixed_price' => 'setFixedPrice', + 'maximal_billing_cycles' => 'setMaximalBillingCycles', + 'maximal_suspendable_cycles' => 'setMaximalSuspendableCycles', + 'minimal_billing_cycles' => 'setMinimalBillingCycles', + 'pricing_option' => 'setPricingOption', + 'relative_price_adjustment' => 'setRelativePriceAdjustment', + 'store_order_confirmation_email_enabled' => 'setStoreOrderConfirmationEmailEnabled', + 'subscriber_suspension_allowed' => 'setSubscriberSuspensionAllowed', + 'termination_billing_cycles' => 'setTerminationBillingCycles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'absolute_price_adjustment' => 'getAbsolutePriceAdjustment', + 'billing_day_of_month' => 'getBillingDayOfMonth', + 'billing_interval_amount' => 'getBillingIntervalAmount', + 'billing_interval_unit' => 'getBillingIntervalUnit', + 'billing_weekday' => 'getBillingWeekday', + 'fixed_price' => 'getFixedPrice', + 'maximal_billing_cycles' => 'getMaximalBillingCycles', + 'maximal_suspendable_cycles' => 'getMaximalSuspendableCycles', + 'minimal_billing_cycles' => 'getMinimalBillingCycles', + 'pricing_option' => 'getPricingOption', + 'relative_price_adjustment' => 'getRelativePriceAdjustment', + 'store_order_confirmation_email_enabled' => 'getStoreOrderConfirmationEmailEnabled', + 'subscriber_suspension_allowed' => 'getSubscriberSuspensionAllowed', + 'termination_billing_cycles' => 'getTerminationBillingCycles' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['absolute_price_adjustment'] = isset($data['absolute_price_adjustment']) ? $data['absolute_price_adjustment'] : null; + + $this->container['billing_day_of_month'] = isset($data['billing_day_of_month']) ? $data['billing_day_of_month'] : null; + + $this->container['billing_interval_amount'] = isset($data['billing_interval_amount']) ? $data['billing_interval_amount'] : null; + + $this->container['billing_interval_unit'] = isset($data['billing_interval_unit']) ? $data['billing_interval_unit'] : null; + + $this->container['billing_weekday'] = isset($data['billing_weekday']) ? $data['billing_weekday'] : null; + + $this->container['fixed_price'] = isset($data['fixed_price']) ? $data['fixed_price'] : null; + + $this->container['maximal_billing_cycles'] = isset($data['maximal_billing_cycles']) ? $data['maximal_billing_cycles'] : null; + + $this->container['maximal_suspendable_cycles'] = isset($data['maximal_suspendable_cycles']) ? $data['maximal_suspendable_cycles'] : null; + + $this->container['minimal_billing_cycles'] = isset($data['minimal_billing_cycles']) ? $data['minimal_billing_cycles'] : null; + + $this->container['pricing_option'] = isset($data['pricing_option']) ? $data['pricing_option'] : null; + + $this->container['relative_price_adjustment'] = isset($data['relative_price_adjustment']) ? $data['relative_price_adjustment'] : null; + + $this->container['store_order_confirmation_email_enabled'] = isset($data['store_order_confirmation_email_enabled']) ? $data['store_order_confirmation_email_enabled'] : null; + + $this->container['subscriber_suspension_allowed'] = isset($data['subscriber_suspension_allowed']) ? $data['subscriber_suspension_allowed'] : null; + + $this->container['termination_billing_cycles'] = isset($data['termination_billing_cycles']) ? $data['termination_billing_cycles'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets absolute_price_adjustment + * + * @return float + */ + public function getAbsolutePriceAdjustment() + { + return $this->container['absolute_price_adjustment']; + } + + /** + * Sets absolute_price_adjustment + * + * @param float $absolute_price_adjustment + * + * @return $this + */ + public function setAbsolutePriceAdjustment($absolute_price_adjustment) + { + $this->container['absolute_price_adjustment'] = $absolute_price_adjustment; + + return $this; + } + + + /** + * Gets billing_day_of_month + * + * @return int + */ + public function getBillingDayOfMonth() + { + return $this->container['billing_day_of_month']; + } + + /** + * Sets billing_day_of_month + * + * @param int $billing_day_of_month Define the day of the month on which the recurring orders should be created. + * + * @return $this + */ + public function setBillingDayOfMonth($billing_day_of_month) + { + $this->container['billing_day_of_month'] = $billing_day_of_month; + + return $this; + } + + + /** + * Gets billing_interval_amount + * + * @return int + */ + public function getBillingIntervalAmount() + { + return $this->container['billing_interval_amount']; + } + + /** + * Sets billing_interval_amount + * + * @param int $billing_interval_amount + * + * @return $this + */ + public function setBillingIntervalAmount($billing_interval_amount) + { + $this->container['billing_interval_amount'] = $billing_interval_amount; + + return $this; + } + + + /** + * Gets billing_interval_unit + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionBillingIntervalUnit + */ + public function getBillingIntervalUnit() + { + return $this->container['billing_interval_unit']; + } + + /** + * Sets billing_interval_unit + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionBillingIntervalUnit $billing_interval_unit Define how frequently recurring orders should be created. + * + * @return $this + */ + public function setBillingIntervalUnit($billing_interval_unit) + { + $this->container['billing_interval_unit'] = $billing_interval_unit; + + return $this; + } + + + /** + * Gets billing_weekday + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionWeekday + */ + public function getBillingWeekday() + { + return $this->container['billing_weekday']; + } + + /** + * Sets billing_weekday + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionWeekday $billing_weekday Define the weekday on which the recurring orders should be created. + * + * @return $this + */ + public function setBillingWeekday($billing_weekday) + { + $this->container['billing_weekday'] = $billing_weekday; + + return $this; + } + + + /** + * Gets fixed_price + * + * @return float + */ + public function getFixedPrice() + { + return $this->container['fixed_price']; + } + + /** + * Sets fixed_price + * + * @param float $fixed_price + * + * @return $this + */ + public function setFixedPrice($fixed_price) + { + $this->container['fixed_price'] = $fixed_price; + + return $this; + } + + + /** + * Gets maximal_billing_cycles + * + * @return int + */ + public function getMaximalBillingCycles() + { + return $this->container['maximal_billing_cycles']; + } + + /** + * Sets maximal_billing_cycles + * + * @param int $maximal_billing_cycles Define the maximum number of orders the subscription will run for. + * + * @return $this + */ + public function setMaximalBillingCycles($maximal_billing_cycles) + { + $this->container['maximal_billing_cycles'] = $maximal_billing_cycles; + + return $this; + } + + + /** + * Gets maximal_suspendable_cycles + * + * @return int + */ + public function getMaximalSuspendableCycles() + { + return $this->container['maximal_suspendable_cycles']; + } + + /** + * Sets maximal_suspendable_cycles + * + * @param int $maximal_suspendable_cycles Define the maximum number of orders the subscription can be suspended for at a time. + * + * @return $this + */ + public function setMaximalSuspendableCycles($maximal_suspendable_cycles) + { + $this->container['maximal_suspendable_cycles'] = $maximal_suspendable_cycles; + + return $this; + } + + + /** + * Gets minimal_billing_cycles + * + * @return int + */ + public function getMinimalBillingCycles() + { + return $this->container['minimal_billing_cycles']; + } + + /** + * Sets minimal_billing_cycles + * + * @param int $minimal_billing_cycles Define the minimal number of orders the subscription will run for. + * + * @return $this + */ + public function setMinimalBillingCycles($minimal_billing_cycles) + { + $this->container['minimal_billing_cycles'] = $minimal_billing_cycles; + + return $this; + } + + + /** + * Gets pricing_option + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductPricingOption + */ + public function getPricingOption() + { + return $this->container['pricing_option']; + } + + /** + * Sets pricing_option + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductPricingOption $pricing_option + * + * @return $this + */ + public function setPricingOption($pricing_option) + { + $this->container['pricing_option'] = $pricing_option; + + return $this; + } + + + /** + * Gets relative_price_adjustment + * + * @return float + */ + public function getRelativePriceAdjustment() + { + return $this->container['relative_price_adjustment']; + } + + /** + * Sets relative_price_adjustment + * + * @param float $relative_price_adjustment + * + * @return $this + */ + public function setRelativePriceAdjustment($relative_price_adjustment) + { + $this->container['relative_price_adjustment'] = $relative_price_adjustment; + + return $this; + } + + + /** + * Gets store_order_confirmation_email_enabled + * + * @return bool + */ + public function getStoreOrderConfirmationEmailEnabled() + { + return $this->container['store_order_confirmation_email_enabled']; + } + + /** + * Sets store_order_confirmation_email_enabled + * + * @param bool $store_order_confirmation_email_enabled Define whether the order confirmation email of the Shopify shop is sent to the customer for recurring orders. + * + * @return $this + */ + public function setStoreOrderConfirmationEmailEnabled($store_order_confirmation_email_enabled) + { + $this->container['store_order_confirmation_email_enabled'] = $store_order_confirmation_email_enabled; + + return $this; + } + + + /** + * Gets subscriber_suspension_allowed + * + * @return bool + */ + public function getSubscriberSuspensionAllowed() + { + return $this->container['subscriber_suspension_allowed']; + } + + /** + * Sets subscriber_suspension_allowed + * + * @param bool $subscriber_suspension_allowed Define whether the customer is allowed to suspend subscriptions. + * + * @return $this + */ + public function setSubscriberSuspensionAllowed($subscriber_suspension_allowed) + { + $this->container['subscriber_suspension_allowed'] = $subscriber_suspension_allowed; + + return $this; + } + + + /** + * Gets termination_billing_cycles + * + * @return int + */ + public function getTerminationBillingCycles() + { + return $this->container['termination_billing_cycles']; + } + + /** + * Sets termination_billing_cycles + * + * @param int $termination_billing_cycles Define the number of orders the subscription will keep running for after its termination has been requested. + * + * @return $this + */ + public function setTerminationBillingCycles($termination_billing_cycles) + { + $this->container['termination_billing_cycles'] = $termination_billing_cycles; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/AbstractTransactionPending.php b/lib/Model/AbstractTransactionPending.php index 10a872f..78d7f26 100644 --- a/lib/Model/AbstractTransactionPending.php +++ b/lib/Model/AbstractTransactionPending.php @@ -249,8 +249,8 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'customer_email_address', the character length must be smaller than or equal to 254."; } - if (!is_null($this->container['failed_url']) && (mb_strlen($this->container['failed_url']) > 1000)) { - $invalidProperties[] = "invalid value for 'failed_url', the character length must be smaller than or equal to 1000."; + if (!is_null($this->container['failed_url']) && (mb_strlen($this->container['failed_url']) > 2000)) { + $invalidProperties[] = "invalid value for 'failed_url', the character length must be smaller than or equal to 2000."; } if (!is_null($this->container['failed_url']) && (mb_strlen($this->container['failed_url']) < 9)) { @@ -269,8 +269,8 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'shipping_method', the character length must be smaller than or equal to 200."; } - if (!is_null($this->container['success_url']) && (mb_strlen($this->container['success_url']) > 1000)) { - $invalidProperties[] = "invalid value for 'success_url', the character length must be smaller than or equal to 1000."; + if (!is_null($this->container['success_url']) && (mb_strlen($this->container['success_url']) > 2000)) { + $invalidProperties[] = "invalid value for 'success_url', the character length must be smaller than or equal to 2000."; } if (!is_null($this->container['success_url']) && (mb_strlen($this->container['success_url']) < 9)) { @@ -555,8 +555,8 @@ public function getFailedUrl() */ public function setFailedUrl($failed_url) { - if (!is_null($failed_url) && (mb_strlen($failed_url) > 1000)) { - throw new \InvalidArgumentException('invalid length for $failed_url when calling AbstractTransactionPending., must be smaller than or equal to 1000.'); + if (!is_null($failed_url) && (mb_strlen($failed_url) > 2000)) { + throw new \InvalidArgumentException('invalid length for $failed_url when calling AbstractTransactionPending., must be smaller than or equal to 2000.'); } if (!is_null($failed_url) && (mb_strlen($failed_url) < 9)) { throw new \InvalidArgumentException('invalid length for $failed_url when calling AbstractTransactionPending., must be bigger than or equal to 9.'); @@ -774,8 +774,8 @@ public function getSuccessUrl() */ public function setSuccessUrl($success_url) { - if (!is_null($success_url) && (mb_strlen($success_url) > 1000)) { - throw new \InvalidArgumentException('invalid length for $success_url when calling AbstractTransactionPending., must be smaller than or equal to 1000.'); + if (!is_null($success_url) && (mb_strlen($success_url) > 2000)) { + throw new \InvalidArgumentException('invalid length for $success_url when calling AbstractTransactionPending., must be smaller than or equal to 2000.'); } if (!is_null($success_url) && (mb_strlen($success_url) < 9)) { throw new \InvalidArgumentException('invalid length for $success_url when calling AbstractTransactionPending., must be bigger than or equal to 9.'); diff --git a/lib/Model/PaymentContract.php b/lib/Model/PaymentContract.php index f6936b3..4aa9965 100644 --- a/lib/Model/PaymentContract.php +++ b/lib/Model/PaymentContract.php @@ -218,14 +218,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if (!is_null($this->container['external_id']) && (mb_strlen($this->container['external_id']) > 100)) { - $invalidProperties[] = "invalid value for 'external_id', the character length must be smaller than or equal to 100."; - } - - if (!is_null($this->container['external_id']) && (mb_strlen($this->container['external_id']) < 1)) { - $invalidProperties[] = "invalid value for 'external_id', the character length must be bigger than or equal to 1."; - } - return $invalidProperties; } @@ -469,19 +461,12 @@ public function getExternalId() /** * Sets external_id * - * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * @param string $external_id A client generated nonce which identifies the entity to be created. Subsequent creation requests with the same external ID will not create new entities but return the initially created entity instead. * * @return $this */ public function setExternalId($external_id) { - if (!is_null($external_id) && (mb_strlen($external_id) > 100)) { - throw new \InvalidArgumentException('invalid length for $external_id when calling PaymentContract., must be smaller than or equal to 100.'); - } - if (!is_null($external_id) && (mb_strlen($external_id) < 1)) { - throw new \InvalidArgumentException('invalid length for $external_id when calling PaymentContract., must be bigger than or equal to 1.'); - } - $this->container['external_id'] = $external_id; return $this; diff --git a/lib/Model/PaymentLink.php b/lib/Model/PaymentLink.php index a78be1d..d037978 100644 --- a/lib/Model/PaymentLink.php +++ b/lib/Model/PaymentLink.php @@ -246,14 +246,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if (!is_null($this->container['external_id']) && (mb_strlen($this->container['external_id']) > 100)) { - $invalidProperties[] = "invalid value for 'external_id', the character length must be smaller than or equal to 100."; - } - - if (!is_null($this->container['external_id']) && (mb_strlen($this->container['external_id']) < 1)) { - $invalidProperties[] = "invalid value for 'external_id', the character length must be bigger than or equal to 1."; - } - if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 100)) { $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 100."; } @@ -501,19 +493,12 @@ public function getExternalId() /** * Sets external_id * - * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * @param string $external_id A client generated nonce which identifies the entity to be created. Subsequent creation requests with the same external ID will not create new entities but return the initially created entity instead. * * @return $this */ public function setExternalId($external_id) { - if (!is_null($external_id) && (mb_strlen($external_id) > 100)) { - throw new \InvalidArgumentException('invalid length for $external_id when calling PaymentLink., must be smaller than or equal to 100.'); - } - if (!is_null($external_id) && (mb_strlen($external_id) < 1)) { - throw new \InvalidArgumentException('invalid length for $external_id when calling PaymentLink., must be bigger than or equal to 1.'); - } - $this->container['external_id'] = $external_id; return $this; diff --git a/lib/Model/PaymentLinkCreate.php b/lib/Model/PaymentLinkCreate.php index bfc6783..b00796b 100644 --- a/lib/Model/PaymentLinkCreate.php +++ b/lib/Model/PaymentLinkCreate.php @@ -135,14 +135,6 @@ public function listInvalidProperties() if ($this->container['external_id'] === null) { $invalidProperties[] = "'external_id' can't be null"; } - if ((mb_strlen($this->container['external_id']) > 100)) { - $invalidProperties[] = "invalid value for 'external_id', the character length must be smaller than or equal to 100."; - } - - if ((mb_strlen($this->container['external_id']) < 1)) { - $invalidProperties[] = "invalid value for 'external_id', the character length must be bigger than or equal to 1."; - } - return $invalidProperties; } @@ -261,19 +253,12 @@ public function getExternalId() /** * Sets external_id * - * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * @param string $external_id A client generated nonce which identifies the entity to be created. Subsequent creation requests with the same external ID will not create new entities but return the initially created entity instead. * * @return $this */ public function setExternalId($external_id) { - if ((mb_strlen($external_id) > 100)) { - throw new \InvalidArgumentException('invalid length for $external_id when calling PaymentLinkCreate., must be smaller than or equal to 100.'); - } - if ((mb_strlen($external_id) < 1)) { - throw new \InvalidArgumentException('invalid length for $external_id when calling PaymentLinkCreate., must be bigger than or equal to 1.'); - } - $this->container['external_id'] = $external_id; return $this; diff --git a/lib/Model/PaymentTerminal.php b/lib/Model/PaymentTerminal.php index 8b1b980..398922a 100644 --- a/lib/Model/PaymentTerminal.php +++ b/lib/Model/PaymentTerminal.php @@ -51,6 +51,7 @@ class PaymentTerminal implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'configuration_version' => '\PostFinanceCheckout\Sdk\Model\PaymentTerminalConfigurationVersion', 'default_currency' => 'string', + 'external_id' => 'string', 'id' => 'int', 'identifier' => 'string', 'linked_space_id' => 'int', @@ -70,6 +71,7 @@ class PaymentTerminal implements ModelInterface, ArrayAccess protected static $swaggerFormats = [ 'configuration_version' => null, 'default_currency' => null, + 'external_id' => null, 'id' => 'int64', 'identifier' => null, 'linked_space_id' => 'int64', @@ -90,6 +92,7 @@ class PaymentTerminal implements ModelInterface, ArrayAccess protected static $attributeMap = [ 'configuration_version' => 'configurationVersion', 'default_currency' => 'defaultCurrency', + 'external_id' => 'externalId', 'id' => 'id', 'identifier' => 'identifier', 'linked_space_id' => 'linkedSpaceId', @@ -109,6 +112,7 @@ class PaymentTerminal implements ModelInterface, ArrayAccess protected static $setters = [ 'configuration_version' => 'setConfigurationVersion', 'default_currency' => 'setDefaultCurrency', + 'external_id' => 'setExternalId', 'id' => 'setId', 'identifier' => 'setIdentifier', 'linked_space_id' => 'setLinkedSpaceId', @@ -128,6 +132,7 @@ class PaymentTerminal implements ModelInterface, ArrayAccess protected static $getters = [ 'configuration_version' => 'getConfigurationVersion', 'default_currency' => 'getDefaultCurrency', + 'external_id' => 'getExternalId', 'id' => 'getId', 'identifier' => 'getIdentifier', 'linked_space_id' => 'getLinkedSpaceId', @@ -161,6 +166,8 @@ public function __construct(array $data = null) $this->container['default_currency'] = isset($data['default_currency']) ? $data['default_currency'] : null; + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['identifier'] = isset($data['identifier']) ? $data['identifier'] : null; @@ -324,6 +331,31 @@ public function setDefaultCurrency($default_currency) } + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id A client generated nonce which identifies the entity to be created. Subsequent creation requests with the same external ID will not create new entities but return the initially created entity instead. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + /** * Gets id * diff --git a/lib/Model/PaymentTerminalLocation.php b/lib/Model/PaymentTerminalLocation.php index 3d21f55..de368d2 100644 --- a/lib/Model/PaymentTerminalLocation.php +++ b/lib/Model/PaymentTerminalLocation.php @@ -49,8 +49,7 @@ class PaymentTerminalLocation implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'contact_address' => '\PostFinanceCheckout\Sdk\Model\PaymentTerminalAddress', - 'default_configuration' => '\PostFinanceCheckout\Sdk\Model\PaymentTerminalConfiguration', + 'external_id' => 'string', 'id' => 'int', 'linked_space_id' => 'int', 'name' => 'string', @@ -65,8 +64,7 @@ class PaymentTerminalLocation implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'contact_address' => null, - 'default_configuration' => null, + 'external_id' => null, 'id' => 'int64', 'linked_space_id' => 'int64', 'name' => null, @@ -82,8 +80,7 @@ class PaymentTerminalLocation implements ModelInterface, ArrayAccess * @var string[] */ protected static $attributeMap = [ - 'contact_address' => 'contactAddress', - 'default_configuration' => 'defaultConfiguration', + 'external_id' => 'externalId', 'id' => 'id', 'linked_space_id' => 'linkedSpaceId', 'name' => 'name', @@ -98,8 +95,7 @@ class PaymentTerminalLocation implements ModelInterface, ArrayAccess * @var string[] */ protected static $setters = [ - 'contact_address' => 'setContactAddress', - 'default_configuration' => 'setDefaultConfiguration', + 'external_id' => 'setExternalId', 'id' => 'setId', 'linked_space_id' => 'setLinkedSpaceId', 'name' => 'setName', @@ -114,8 +110,7 @@ class PaymentTerminalLocation implements ModelInterface, ArrayAccess * @var string[] */ protected static $getters = [ - 'contact_address' => 'getContactAddress', - 'default_configuration' => 'getDefaultConfiguration', + 'external_id' => 'getExternalId', 'id' => 'getId', 'linked_space_id' => 'getLinkedSpaceId', 'name' => 'getName', @@ -142,9 +137,7 @@ class PaymentTerminalLocation implements ModelInterface, ArrayAccess public function __construct(array $data = null) { - $this->container['contact_address'] = isset($data['contact_address']) ? $data['contact_address'] : null; - - $this->container['default_configuration'] = isset($data['default_configuration']) ? $data['default_configuration'] : null; + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; $this->container['id'] = isset($data['id']) ? $data['id'] : null; @@ -254,50 +247,25 @@ public function valid() /** - * Gets contact_address - * - * @return \PostFinanceCheckout\Sdk\Model\PaymentTerminalAddress - */ - public function getContactAddress() - { - return $this->container['contact_address']; - } - - /** - * Sets contact_address - * - * @param \PostFinanceCheckout\Sdk\Model\PaymentTerminalAddress $contact_address + * Gets external_id * - * @return $this - */ - public function setContactAddress($contact_address) - { - $this->container['contact_address'] = $contact_address; - - return $this; - } - - - /** - * Gets default_configuration - * - * @return \PostFinanceCheckout\Sdk\Model\PaymentTerminalConfiguration + * @return string */ - public function getDefaultConfiguration() + public function getExternalId() { - return $this->container['default_configuration']; + return $this->container['external_id']; } /** - * Sets default_configuration + * Sets external_id * - * @param \PostFinanceCheckout\Sdk\Model\PaymentTerminalConfiguration $default_configuration + * @param string $external_id A client generated nonce which identifies the entity to be created. Subsequent creation requests with the same external ID will not create new entities but return the initially created entity instead. * * @return $this */ - public function setDefaultConfiguration($default_configuration) + public function setExternalId($external_id) { - $this->container['default_configuration'] = $default_configuration; + $this->container['external_id'] = $external_id; return $this; } diff --git a/lib/Model/PaymentTerminalLocationVersion.php b/lib/Model/PaymentTerminalLocationVersion.php index dee5ea6..15b9065 100644 --- a/lib/Model/PaymentTerminalLocationVersion.php +++ b/lib/Model/PaymentTerminalLocationVersion.php @@ -50,6 +50,7 @@ class PaymentTerminalLocationVersion implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'address' => '\PostFinanceCheckout\Sdk\Model\PaymentTerminalAddress', + 'contact_address' => '\PostFinanceCheckout\Sdk\Model\PaymentTerminalAddress', 'created_by' => 'int', 'created_on' => '\DateTime', 'id' => 'int', @@ -68,6 +69,7 @@ class PaymentTerminalLocationVersion implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'address' => null, + 'contact_address' => null, 'created_by' => 'int64', 'created_on' => 'date-time', 'id' => 'int64', @@ -87,6 +89,7 @@ class PaymentTerminalLocationVersion implements ModelInterface, ArrayAccess */ protected static $attributeMap = [ 'address' => 'address', + 'contact_address' => 'contactAddress', 'created_by' => 'createdBy', 'created_on' => 'createdOn', 'id' => 'id', @@ -105,6 +108,7 @@ class PaymentTerminalLocationVersion implements ModelInterface, ArrayAccess */ protected static $setters = [ 'address' => 'setAddress', + 'contact_address' => 'setContactAddress', 'created_by' => 'setCreatedBy', 'created_on' => 'setCreatedOn', 'id' => 'setId', @@ -123,6 +127,7 @@ class PaymentTerminalLocationVersion implements ModelInterface, ArrayAccess */ protected static $getters = [ 'address' => 'getAddress', + 'contact_address' => 'getContactAddress', 'created_by' => 'getCreatedBy', 'created_on' => 'getCreatedOn', 'id' => 'getId', @@ -154,6 +159,8 @@ public function __construct(array $data = null) $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['contact_address'] = isset($data['contact_address']) ? $data['contact_address'] : null; + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; @@ -288,6 +295,31 @@ public function setAddress($address) } + /** + * Gets contact_address + * + * @return \PostFinanceCheckout\Sdk\Model\PaymentTerminalAddress + */ + public function getContactAddress() + { + return $this->container['contact_address']; + } + + /** + * Sets contact_address + * + * @param \PostFinanceCheckout\Sdk\Model\PaymentTerminalAddress $contact_address + * + * @return $this + */ + public function setContactAddress($contact_address) + { + $this->container['contact_address'] = $contact_address; + + return $this; + } + + /** * Gets created_by * diff --git a/lib/Model/PaymentTerminalReceiptType.php b/lib/Model/PaymentTerminalReceiptType.php new file mode 100644 index 0000000..0c37d8f --- /dev/null +++ b/lib/Model/PaymentTerminalReceiptType.php @@ -0,0 +1,362 @@ + 'map[string,string]', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PaymentTerminalState.php b/lib/Model/PaymentTerminalState.php index ca52e99..5650bde 100644 --- a/lib/Model/PaymentTerminalState.php +++ b/lib/Model/PaymentTerminalState.php @@ -35,6 +35,7 @@ class PaymentTerminalState /** * Possible values of this enum */ + const CREATE = 'CREATE'; const PREPARING = 'PREPARING'; const ACTIVE = 'ACTIVE'; const INACTIVE = 'INACTIVE'; @@ -48,6 +49,7 @@ class PaymentTerminalState public static function getAllowableEnumValues() { return [ + self::CREATE, self::PREPARING, self::ACTIVE, self::INACTIVE, diff --git a/lib/Model/RenderedTerminalReceipt.php b/lib/Model/RenderedTerminalReceipt.php new file mode 100644 index 0000000..54a36b7 --- /dev/null +++ b/lib/Model/RenderedTerminalReceipt.php @@ -0,0 +1,396 @@ + 'string', + 'mime_type' => 'string', + 'printed' => 'bool', + 'receipt_type' => '\PostFinanceCheckout\Sdk\Model\PaymentTerminalReceiptType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'data' => 'byte', + 'mime_type' => null, + 'printed' => null, + 'receipt_type' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'mime_type' => 'mimeType', + 'printed' => 'printed', + 'receipt_type' => 'receiptType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'mime_type' => 'setMimeType', + 'printed' => 'setPrinted', + 'receipt_type' => 'setReceiptType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'mime_type' => 'getMimeType', + 'printed' => 'getPrinted', + 'receipt_type' => 'getReceiptType' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + + $this->container['mime_type'] = isset($data['mime_type']) ? $data['mime_type'] : null; + + $this->container['printed'] = isset($data['printed']) ? $data['printed'] : null; + + $this->container['receipt_type'] = isset($data['receipt_type']) ? $data['receipt_type'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets data + * + * @return string + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param string $data data + * + * @return $this + */ + public function setData($data) + { + + + $this->container['data'] = $data; + + return $this; + } + + + /** + * Gets mime_type + * + * @return string + */ + public function getMimeType() + { + return $this->container['mime_type']; + } + + /** + * Sets mime_type + * + * @param string $mime_type The mime type indicates the format of the receipt document. The mime type depends on the requested receipt format. + * + * @return $this + */ + public function setMimeType($mime_type) + { + $this->container['mime_type'] = $mime_type; + + return $this; + } + + + /** + * Gets printed + * + * @return bool + */ + public function getPrinted() + { + return $this->container['printed']; + } + + /** + * Sets printed + * + * @param bool $printed The terminal might or might not print the receipt. This property is set to true when the configuration of the terminal forces the printing and the device supports the receipt printing. + * + * @return $this + */ + public function setPrinted($printed) + { + $this->container['printed'] = $printed; + + return $this; + } + + + /** + * Gets receipt_type + * + * @return \PostFinanceCheckout\Sdk\Model\PaymentTerminalReceiptType + */ + public function getReceiptType() + { + return $this->container['receipt_type']; + } + + /** + * Sets receipt_type + * + * @param \PostFinanceCheckout\Sdk\Model\PaymentTerminalReceiptType $receipt_type Each receipt has a different usage. The receipt type indicates for what resp. for whom the document is for. + * + * @return $this + */ + public function setReceiptType($receipt_type) + { + $this->container['receipt_type'] = $receipt_type; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Role.php b/lib/Model/Role.php index e058aef..b8eee15 100644 --- a/lib/Model/Role.php +++ b/lib/Model/Role.php @@ -54,7 +54,7 @@ class Role implements ModelInterface, ArrayAccess 'name' => '\PostFinanceCheckout\Sdk\Model\DatabaseTranslatedString', 'permissions' => '\PostFinanceCheckout\Sdk\Model\Permission[]', 'planned_purge_date' => '\DateTime', - 'state' => '\PostFinanceCheckout\Sdk\Model\CreationEntityState', + 'state' => '\PostFinanceCheckout\Sdk\Model\RoleState', 'two_factor_required' => 'bool', 'version' => 'int' ]; @@ -377,7 +377,7 @@ public function setPlannedPurgeDate($planned_purge_date) /** * Gets state * - * @return \PostFinanceCheckout\Sdk\Model\CreationEntityState + * @return \PostFinanceCheckout\Sdk\Model\RoleState */ public function getState() { @@ -387,7 +387,7 @@ public function getState() /** * Sets state * - * @param \PostFinanceCheckout\Sdk\Model\CreationEntityState $state + * @param \PostFinanceCheckout\Sdk\Model\RoleState $state * * @return $this */ diff --git a/lib/Model/RoleState.php b/lib/Model/RoleState.php new file mode 100644 index 0000000..06aa197 --- /dev/null +++ b/lib/Model/RoleState.php @@ -0,0 +1,58 @@ + '\DateTime', + 'checkout_token' => 'string', + 'created_on' => '\DateTime', + 'failure_reason' => '\PostFinanceCheckout\Sdk\Model\FailureReason', + 'order_id' => 'string', + 'order_name' => 'string', + 'planned_execution_date' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'recurrence_number' => 'int', + 'shop' => 'int', + 'started_processing_on' => '\DateTime', + 'state' => '\PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrderState', + 'subscription_version' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', + 'transaction' => '\PostFinanceCheckout\Sdk\Model\ShopifyTransaction' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'billed_on' => 'date-time', + 'checkout_token' => null, + 'created_on' => 'date-time', + 'failure_reason' => null, + 'order_id' => null, + 'order_name' => null, + 'planned_execution_date' => 'date-time', + 'planned_purge_date' => 'date-time', + 'recurrence_number' => 'int32', + 'shop' => 'int64', + 'started_processing_on' => 'date-time', + 'state' => null, + 'subscription_version' => null, + 'transaction' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billed_on' => 'billedOn', + 'checkout_token' => 'checkoutToken', + 'created_on' => 'createdOn', + 'failure_reason' => 'failureReason', + 'order_id' => 'orderId', + 'order_name' => 'orderName', + 'planned_execution_date' => 'plannedExecutionDate', + 'planned_purge_date' => 'plannedPurgeDate', + 'recurrence_number' => 'recurrenceNumber', + 'shop' => 'shop', + 'started_processing_on' => 'startedProcessingOn', + 'state' => 'state', + 'subscription_version' => 'subscriptionVersion', + 'transaction' => 'transaction' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billed_on' => 'setBilledOn', + 'checkout_token' => 'setCheckoutToken', + 'created_on' => 'setCreatedOn', + 'failure_reason' => 'setFailureReason', + 'order_id' => 'setOrderId', + 'order_name' => 'setOrderName', + 'planned_execution_date' => 'setPlannedExecutionDate', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'recurrence_number' => 'setRecurrenceNumber', + 'shop' => 'setShop', + 'started_processing_on' => 'setStartedProcessingOn', + 'state' => 'setState', + 'subscription_version' => 'setSubscriptionVersion', + 'transaction' => 'setTransaction' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billed_on' => 'getBilledOn', + 'checkout_token' => 'getCheckoutToken', + 'created_on' => 'getCreatedOn', + 'failure_reason' => 'getFailureReason', + 'order_id' => 'getOrderId', + 'order_name' => 'getOrderName', + 'planned_execution_date' => 'getPlannedExecutionDate', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'recurrence_number' => 'getRecurrenceNumber', + 'shop' => 'getShop', + 'started_processing_on' => 'getStartedProcessingOn', + 'state' => 'getState', + 'subscription_version' => 'getSubscriptionVersion', + 'transaction' => 'getTransaction' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['billed_on'] = isset($data['billed_on']) ? $data['billed_on'] : null; + + $this->container['checkout_token'] = isset($data['checkout_token']) ? $data['checkout_token'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['failure_reason'] = isset($data['failure_reason']) ? $data['failure_reason'] : null; + + $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null; + + $this->container['order_name'] = isset($data['order_name']) ? $data['order_name'] : null; + + $this->container['planned_execution_date'] = isset($data['planned_execution_date']) ? $data['planned_execution_date'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['recurrence_number'] = isset($data['recurrence_number']) ? $data['recurrence_number'] : null; + + $this->container['shop'] = isset($data['shop']) ? $data['shop'] : null; + + $this->container['started_processing_on'] = isset($data['started_processing_on']) ? $data['started_processing_on'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['subscription_version'] = isset($data['subscription_version']) ? $data['subscription_version'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets billed_on + * + * @return \DateTime + */ + public function getBilledOn() + { + return $this->container['billed_on']; + } + + /** + * Sets billed_on + * + * @param \DateTime $billed_on + * + * @return $this + */ + public function setBilledOn($billed_on) + { + $this->container['billed_on'] = $billed_on; + + return $this; + } + + + /** + * Gets checkout_token + * + * @return string + */ + public function getCheckoutToken() + { + return $this->container['checkout_token']; + } + + /** + * Sets checkout_token + * + * @param string $checkout_token + * + * @return $this + */ + public function setCheckoutToken($checkout_token) + { + $this->container['checkout_token'] = $checkout_token; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets failure_reason + * + * @return \PostFinanceCheckout\Sdk\Model\FailureReason + */ + public function getFailureReason() + { + return $this->container['failure_reason']; + } + + /** + * Sets failure_reason + * + * @param \PostFinanceCheckout\Sdk\Model\FailureReason $failure_reason + * + * @return $this + */ + public function setFailureReason($failure_reason) + { + $this->container['failure_reason'] = $failure_reason; + + return $this; + } + + + /** + * Gets order_id + * + * @return string + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param string $order_id + * + * @return $this + */ + public function setOrderId($order_id) + { + $this->container['order_id'] = $order_id; + + return $this; + } + + + /** + * Gets order_name + * + * @return string + */ + public function getOrderName() + { + return $this->container['order_name']; + } + + /** + * Sets order_name + * + * @param string $order_name + * + * @return $this + */ + public function setOrderName($order_name) + { + $this->container['order_name'] = $order_name; + + return $this; + } + + + /** + * Gets planned_execution_date + * + * @return \DateTime + */ + public function getPlannedExecutionDate() + { + return $this->container['planned_execution_date']; + } + + /** + * Sets planned_execution_date + * + * @param \DateTime $planned_execution_date + * + * @return $this + */ + public function setPlannedExecutionDate($planned_execution_date) + { + $this->container['planned_execution_date'] = $planned_execution_date; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets recurrence_number + * + * @return int + */ + public function getRecurrenceNumber() + { + return $this->container['recurrence_number']; + } + + /** + * Sets recurrence_number + * + * @param int $recurrence_number + * + * @return $this + */ + public function setRecurrenceNumber($recurrence_number) + { + $this->container['recurrence_number'] = $recurrence_number; + + return $this; + } + + + /** + * Gets shop + * + * @return int + */ + public function getShop() + { + return $this->container['shop']; + } + + /** + * Sets shop + * + * @param int $shop + * + * @return $this + */ + public function setShop($shop) + { + $this->container['shop'] = $shop; + + return $this; + } + + + /** + * Gets started_processing_on + * + * @return \DateTime + */ + public function getStartedProcessingOn() + { + return $this->container['started_processing_on']; + } + + /** + * Sets started_processing_on + * + * @param \DateTime $started_processing_on + * + * @return $this + */ + public function setStartedProcessingOn($started_processing_on) + { + $this->container['started_processing_on'] = $started_processing_on; + + return $this; + } + + + /** + * Gets state + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrderState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrderState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets subscription_version + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion + */ + public function getSubscriptionVersion() + { + return $this->container['subscription_version']; + } + + /** + * Sets subscription_version + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion $subscription_version + * + * @return $this + */ + public function setSubscriptionVersion($subscription_version) + { + $this->container['subscription_version'] = $subscription_version; + + return $this; + } + + + /** + * Gets transaction + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifyTransaction + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifyTransaction $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifyRecurringOrderState.php b/lib/Model/ShopifyRecurringOrderState.php new file mode 100644 index 0000000..125e0d2 --- /dev/null +++ b/lib/Model/ShopifyRecurringOrderState.php @@ -0,0 +1,62 @@ + '\DateTime', + 'recurring_order_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'execution_date' => 'date-time', + 'recurring_order_id' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'execution_date' => 'executionDate', + 'recurring_order_id' => 'recurringOrderId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'execution_date' => 'setExecutionDate', + 'recurring_order_id' => 'setRecurringOrderId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'execution_date' => 'getExecutionDate', + 'recurring_order_id' => 'getRecurringOrderId' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['execution_date'] = isset($data['execution_date']) ? $data['execution_date'] : null; + + $this->container['recurring_order_id'] = isset($data['recurring_order_id']) ? $data['recurring_order_id'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets execution_date + * + * @return \DateTime + */ + public function getExecutionDate() + { + return $this->container['execution_date']; + } + + /** + * Sets execution_date + * + * @param \DateTime $execution_date + * + * @return $this + */ + public function setExecutionDate($execution_date) + { + $this->container['execution_date'] = $execution_date; + + return $this; + } + + + /** + * Gets recurring_order_id + * + * @return int + */ + public function getRecurringOrderId() + { + return $this->container['recurring_order_id']; + } + + /** + * Sets recurring_order_id + * + * @param int $recurring_order_id + * + * @return $this + */ + public function setRecurringOrderId($recurring_order_id) + { + $this->container['recurring_order_id'] = $recurring_order_id; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriber.php b/lib/Model/ShopifySubscriber.php new file mode 100644 index 0000000..9471a78 --- /dev/null +++ b/lib/Model/ShopifySubscriber.php @@ -0,0 +1,586 @@ + '\DateTime', + 'email_address' => 'string', + 'external_id' => 'string', + 'id' => 'int', + 'linked_space_id' => 'int', + 'phone_number' => 'string', + 'planned_purge_date' => '\DateTime', + 'shop' => 'int', + 'state' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriberState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'email_address' => null, + 'external_id' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'phone_number' => null, + 'planned_purge_date' => 'date-time', + 'shop' => 'int64', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'email_address' => 'emailAddress', + 'external_id' => 'externalId', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'phone_number' => 'phoneNumber', + 'planned_purge_date' => 'plannedPurgeDate', + 'shop' => 'shop', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'email_address' => 'setEmailAddress', + 'external_id' => 'setExternalId', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'phone_number' => 'setPhoneNumber', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'shop' => 'setShop', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'email_address' => 'getEmailAddress', + 'external_id' => 'getExternalId', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'phone_number' => 'getPhoneNumber', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'shop' => 'getShop', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['phone_number'] = isset($data['phone_number']) ? $data['phone_number'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['shop'] = isset($data['shop']) ? $data['shop'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id A client generated nonce which identifies the entity to be created. Subsequent creation requests with the same external ID will not create new entities but return the initially created entity instead. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets phone_number + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string $phone_number + * + * @return $this + */ + public function setPhoneNumber($phone_number) + { + $this->container['phone_number'] = $phone_number; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets shop + * + * @return int + */ + public function getShop() + { + return $this->container['shop']; + } + + /** + * Sets shop + * + * @param int $shop + * + * @return $this + */ + public function setShop($shop) + { + $this->container['shop'] = $shop; + + return $this; + } + + + /** + * Gets state + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriberState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriberState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriberActive.php b/lib/Model/ShopifySubscriberActive.php new file mode 100644 index 0000000..f2a70d8 --- /dev/null +++ b/lib/Model/ShopifySubscriberActive.php @@ -0,0 +1,432 @@ + 'int', + 'version' => 'int', + 'email_address' => 'string', + 'external_id' => 'string', + 'phone_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'email_address' => null, + 'external_id' => null, + 'phone_number' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'email_address' => 'emailAddress', + 'external_id' => 'externalId', + 'phone_number' => 'phoneNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'email_address' => 'setEmailAddress', + 'external_id' => 'setExternalId', + 'phone_number' => 'setPhoneNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'email_address' => 'getEmailAddress', + 'external_id' => 'getExternalId', + 'phone_number' => 'getPhoneNumber' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['phone_number'] = isset($data['phone_number']) ? $data['phone_number'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id A client generated nonce which identifies the entity to be created. Subsequent creation requests with the same external ID will not create new entities but return the initially created entity instead. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets phone_number + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string $phone_number + * + * @return $this + */ + public function setPhoneNumber($phone_number) + { + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriberCreation.php b/lib/Model/ShopifySubscriberCreation.php new file mode 100644 index 0000000..c541412 --- /dev/null +++ b/lib/Model/ShopifySubscriberCreation.php @@ -0,0 +1,365 @@ + 'string', + 'phone_number' => 'string', + 'shopify_customer_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email_address' => null, + 'phone_number' => null, + 'shopify_customer_id' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email_address' => 'emailAddress', + 'phone_number' => 'phoneNumber', + 'shopify_customer_id' => 'shopifyCustomerId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email_address' => 'setEmailAddress', + 'phone_number' => 'setPhoneNumber', + 'shopify_customer_id' => 'setShopifyCustomerId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email_address' => 'getEmailAddress', + 'phone_number' => 'getPhoneNumber', + 'shopify_customer_id' => 'getShopifyCustomerId' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['phone_number'] = isset($data['phone_number']) ? $data['phone_number'] : null; + + $this->container['shopify_customer_id'] = isset($data['shopify_customer_id']) ? $data['shopify_customer_id'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['shopify_customer_id'] === null) { + $invalidProperties[] = "'shopify_customer_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets phone_number + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string $phone_number + * + * @return $this + */ + public function setPhoneNumber($phone_number) + { + $this->container['phone_number'] = $phone_number; + + return $this; + } + + + /** + * Gets shopify_customer_id + * + * @return string + */ + public function getShopifyCustomerId() + { + return $this->container['shopify_customer_id']; + } + + /** + * Sets shopify_customer_id + * + * @param string $shopify_customer_id The customer ID has to correspond to the ID assigned to the customer by Shopify. When the subscriber already exists no new subscriber will be created. + * + * @return $this + */ + public function setShopifyCustomerId($shopify_customer_id) + { + $this->container['shopify_customer_id'] = $shopify_customer_id; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriberState.php b/lib/Model/ShopifySubscriberState.php new file mode 100644 index 0000000..ed4158b --- /dev/null +++ b/lib/Model/ShopifySubscriberState.php @@ -0,0 +1,56 @@ + 'int', + 'created_on' => '\DateTime', + 'external_id' => 'string', + 'id' => 'int', + 'initial_execution_date' => '\DateTime', + 'initial_payment_transaction' => 'int', + 'initial_shopify_transaction' => 'int', + 'language' => 'string', + 'linked_space_id' => 'int', + 'order_recurrence_number' => 'int', + 'shop' => 'int', + 'state' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionState', + 'subscriber' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriber', + 'terminated_by' => 'int', + 'terminated_on' => '\DateTime', + 'termination_request_date' => '\DateTime', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'external_id' => null, + 'id' => 'int64', + 'initial_execution_date' => 'date-time', + 'initial_payment_transaction' => 'int64', + 'initial_shopify_transaction' => 'int64', + 'language' => null, + 'linked_space_id' => 'int64', + 'order_recurrence_number' => 'int32', + 'shop' => 'int64', + 'state' => null, + 'subscriber' => null, + 'terminated_by' => 'int64', + 'terminated_on' => 'date-time', + 'termination_request_date' => 'date-time', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'external_id' => 'externalId', + 'id' => 'id', + 'initial_execution_date' => 'initialExecutionDate', + 'initial_payment_transaction' => 'initialPaymentTransaction', + 'initial_shopify_transaction' => 'initialShopifyTransaction', + 'language' => 'language', + 'linked_space_id' => 'linkedSpaceId', + 'order_recurrence_number' => 'orderRecurrenceNumber', + 'shop' => 'shop', + 'state' => 'state', + 'subscriber' => 'subscriber', + 'terminated_by' => 'terminatedBy', + 'terminated_on' => 'terminatedOn', + 'termination_request_date' => 'terminationRequestDate', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'external_id' => 'setExternalId', + 'id' => 'setId', + 'initial_execution_date' => 'setInitialExecutionDate', + 'initial_payment_transaction' => 'setInitialPaymentTransaction', + 'initial_shopify_transaction' => 'setInitialShopifyTransaction', + 'language' => 'setLanguage', + 'linked_space_id' => 'setLinkedSpaceId', + 'order_recurrence_number' => 'setOrderRecurrenceNumber', + 'shop' => 'setShop', + 'state' => 'setState', + 'subscriber' => 'setSubscriber', + 'terminated_by' => 'setTerminatedBy', + 'terminated_on' => 'setTerminatedOn', + 'termination_request_date' => 'setTerminationRequestDate', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'external_id' => 'getExternalId', + 'id' => 'getId', + 'initial_execution_date' => 'getInitialExecutionDate', + 'initial_payment_transaction' => 'getInitialPaymentTransaction', + 'initial_shopify_transaction' => 'getInitialShopifyTransaction', + 'language' => 'getLanguage', + 'linked_space_id' => 'getLinkedSpaceId', + 'order_recurrence_number' => 'getOrderRecurrenceNumber', + 'shop' => 'getShop', + 'state' => 'getState', + 'subscriber' => 'getSubscriber', + 'terminated_by' => 'getTerminatedBy', + 'terminated_on' => 'getTerminatedOn', + 'termination_request_date' => 'getTerminationRequestDate', + 'version' => 'getVersion' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['initial_execution_date'] = isset($data['initial_execution_date']) ? $data['initial_execution_date'] : null; + + $this->container['initial_payment_transaction'] = isset($data['initial_payment_transaction']) ? $data['initial_payment_transaction'] : null; + + $this->container['initial_shopify_transaction'] = isset($data['initial_shopify_transaction']) ? $data['initial_shopify_transaction'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['order_recurrence_number'] = isset($data['order_recurrence_number']) ? $data['order_recurrence_number'] : null; + + $this->container['shop'] = isset($data['shop']) ? $data['shop'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['subscriber'] = isset($data['subscriber']) ? $data['subscriber'] : null; + + $this->container['terminated_by'] = isset($data['terminated_by']) ? $data['terminated_by'] : null; + + $this->container['terminated_on'] = isset($data['terminated_on']) ? $data['terminated_on'] : null; + + $this->container['termination_request_date'] = isset($data['termination_request_date']) ? $data['termination_request_date'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['external_id']) && (mb_strlen($this->container['external_id']) > 100)) { + $invalidProperties[] = "invalid value for 'external_id', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['external_id']) && (mb_strlen($this->container['external_id']) < 1)) { + $invalidProperties[] = "invalid value for 'external_id', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + if (!is_null($external_id) && (mb_strlen($external_id) > 100)) { + throw new \InvalidArgumentException('invalid length for $external_id when calling ShopifySubscription., must be smaller than or equal to 100.'); + } + if (!is_null($external_id) && (mb_strlen($external_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $external_id when calling ShopifySubscription., must be bigger than or equal to 1.'); + } + + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets initial_execution_date + * + * @return \DateTime + */ + public function getInitialExecutionDate() + { + return $this->container['initial_execution_date']; + } + + /** + * Sets initial_execution_date + * + * @param \DateTime $initial_execution_date + * + * @return $this + */ + public function setInitialExecutionDate($initial_execution_date) + { + $this->container['initial_execution_date'] = $initial_execution_date; + + return $this; + } + + + /** + * Gets initial_payment_transaction + * + * @return int + */ + public function getInitialPaymentTransaction() + { + return $this->container['initial_payment_transaction']; + } + + /** + * Sets initial_payment_transaction + * + * @param int $initial_payment_transaction + * + * @return $this + */ + public function setInitialPaymentTransaction($initial_payment_transaction) + { + $this->container['initial_payment_transaction'] = $initial_payment_transaction; + + return $this; + } + + + /** + * Gets initial_shopify_transaction + * + * @return int + */ + public function getInitialShopifyTransaction() + { + return $this->container['initial_shopify_transaction']; + } + + /** + * Sets initial_shopify_transaction + * + * @param int $initial_shopify_transaction + * + * @return $this + */ + public function setInitialShopifyTransaction($initial_shopify_transaction) + { + $this->container['initial_shopify_transaction'] = $initial_shopify_transaction; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets order_recurrence_number + * + * @return int + */ + public function getOrderRecurrenceNumber() + { + return $this->container['order_recurrence_number']; + } + + /** + * Sets order_recurrence_number + * + * @param int $order_recurrence_number + * + * @return $this + */ + public function setOrderRecurrenceNumber($order_recurrence_number) + { + $this->container['order_recurrence_number'] = $order_recurrence_number; + + return $this; + } + + + /** + * Gets shop + * + * @return int + */ + public function getShop() + { + return $this->container['shop']; + } + + /** + * Sets shop + * + * @param int $shop + * + * @return $this + */ + public function setShop($shop) + { + $this->container['shop'] = $shop; + + return $this; + } + + + /** + * Gets state + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets subscriber + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriber + */ + public function getSubscriber() + { + return $this->container['subscriber']; + } + + /** + * Sets subscriber + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriber $subscriber + * + * @return $this + */ + public function setSubscriber($subscriber) + { + $this->container['subscriber'] = $subscriber; + + return $this; + } + + + /** + * Gets terminated_by + * + * @return int + */ + public function getTerminatedBy() + { + return $this->container['terminated_by']; + } + + /** + * Sets terminated_by + * + * @param int $terminated_by + * + * @return $this + */ + public function setTerminatedBy($terminated_by) + { + $this->container['terminated_by'] = $terminated_by; + + return $this; + } + + + /** + * Gets terminated_on + * + * @return \DateTime + */ + public function getTerminatedOn() + { + return $this->container['terminated_on']; + } + + /** + * Sets terminated_on + * + * @param \DateTime $terminated_on + * + * @return $this + */ + public function setTerminatedOn($terminated_on) + { + $this->container['terminated_on'] = $terminated_on; + + return $this; + } + + + /** + * Gets termination_request_date + * + * @return \DateTime + */ + public function getTerminationRequestDate() + { + return $this->container['termination_request_date']; + } + + /** + * Sets termination_request_date + * + * @param \DateTime $termination_request_date + * + * @return $this + */ + public function setTerminationRequestDate($termination_request_date) + { + $this->container['termination_request_date'] = $termination_request_date; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionAddress.php b/lib/Model/ShopifySubscriptionAddress.php new file mode 100644 index 0000000..91123e8 --- /dev/null +++ b/lib/Model/ShopifySubscriptionAddress.php @@ -0,0 +1,309 @@ +container['commercial_register_number']) && (mb_strlen($this->container['commercial_register_number']) > 100)) { + $invalidProperties[] = "invalid value for 'commercial_register_number', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['dependent_locality']) && (mb_strlen($this->container['dependent_locality']) > 100)) { + $invalidProperties[] = "invalid value for 'dependent_locality', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['email_address']) && (mb_strlen($this->container['email_address']) > 254)) { + $invalidProperties[] = "invalid value for 'email_address', the character length must be smaller than or equal to 254."; + } + + if (!is_null($this->container['given_name']) && (mb_strlen($this->container['given_name']) > 100)) { + $invalidProperties[] = "invalid value for 'given_name', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['mobile_phone_number']) && (mb_strlen($this->container['mobile_phone_number']) > 100)) { + $invalidProperties[] = "invalid value for 'mobile_phone_number', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['organization_name']) && (mb_strlen($this->container['organization_name']) > 100)) { + $invalidProperties[] = "invalid value for 'organization_name', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['phone_number']) && (mb_strlen($this->container['phone_number']) > 100)) { + $invalidProperties[] = "invalid value for 'phone_number', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['sales_tax_number']) && (mb_strlen($this->container['sales_tax_number']) > 100)) { + $invalidProperties[] = "invalid value for 'sales_tax_number', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['salutation']) && (mb_strlen($this->container['salutation']) > 20)) { + $invalidProperties[] = "invalid value for 'salutation', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['social_security_number']) && (mb_strlen($this->container['social_security_number']) > 100)) { + $invalidProperties[] = "invalid value for 'social_security_number', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['sorting_code']) && (mb_strlen($this->container['sorting_code']) > 100)) { + $invalidProperties[] = "invalid value for 'sorting_code', the character length must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionAddressCreate.php b/lib/Model/ShopifySubscriptionAddressCreate.php new file mode 100644 index 0000000..67f5a74 --- /dev/null +++ b/lib/Model/ShopifySubscriptionAddressCreate.php @@ -0,0 +1,994 @@ + 'string', + 'commercial_register_number' => 'string', + 'country' => 'string', + 'date_of_birth' => '\DateTime', + 'dependent_locality' => 'string', + 'email_address' => 'string', + 'family_name' => 'string', + 'gender' => '\PostFinanceCheckout\Sdk\Model\Gender', + 'given_name' => 'string', + 'legal_organization_form' => 'int', + 'mobile_phone_number' => 'string', + 'organization_name' => 'string', + 'phone_number' => 'string', + 'postal_state' => 'string', + 'postcode' => 'string', + 'sales_tax_number' => 'string', + 'salutation' => 'string', + 'social_security_number' => 'string', + 'sorting_code' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'city' => null, + 'commercial_register_number' => null, + 'country' => null, + 'date_of_birth' => 'date', + 'dependent_locality' => null, + 'email_address' => null, + 'family_name' => null, + 'gender' => null, + 'given_name' => null, + 'legal_organization_form' => 'int64', + 'mobile_phone_number' => null, + 'organization_name' => null, + 'phone_number' => null, + 'postal_state' => null, + 'postcode' => null, + 'sales_tax_number' => null, + 'salutation' => null, + 'social_security_number' => null, + 'sorting_code' => null, + 'street' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'commercial_register_number' => 'commercialRegisterNumber', + 'country' => 'country', + 'date_of_birth' => 'dateOfBirth', + 'dependent_locality' => 'dependentLocality', + 'email_address' => 'emailAddress', + 'family_name' => 'familyName', + 'gender' => 'gender', + 'given_name' => 'givenName', + 'legal_organization_form' => 'legalOrganizationForm', + 'mobile_phone_number' => 'mobilePhoneNumber', + 'organization_name' => 'organizationName', + 'phone_number' => 'phoneNumber', + 'postal_state' => 'postalState', + 'postcode' => 'postcode', + 'sales_tax_number' => 'salesTaxNumber', + 'salutation' => 'salutation', + 'social_security_number' => 'socialSecurityNumber', + 'sorting_code' => 'sortingCode', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'commercial_register_number' => 'setCommercialRegisterNumber', + 'country' => 'setCountry', + 'date_of_birth' => 'setDateOfBirth', + 'dependent_locality' => 'setDependentLocality', + 'email_address' => 'setEmailAddress', + 'family_name' => 'setFamilyName', + 'gender' => 'setGender', + 'given_name' => 'setGivenName', + 'legal_organization_form' => 'setLegalOrganizationForm', + 'mobile_phone_number' => 'setMobilePhoneNumber', + 'organization_name' => 'setOrganizationName', + 'phone_number' => 'setPhoneNumber', + 'postal_state' => 'setPostalState', + 'postcode' => 'setPostcode', + 'sales_tax_number' => 'setSalesTaxNumber', + 'salutation' => 'setSalutation', + 'social_security_number' => 'setSocialSecurityNumber', + 'sorting_code' => 'setSortingCode', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'commercial_register_number' => 'getCommercialRegisterNumber', + 'country' => 'getCountry', + 'date_of_birth' => 'getDateOfBirth', + 'dependent_locality' => 'getDependentLocality', + 'email_address' => 'getEmailAddress', + 'family_name' => 'getFamilyName', + 'gender' => 'getGender', + 'given_name' => 'getGivenName', + 'legal_organization_form' => 'getLegalOrganizationForm', + 'mobile_phone_number' => 'getMobilePhoneNumber', + 'organization_name' => 'getOrganizationName', + 'phone_number' => 'getPhoneNumber', + 'postal_state' => 'getPostalState', + 'postcode' => 'getPostcode', + 'sales_tax_number' => 'getSalesTaxNumber', + 'salutation' => 'getSalutation', + 'social_security_number' => 'getSocialSecurityNumber', + 'sorting_code' => 'getSortingCode', + 'street' => 'getStreet' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['city'] = isset($data['city']) ? $data['city'] : null; + + $this->container['commercial_register_number'] = isset($data['commercial_register_number']) ? $data['commercial_register_number'] : null; + + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + + $this->container['date_of_birth'] = isset($data['date_of_birth']) ? $data['date_of_birth'] : null; + + $this->container['dependent_locality'] = isset($data['dependent_locality']) ? $data['dependent_locality'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['family_name'] = isset($data['family_name']) ? $data['family_name'] : null; + + $this->container['gender'] = isset($data['gender']) ? $data['gender'] : null; + + $this->container['given_name'] = isset($data['given_name']) ? $data['given_name'] : null; + + $this->container['legal_organization_form'] = isset($data['legal_organization_form']) ? $data['legal_organization_form'] : null; + + $this->container['mobile_phone_number'] = isset($data['mobile_phone_number']) ? $data['mobile_phone_number'] : null; + + $this->container['organization_name'] = isset($data['organization_name']) ? $data['organization_name'] : null; + + $this->container['phone_number'] = isset($data['phone_number']) ? $data['phone_number'] : null; + + $this->container['postal_state'] = isset($data['postal_state']) ? $data['postal_state'] : null; + + $this->container['postcode'] = isset($data['postcode']) ? $data['postcode'] : null; + + $this->container['sales_tax_number'] = isset($data['sales_tax_number']) ? $data['sales_tax_number'] : null; + + $this->container['salutation'] = isset($data['salutation']) ? $data['salutation'] : null; + + $this->container['social_security_number'] = isset($data['social_security_number']) ? $data['social_security_number'] : null; + + $this->container['sorting_code'] = isset($data['sorting_code']) ? $data['sorting_code'] : null; + + $this->container['street'] = isset($data['street']) ? $data['street'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['commercial_register_number']) && (mb_strlen($this->container['commercial_register_number']) > 100)) { + $invalidProperties[] = "invalid value for 'commercial_register_number', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['dependent_locality']) && (mb_strlen($this->container['dependent_locality']) > 100)) { + $invalidProperties[] = "invalid value for 'dependent_locality', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['email_address']) && (mb_strlen($this->container['email_address']) > 254)) { + $invalidProperties[] = "invalid value for 'email_address', the character length must be smaller than or equal to 254."; + } + + if (!is_null($this->container['given_name']) && (mb_strlen($this->container['given_name']) > 100)) { + $invalidProperties[] = "invalid value for 'given_name', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['mobile_phone_number']) && (mb_strlen($this->container['mobile_phone_number']) > 100)) { + $invalidProperties[] = "invalid value for 'mobile_phone_number', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['organization_name']) && (mb_strlen($this->container['organization_name']) > 100)) { + $invalidProperties[] = "invalid value for 'organization_name', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['phone_number']) && (mb_strlen($this->container['phone_number']) > 100)) { + $invalidProperties[] = "invalid value for 'phone_number', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['sales_tax_number']) && (mb_strlen($this->container['sales_tax_number']) > 100)) { + $invalidProperties[] = "invalid value for 'sales_tax_number', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['salutation']) && (mb_strlen($this->container['salutation']) > 20)) { + $invalidProperties[] = "invalid value for 'salutation', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['social_security_number']) && (mb_strlen($this->container['social_security_number']) > 100)) { + $invalidProperties[] = "invalid value for 'social_security_number', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['sorting_code']) && (mb_strlen($this->container['sorting_code']) > 100)) { + $invalidProperties[] = "invalid value for 'sorting_code', the character length must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city + * + * @return $this + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + + /** + * Gets commercial_register_number + * + * @return string + */ + public function getCommercialRegisterNumber() + { + return $this->container['commercial_register_number']; + } + + /** + * Sets commercial_register_number + * + * @param string $commercial_register_number + * + * @return $this + */ + public function setCommercialRegisterNumber($commercial_register_number) + { + if (!is_null($commercial_register_number) && (mb_strlen($commercial_register_number) > 100)) { + throw new \InvalidArgumentException('invalid length for $commercial_register_number when calling ShopifySubscriptionAddressCreate., must be smaller than or equal to 100.'); + } + + $this->container['commercial_register_number'] = $commercial_register_number; + + return $this; + } + + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + + /** + * Gets date_of_birth + * + * @return \DateTime + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime $date_of_birth + * + * @return $this + */ + public function setDateOfBirth($date_of_birth) + { + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + + /** + * Gets dependent_locality + * + * @return string + */ + public function getDependentLocality() + { + return $this->container['dependent_locality']; + } + + /** + * Sets dependent_locality + * + * @param string $dependent_locality + * + * @return $this + */ + public function setDependentLocality($dependent_locality) + { + if (!is_null($dependent_locality) && (mb_strlen($dependent_locality) > 100)) { + throw new \InvalidArgumentException('invalid length for $dependent_locality when calling ShopifySubscriptionAddressCreate., must be smaller than or equal to 100.'); + } + + $this->container['dependent_locality'] = $dependent_locality; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address + * + * @return $this + */ + public function setEmailAddress($email_address) + { + if (!is_null($email_address) && (mb_strlen($email_address) > 254)) { + throw new \InvalidArgumentException('invalid length for $email_address when calling ShopifySubscriptionAddressCreate., must be smaller than or equal to 254.'); + } + + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets family_name + * + * @return string + */ + public function getFamilyName() + { + return $this->container['family_name']; + } + + /** + * Sets family_name + * + * @param string $family_name + * + * @return $this + */ + public function setFamilyName($family_name) + { + $this->container['family_name'] = $family_name; + + return $this; + } + + + /** + * Gets gender + * + * @return \PostFinanceCheckout\Sdk\Model\Gender + */ + public function getGender() + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param \PostFinanceCheckout\Sdk\Model\Gender $gender + * + * @return $this + */ + public function setGender($gender) + { + $this->container['gender'] = $gender; + + return $this; + } + + + /** + * Gets given_name + * + * @return string + */ + public function getGivenName() + { + return $this->container['given_name']; + } + + /** + * Sets given_name + * + * @param string $given_name + * + * @return $this + */ + public function setGivenName($given_name) + { + if (!is_null($given_name) && (mb_strlen($given_name) > 100)) { + throw new \InvalidArgumentException('invalid length for $given_name when calling ShopifySubscriptionAddressCreate., must be smaller than or equal to 100.'); + } + + $this->container['given_name'] = $given_name; + + return $this; + } + + + /** + * Gets legal_organization_form + * + * @return int + */ + public function getLegalOrganizationForm() + { + return $this->container['legal_organization_form']; + } + + /** + * Sets legal_organization_form + * + * @param int $legal_organization_form + * + * @return $this + */ + public function setLegalOrganizationForm($legal_organization_form) + { + $this->container['legal_organization_form'] = $legal_organization_form; + + return $this; + } + + + /** + * Gets mobile_phone_number + * + * @return string + */ + public function getMobilePhoneNumber() + { + return $this->container['mobile_phone_number']; + } + + /** + * Sets mobile_phone_number + * + * @param string $mobile_phone_number + * + * @return $this + */ + public function setMobilePhoneNumber($mobile_phone_number) + { + if (!is_null($mobile_phone_number) && (mb_strlen($mobile_phone_number) > 100)) { + throw new \InvalidArgumentException('invalid length for $mobile_phone_number when calling ShopifySubscriptionAddressCreate., must be smaller than or equal to 100.'); + } + + $this->container['mobile_phone_number'] = $mobile_phone_number; + + return $this; + } + + + /** + * Gets organization_name + * + * @return string + */ + public function getOrganizationName() + { + return $this->container['organization_name']; + } + + /** + * Sets organization_name + * + * @param string $organization_name + * + * @return $this + */ + public function setOrganizationName($organization_name) + { + if (!is_null($organization_name) && (mb_strlen($organization_name) > 100)) { + throw new \InvalidArgumentException('invalid length for $organization_name when calling ShopifySubscriptionAddressCreate., must be smaller than or equal to 100.'); + } + + $this->container['organization_name'] = $organization_name; + + return $this; + } + + + /** + * Gets phone_number + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string $phone_number + * + * @return $this + */ + public function setPhoneNumber($phone_number) + { + if (!is_null($phone_number) && (mb_strlen($phone_number) > 100)) { + throw new \InvalidArgumentException('invalid length for $phone_number when calling ShopifySubscriptionAddressCreate., must be smaller than or equal to 100.'); + } + + $this->container['phone_number'] = $phone_number; + + return $this; + } + + + /** + * Gets postal_state + * + * @return string + */ + public function getPostalState() + { + return $this->container['postal_state']; + } + + /** + * Sets postal_state + * + * @param string $postal_state + * + * @return $this + */ + public function setPostalState($postal_state) + { + $this->container['postal_state'] = $postal_state; + + return $this; + } + + + /** + * Gets postcode + * + * @return string + */ + public function getPostcode() + { + return $this->container['postcode']; + } + + /** + * Sets postcode + * + * @param string $postcode + * + * @return $this + */ + public function setPostcode($postcode) + { + $this->container['postcode'] = $postcode; + + return $this; + } + + + /** + * Gets sales_tax_number + * + * @return string + */ + public function getSalesTaxNumber() + { + return $this->container['sales_tax_number']; + } + + /** + * Sets sales_tax_number + * + * @param string $sales_tax_number + * + * @return $this + */ + public function setSalesTaxNumber($sales_tax_number) + { + if (!is_null($sales_tax_number) && (mb_strlen($sales_tax_number) > 100)) { + throw new \InvalidArgumentException('invalid length for $sales_tax_number when calling ShopifySubscriptionAddressCreate., must be smaller than or equal to 100.'); + } + + $this->container['sales_tax_number'] = $sales_tax_number; + + return $this; + } + + + /** + * Gets salutation + * + * @return string + */ + public function getSalutation() + { + return $this->container['salutation']; + } + + /** + * Sets salutation + * + * @param string $salutation + * + * @return $this + */ + public function setSalutation($salutation) + { + if (!is_null($salutation) && (mb_strlen($salutation) > 20)) { + throw new \InvalidArgumentException('invalid length for $salutation when calling ShopifySubscriptionAddressCreate., must be smaller than or equal to 20.'); + } + + $this->container['salutation'] = $salutation; + + return $this; + } + + + /** + * Gets social_security_number + * + * @return string + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string $social_security_number + * + * @return $this + */ + public function setSocialSecurityNumber($social_security_number) + { + if (!is_null($social_security_number) && (mb_strlen($social_security_number) > 100)) { + throw new \InvalidArgumentException('invalid length for $social_security_number when calling ShopifySubscriptionAddressCreate., must be smaller than or equal to 100.'); + } + + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + + /** + * Gets sorting_code + * + * @return string + */ + public function getSortingCode() + { + return $this->container['sorting_code']; + } + + /** + * Sets sorting_code + * + * @param string $sorting_code The sorting code identifies the post office at which the post box is located in. + * + * @return $this + */ + public function setSortingCode($sorting_code) + { + if (!is_null($sorting_code) && (mb_strlen($sorting_code) > 100)) { + throw new \InvalidArgumentException('invalid length for $sorting_code when calling ShopifySubscriptionAddressCreate., must be smaller than or equal to 100.'); + } + + $this->container['sorting_code'] = $sorting_code; + + return $this; + } + + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street + * + * @return $this + */ + public function setStreet($street) + { + $this->container['street'] = $street; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionBillingIntervalUnit.php b/lib/Model/ShopifySubscriptionBillingIntervalUnit.php new file mode 100644 index 0000000..295a184 --- /dev/null +++ b/lib/Model/ShopifySubscriptionBillingIntervalUnit.php @@ -0,0 +1,62 @@ + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddressCreate', + 'billing_configuration' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelBillingConfiguration', + 'currency' => 'string', + 'external_id' => 'string', + 'initial_execution_date' => '\DateTime', + 'integration' => 'int', + 'items' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelItem[]', + 'language' => 'string', + 'shipping_address' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddressCreate', + 'shipping_method_name' => 'string', + 'space_view_id' => 'int', + 'store_order_confirmation_email_enabled' => 'bool', + 'subscriber' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriberCreation', + 'subscriber_suspension_allowed' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'billing_address' => null, + 'billing_configuration' => null, + 'currency' => null, + 'external_id' => null, + 'initial_execution_date' => 'date-time', + 'integration' => 'int64', + 'items' => null, + 'language' => null, + 'shipping_address' => null, + 'shipping_method_name' => null, + 'space_view_id' => 'int64', + 'store_order_confirmation_email_enabled' => null, + 'subscriber' => null, + 'subscriber_suspension_allowed' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address' => 'billingAddress', + 'billing_configuration' => 'billingConfiguration', + 'currency' => 'currency', + 'external_id' => 'externalId', + 'initial_execution_date' => 'initialExecutionDate', + 'integration' => 'integration', + 'items' => 'items', + 'language' => 'language', + 'shipping_address' => 'shippingAddress', + 'shipping_method_name' => 'shippingMethodName', + 'space_view_id' => 'spaceViewId', + 'store_order_confirmation_email_enabled' => 'storeOrderConfirmationEmailEnabled', + 'subscriber' => 'subscriber', + 'subscriber_suspension_allowed' => 'subscriberSuspensionAllowed' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address' => 'setBillingAddress', + 'billing_configuration' => 'setBillingConfiguration', + 'currency' => 'setCurrency', + 'external_id' => 'setExternalId', + 'initial_execution_date' => 'setInitialExecutionDate', + 'integration' => 'setIntegration', + 'items' => 'setItems', + 'language' => 'setLanguage', + 'shipping_address' => 'setShippingAddress', + 'shipping_method_name' => 'setShippingMethodName', + 'space_view_id' => 'setSpaceViewId', + 'store_order_confirmation_email_enabled' => 'setStoreOrderConfirmationEmailEnabled', + 'subscriber' => 'setSubscriber', + 'subscriber_suspension_allowed' => 'setSubscriberSuspensionAllowed' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address' => 'getBillingAddress', + 'billing_configuration' => 'getBillingConfiguration', + 'currency' => 'getCurrency', + 'external_id' => 'getExternalId', + 'initial_execution_date' => 'getInitialExecutionDate', + 'integration' => 'getIntegration', + 'items' => 'getItems', + 'language' => 'getLanguage', + 'shipping_address' => 'getShippingAddress', + 'shipping_method_name' => 'getShippingMethodName', + 'space_view_id' => 'getSpaceViewId', + 'store_order_confirmation_email_enabled' => 'getStoreOrderConfirmationEmailEnabled', + 'subscriber' => 'getSubscriber', + 'subscriber_suspension_allowed' => 'getSubscriberSuspensionAllowed' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['billing_configuration'] = isset($data['billing_configuration']) ? $data['billing_configuration'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['initial_execution_date'] = isset($data['initial_execution_date']) ? $data['initial_execution_date'] : null; + + $this->container['integration'] = isset($data['integration']) ? $data['integration'] : null; + + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['shipping_address'] = isset($data['shipping_address']) ? $data['shipping_address'] : null; + + $this->container['shipping_method_name'] = isset($data['shipping_method_name']) ? $data['shipping_method_name'] : null; + + $this->container['space_view_id'] = isset($data['space_view_id']) ? $data['space_view_id'] : null; + + $this->container['store_order_confirmation_email_enabled'] = isset($data['store_order_confirmation_email_enabled']) ? $data['store_order_confirmation_email_enabled'] : null; + + $this->container['subscriber'] = isset($data['subscriber']) ? $data['subscriber'] : null; + + $this->container['subscriber_suspension_allowed'] = isset($data['subscriber_suspension_allowed']) ? $data['subscriber_suspension_allowed'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['billing_address'] === null) { + $invalidProperties[] = "'billing_address' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['external_id'] === null) { + $invalidProperties[] = "'external_id' can't be null"; + } + if ($this->container['integration'] === null) { + $invalidProperties[] = "'integration' can't be null"; + } + if ($this->container['items'] === null) { + $invalidProperties[] = "'items' can't be null"; + } + if ($this->container['language'] === null) { + $invalidProperties[] = "'language' can't be null"; + } + if ($this->container['shipping_address'] === null) { + $invalidProperties[] = "'shipping_address' can't be null"; + } + if ($this->container['subscriber'] === null) { + $invalidProperties[] = "'subscriber' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets billing_address + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddressCreate + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddressCreate $billing_address + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets billing_configuration + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelBillingConfiguration + */ + public function getBillingConfiguration() + { + return $this->container['billing_configuration']; + } + + /** + * Sets billing_configuration + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelBillingConfiguration $billing_configuration + * + * @return $this + */ + public function setBillingConfiguration($billing_configuration) + { + $this->container['billing_configuration'] = $billing_configuration; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id A client generated nonce which identifies the entity to be created. Subsequent creation requests with the same external ID will not create new entities but return the initially created entity instead. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets initial_execution_date + * + * @return \DateTime + */ + public function getInitialExecutionDate() + { + return $this->container['initial_execution_date']; + } + + /** + * Sets initial_execution_date + * + * @param \DateTime $initial_execution_date + * + * @return $this + */ + public function setInitialExecutionDate($initial_execution_date) + { + $this->container['initial_execution_date'] = $initial_execution_date; + + return $this; + } + + + /** + * Gets integration + * + * @return int + */ + public function getIntegration() + { + return $this->container['integration']; + } + + /** + * Sets integration + * + * @param int $integration + * + * @return $this + */ + public function setIntegration($integration) + { + $this->container['integration'] = $integration; + + return $this; + } + + + /** + * Gets items + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelItem[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelItem[] $items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets shipping_address + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddressCreate + */ + public function getShippingAddress() + { + return $this->container['shipping_address']; + } + + /** + * Sets shipping_address + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddressCreate $shipping_address + * + * @return $this + */ + public function setShippingAddress($shipping_address) + { + $this->container['shipping_address'] = $shipping_address; + + return $this; + } + + + /** + * Gets shipping_method_name + * + * @return string + */ + public function getShippingMethodName() + { + return $this->container['shipping_method_name']; + } + + /** + * Sets shipping_method_name + * + * @param string $shipping_method_name + * + * @return $this + */ + public function setShippingMethodName($shipping_method_name) + { + $this->container['shipping_method_name'] = $shipping_method_name; + + return $this; + } + + + /** + * Gets space_view_id + * + * @return int + */ + public function getSpaceViewId() + { + return $this->container['space_view_id']; + } + + /** + * Sets space_view_id + * + * @param int $space_view_id + * + * @return $this + */ + public function setSpaceViewId($space_view_id) + { + $this->container['space_view_id'] = $space_view_id; + + return $this; + } + + + /** + * Gets store_order_confirmation_email_enabled + * + * @return bool + */ + public function getStoreOrderConfirmationEmailEnabled() + { + return $this->container['store_order_confirmation_email_enabled']; + } + + /** + * Sets store_order_confirmation_email_enabled + * + * @param bool $store_order_confirmation_email_enabled + * + * @return $this + */ + public function setStoreOrderConfirmationEmailEnabled($store_order_confirmation_email_enabled) + { + $this->container['store_order_confirmation_email_enabled'] = $store_order_confirmation_email_enabled; + + return $this; + } + + + /** + * Gets subscriber + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriberCreation + */ + public function getSubscriber() + { + return $this->container['subscriber']; + } + + /** + * Sets subscriber + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriberCreation $subscriber + * + * @return $this + */ + public function setSubscriber($subscriber) + { + $this->container['subscriber'] = $subscriber; + + return $this; + } + + + /** + * Gets subscriber_suspension_allowed + * + * @return bool + */ + public function getSubscriberSuspensionAllowed() + { + return $this->container['subscriber_suspension_allowed']; + } + + /** + * Sets subscriber_suspension_allowed + * + * @param bool $subscriber_suspension_allowed + * + * @return $this + */ + public function setSubscriberSuspensionAllowed($subscriber_suspension_allowed) + { + $this->container['subscriber_suspension_allowed'] = $subscriber_suspension_allowed; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionModelBillingConfiguration.php b/lib/Model/ShopifySubscriptionModelBillingConfiguration.php new file mode 100644 index 0000000..3935e1b --- /dev/null +++ b/lib/Model/ShopifySubscriptionModelBillingConfiguration.php @@ -0,0 +1,554 @@ + 'int', + 'billing_interval_amount' => 'int', + 'billing_interval_unit' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionBillingIntervalUnit', + 'billing_reference_date' => '\DateTime', + 'billing_weekday' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionWeekday', + 'maximal_billing_cycles' => 'int', + 'maximal_suspendable_cycles' => 'int', + 'minimal_billing_cycles' => 'int', + 'termination_billing_cycles' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'billing_day_of_month' => 'int32', + 'billing_interval_amount' => 'int32', + 'billing_interval_unit' => null, + 'billing_reference_date' => 'date-time', + 'billing_weekday' => null, + 'maximal_billing_cycles' => 'int32', + 'maximal_suspendable_cycles' => 'int32', + 'minimal_billing_cycles' => 'int32', + 'termination_billing_cycles' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_day_of_month' => 'billingDayOfMonth', + 'billing_interval_amount' => 'billingIntervalAmount', + 'billing_interval_unit' => 'billingIntervalUnit', + 'billing_reference_date' => 'billingReferenceDate', + 'billing_weekday' => 'billingWeekday', + 'maximal_billing_cycles' => 'maximalBillingCycles', + 'maximal_suspendable_cycles' => 'maximalSuspendableCycles', + 'minimal_billing_cycles' => 'minimalBillingCycles', + 'termination_billing_cycles' => 'terminationBillingCycles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_day_of_month' => 'setBillingDayOfMonth', + 'billing_interval_amount' => 'setBillingIntervalAmount', + 'billing_interval_unit' => 'setBillingIntervalUnit', + 'billing_reference_date' => 'setBillingReferenceDate', + 'billing_weekday' => 'setBillingWeekday', + 'maximal_billing_cycles' => 'setMaximalBillingCycles', + 'maximal_suspendable_cycles' => 'setMaximalSuspendableCycles', + 'minimal_billing_cycles' => 'setMinimalBillingCycles', + 'termination_billing_cycles' => 'setTerminationBillingCycles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_day_of_month' => 'getBillingDayOfMonth', + 'billing_interval_amount' => 'getBillingIntervalAmount', + 'billing_interval_unit' => 'getBillingIntervalUnit', + 'billing_reference_date' => 'getBillingReferenceDate', + 'billing_weekday' => 'getBillingWeekday', + 'maximal_billing_cycles' => 'getMaximalBillingCycles', + 'maximal_suspendable_cycles' => 'getMaximalSuspendableCycles', + 'minimal_billing_cycles' => 'getMinimalBillingCycles', + 'termination_billing_cycles' => 'getTerminationBillingCycles' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['billing_day_of_month'] = isset($data['billing_day_of_month']) ? $data['billing_day_of_month'] : null; + + $this->container['billing_interval_amount'] = isset($data['billing_interval_amount']) ? $data['billing_interval_amount'] : null; + + $this->container['billing_interval_unit'] = isset($data['billing_interval_unit']) ? $data['billing_interval_unit'] : null; + + $this->container['billing_reference_date'] = isset($data['billing_reference_date']) ? $data['billing_reference_date'] : null; + + $this->container['billing_weekday'] = isset($data['billing_weekday']) ? $data['billing_weekday'] : null; + + $this->container['maximal_billing_cycles'] = isset($data['maximal_billing_cycles']) ? $data['maximal_billing_cycles'] : null; + + $this->container['maximal_suspendable_cycles'] = isset($data['maximal_suspendable_cycles']) ? $data['maximal_suspendable_cycles'] : null; + + $this->container['minimal_billing_cycles'] = isset($data['minimal_billing_cycles']) ? $data['minimal_billing_cycles'] : null; + + $this->container['termination_billing_cycles'] = isset($data['termination_billing_cycles']) ? $data['termination_billing_cycles'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets billing_day_of_month + * + * @return int + */ + public function getBillingDayOfMonth() + { + return $this->container['billing_day_of_month']; + } + + /** + * Sets billing_day_of_month + * + * @param int $billing_day_of_month Define the day of the month on which the recurring orders should be created. + * + * @return $this + */ + public function setBillingDayOfMonth($billing_day_of_month) + { + $this->container['billing_day_of_month'] = $billing_day_of_month; + + return $this; + } + + + /** + * Gets billing_interval_amount + * + * @return int + */ + public function getBillingIntervalAmount() + { + return $this->container['billing_interval_amount']; + } + + /** + * Sets billing_interval_amount + * + * @param int $billing_interval_amount + * + * @return $this + */ + public function setBillingIntervalAmount($billing_interval_amount) + { + $this->container['billing_interval_amount'] = $billing_interval_amount; + + return $this; + } + + + /** + * Gets billing_interval_unit + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionBillingIntervalUnit + */ + public function getBillingIntervalUnit() + { + return $this->container['billing_interval_unit']; + } + + /** + * Sets billing_interval_unit + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionBillingIntervalUnit $billing_interval_unit Define how frequently recurring orders should be created. + * + * @return $this + */ + public function setBillingIntervalUnit($billing_interval_unit) + { + $this->container['billing_interval_unit'] = $billing_interval_unit; + + return $this; + } + + + /** + * Gets billing_reference_date + * + * @return \DateTime + */ + public function getBillingReferenceDate() + { + return $this->container['billing_reference_date']; + } + + /** + * Sets billing_reference_date + * + * @param \DateTime $billing_reference_date This date will be used as basis to calculate the dates of recurring orders. + * + * @return $this + */ + public function setBillingReferenceDate($billing_reference_date) + { + $this->container['billing_reference_date'] = $billing_reference_date; + + return $this; + } + + + /** + * Gets billing_weekday + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionWeekday + */ + public function getBillingWeekday() + { + return $this->container['billing_weekday']; + } + + /** + * Sets billing_weekday + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionWeekday $billing_weekday Define the weekday on which the recurring orders should be created. + * + * @return $this + */ + public function setBillingWeekday($billing_weekday) + { + $this->container['billing_weekday'] = $billing_weekday; + + return $this; + } + + + /** + * Gets maximal_billing_cycles + * + * @return int + */ + public function getMaximalBillingCycles() + { + return $this->container['maximal_billing_cycles']; + } + + /** + * Sets maximal_billing_cycles + * + * @param int $maximal_billing_cycles Define the maximum number of orders the subscription will run for. + * + * @return $this + */ + public function setMaximalBillingCycles($maximal_billing_cycles) + { + $this->container['maximal_billing_cycles'] = $maximal_billing_cycles; + + return $this; + } + + + /** + * Gets maximal_suspendable_cycles + * + * @return int + */ + public function getMaximalSuspendableCycles() + { + return $this->container['maximal_suspendable_cycles']; + } + + /** + * Sets maximal_suspendable_cycles + * + * @param int $maximal_suspendable_cycles Define the maximum number of orders the subscription can be suspended for at a time. + * + * @return $this + */ + public function setMaximalSuspendableCycles($maximal_suspendable_cycles) + { + $this->container['maximal_suspendable_cycles'] = $maximal_suspendable_cycles; + + return $this; + } + + + /** + * Gets minimal_billing_cycles + * + * @return int + */ + public function getMinimalBillingCycles() + { + return $this->container['minimal_billing_cycles']; + } + + /** + * Sets minimal_billing_cycles + * + * @param int $minimal_billing_cycles Define the minimal number of orders the subscription will run for. + * + * @return $this + */ + public function setMinimalBillingCycles($minimal_billing_cycles) + { + $this->container['minimal_billing_cycles'] = $minimal_billing_cycles; + + return $this; + } + + + /** + * Gets termination_billing_cycles + * + * @return int + */ + public function getTerminationBillingCycles() + { + return $this->container['termination_billing_cycles']; + } + + /** + * Sets termination_billing_cycles + * + * @param int $termination_billing_cycles Define the number of orders the subscription will keep running for after its termination has been requested. + * + * @return $this + */ + public function setTerminationBillingCycles($termination_billing_cycles) + { + $this->container['termination_billing_cycles'] = $termination_billing_cycles; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionModelItem.php b/lib/Model/ShopifySubscriptionModelItem.php new file mode 100644 index 0000000..5d5e6a7 --- /dev/null +++ b/lib/Model/ShopifySubscriptionModelItem.php @@ -0,0 +1,426 @@ + 'float', + 'product_id' => 'int', + 'quantity' => 'float', + 'recalculate_price' => 'bool', + 'tax_lines' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelTaxLine[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'price_including_tax' => null, + 'product_id' => 'int64', + 'quantity' => null, + 'recalculate_price' => null, + 'tax_lines' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'price_including_tax' => 'priceIncludingTax', + 'product_id' => 'productId', + 'quantity' => 'quantity', + 'recalculate_price' => 'recalculatePrice', + 'tax_lines' => 'taxLines' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'price_including_tax' => 'setPriceIncludingTax', + 'product_id' => 'setProductId', + 'quantity' => 'setQuantity', + 'recalculate_price' => 'setRecalculatePrice', + 'tax_lines' => 'setTaxLines' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'price_including_tax' => 'getPriceIncludingTax', + 'product_id' => 'getProductId', + 'quantity' => 'getQuantity', + 'recalculate_price' => 'getRecalculatePrice', + 'tax_lines' => 'getTaxLines' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['price_including_tax'] = isset($data['price_including_tax']) ? $data['price_including_tax'] : null; + + $this->container['product_id'] = isset($data['product_id']) ? $data['product_id'] : null; + + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + + $this->container['recalculate_price'] = isset($data['recalculate_price']) ? $data['recalculate_price'] : null; + + $this->container['tax_lines'] = isset($data['tax_lines']) ? $data['tax_lines'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets price_including_tax + * + * @return float + */ + public function getPriceIncludingTax() + { + return $this->container['price_including_tax']; + } + + /** + * Sets price_including_tax + * + * @param float $price_including_tax + * + * @return $this + */ + public function setPriceIncludingTax($price_including_tax) + { + $this->container['price_including_tax'] = $price_including_tax; + + return $this; + } + + + /** + * Gets product_id + * + * @return int + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int $product_id + * + * @return $this + */ + public function setProductId($product_id) + { + $this->container['product_id'] = $product_id; + + return $this; + } + + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + + /** + * Gets recalculate_price + * + * @return bool + */ + public function getRecalculatePrice() + { + return $this->container['recalculate_price']; + } + + /** + * Sets recalculate_price + * + * @param bool $recalculate_price + * + * @return $this + */ + public function setRecalculatePrice($recalculate_price) + { + $this->container['recalculate_price'] = $recalculate_price; + + return $this; + } + + + /** + * Gets tax_lines + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelTaxLine[] + */ + public function getTaxLines() + { + return $this->container['tax_lines']; + } + + /** + * Sets tax_lines + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelTaxLine[] $tax_lines + * + * @return $this + */ + public function setTaxLines($tax_lines) + { + $this->container['tax_lines'] = $tax_lines; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionModelTaxLine.php b/lib/Model/ShopifySubscriptionModelTaxLine.php new file mode 100644 index 0000000..9d0b16b --- /dev/null +++ b/lib/Model/ShopifySubscriptionModelTaxLine.php @@ -0,0 +1,330 @@ + 'float', + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'rate' => null, + 'title' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rate' => 'rate', + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'title' => 'getTitle' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['rate'] = isset($data['rate']) ? $data['rate'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float $rate + * + * @return $this + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionProduct.php b/lib/Model/ShopifySubscriptionProduct.php new file mode 100644 index 0000000..04a1f01 --- /dev/null +++ b/lib/Model/ShopifySubscriptionProduct.php @@ -0,0 +1,1194 @@ + 'float', + 'billing_day_of_month' => 'int', + 'billing_interval_amount' => 'int', + 'billing_interval_unit' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionBillingIntervalUnit', + 'billing_weekday' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionWeekday', + 'fixed_price' => 'float', + 'id' => 'int', + 'linked_space_id' => 'int', + 'maximal_billing_cycles' => 'int', + 'maximal_suspendable_cycles' => 'int', + 'minimal_billing_cycles' => 'int', + 'planned_purge_date' => '\DateTime', + 'pricing_option' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductPricingOption', + 'product_id' => 'string', + 'product_name' => 'string', + 'product_price' => 'float', + 'product_sku' => 'string', + 'product_variant_id' => 'string', + 'product_variant_name' => 'string', + 'relative_price_adjustment' => 'float', + 'shipping_required' => 'bool', + 'shop' => 'int', + 'state' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductState', + 'stock_check_required' => 'bool', + 'store_order_confirmation_email_enabled' => 'bool', + 'subscriber_suspension_allowed' => 'bool', + 'termination_billing_cycles' => 'int', + 'updated_at' => '\DateTime', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'absolute_price_adjustment' => null, + 'billing_day_of_month' => 'int32', + 'billing_interval_amount' => 'int32', + 'billing_interval_unit' => null, + 'billing_weekday' => null, + 'fixed_price' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'maximal_billing_cycles' => 'int32', + 'maximal_suspendable_cycles' => 'int32', + 'minimal_billing_cycles' => 'int32', + 'planned_purge_date' => 'date-time', + 'pricing_option' => null, + 'product_id' => null, + 'product_name' => null, + 'product_price' => null, + 'product_sku' => null, + 'product_variant_id' => null, + 'product_variant_name' => null, + 'relative_price_adjustment' => null, + 'shipping_required' => null, + 'shop' => 'int64', + 'state' => null, + 'stock_check_required' => null, + 'store_order_confirmation_email_enabled' => null, + 'subscriber_suspension_allowed' => null, + 'termination_billing_cycles' => 'int32', + 'updated_at' => 'date-time', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'absolute_price_adjustment' => 'absolutePriceAdjustment', + 'billing_day_of_month' => 'billingDayOfMonth', + 'billing_interval_amount' => 'billingIntervalAmount', + 'billing_interval_unit' => 'billingIntervalUnit', + 'billing_weekday' => 'billingWeekday', + 'fixed_price' => 'fixedPrice', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'maximal_billing_cycles' => 'maximalBillingCycles', + 'maximal_suspendable_cycles' => 'maximalSuspendableCycles', + 'minimal_billing_cycles' => 'minimalBillingCycles', + 'planned_purge_date' => 'plannedPurgeDate', + 'pricing_option' => 'pricingOption', + 'product_id' => 'productId', + 'product_name' => 'productName', + 'product_price' => 'productPrice', + 'product_sku' => 'productSku', + 'product_variant_id' => 'productVariantId', + 'product_variant_name' => 'productVariantName', + 'relative_price_adjustment' => 'relativePriceAdjustment', + 'shipping_required' => 'shippingRequired', + 'shop' => 'shop', + 'state' => 'state', + 'stock_check_required' => 'stockCheckRequired', + 'store_order_confirmation_email_enabled' => 'storeOrderConfirmationEmailEnabled', + 'subscriber_suspension_allowed' => 'subscriberSuspensionAllowed', + 'termination_billing_cycles' => 'terminationBillingCycles', + 'updated_at' => 'updatedAt', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'absolute_price_adjustment' => 'setAbsolutePriceAdjustment', + 'billing_day_of_month' => 'setBillingDayOfMonth', + 'billing_interval_amount' => 'setBillingIntervalAmount', + 'billing_interval_unit' => 'setBillingIntervalUnit', + 'billing_weekday' => 'setBillingWeekday', + 'fixed_price' => 'setFixedPrice', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'maximal_billing_cycles' => 'setMaximalBillingCycles', + 'maximal_suspendable_cycles' => 'setMaximalSuspendableCycles', + 'minimal_billing_cycles' => 'setMinimalBillingCycles', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'pricing_option' => 'setPricingOption', + 'product_id' => 'setProductId', + 'product_name' => 'setProductName', + 'product_price' => 'setProductPrice', + 'product_sku' => 'setProductSku', + 'product_variant_id' => 'setProductVariantId', + 'product_variant_name' => 'setProductVariantName', + 'relative_price_adjustment' => 'setRelativePriceAdjustment', + 'shipping_required' => 'setShippingRequired', + 'shop' => 'setShop', + 'state' => 'setState', + 'stock_check_required' => 'setStockCheckRequired', + 'store_order_confirmation_email_enabled' => 'setStoreOrderConfirmationEmailEnabled', + 'subscriber_suspension_allowed' => 'setSubscriberSuspensionAllowed', + 'termination_billing_cycles' => 'setTerminationBillingCycles', + 'updated_at' => 'setUpdatedAt', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'absolute_price_adjustment' => 'getAbsolutePriceAdjustment', + 'billing_day_of_month' => 'getBillingDayOfMonth', + 'billing_interval_amount' => 'getBillingIntervalAmount', + 'billing_interval_unit' => 'getBillingIntervalUnit', + 'billing_weekday' => 'getBillingWeekday', + 'fixed_price' => 'getFixedPrice', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'maximal_billing_cycles' => 'getMaximalBillingCycles', + 'maximal_suspendable_cycles' => 'getMaximalSuspendableCycles', + 'minimal_billing_cycles' => 'getMinimalBillingCycles', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'pricing_option' => 'getPricingOption', + 'product_id' => 'getProductId', + 'product_name' => 'getProductName', + 'product_price' => 'getProductPrice', + 'product_sku' => 'getProductSku', + 'product_variant_id' => 'getProductVariantId', + 'product_variant_name' => 'getProductVariantName', + 'relative_price_adjustment' => 'getRelativePriceAdjustment', + 'shipping_required' => 'getShippingRequired', + 'shop' => 'getShop', + 'state' => 'getState', + 'stock_check_required' => 'getStockCheckRequired', + 'store_order_confirmation_email_enabled' => 'getStoreOrderConfirmationEmailEnabled', + 'subscriber_suspension_allowed' => 'getSubscriberSuspensionAllowed', + 'termination_billing_cycles' => 'getTerminationBillingCycles', + 'updated_at' => 'getUpdatedAt', + 'version' => 'getVersion' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['absolute_price_adjustment'] = isset($data['absolute_price_adjustment']) ? $data['absolute_price_adjustment'] : null; + + $this->container['billing_day_of_month'] = isset($data['billing_day_of_month']) ? $data['billing_day_of_month'] : null; + + $this->container['billing_interval_amount'] = isset($data['billing_interval_amount']) ? $data['billing_interval_amount'] : null; + + $this->container['billing_interval_unit'] = isset($data['billing_interval_unit']) ? $data['billing_interval_unit'] : null; + + $this->container['billing_weekday'] = isset($data['billing_weekday']) ? $data['billing_weekday'] : null; + + $this->container['fixed_price'] = isset($data['fixed_price']) ? $data['fixed_price'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['maximal_billing_cycles'] = isset($data['maximal_billing_cycles']) ? $data['maximal_billing_cycles'] : null; + + $this->container['maximal_suspendable_cycles'] = isset($data['maximal_suspendable_cycles']) ? $data['maximal_suspendable_cycles'] : null; + + $this->container['minimal_billing_cycles'] = isset($data['minimal_billing_cycles']) ? $data['minimal_billing_cycles'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['pricing_option'] = isset($data['pricing_option']) ? $data['pricing_option'] : null; + + $this->container['product_id'] = isset($data['product_id']) ? $data['product_id'] : null; + + $this->container['product_name'] = isset($data['product_name']) ? $data['product_name'] : null; + + $this->container['product_price'] = isset($data['product_price']) ? $data['product_price'] : null; + + $this->container['product_sku'] = isset($data['product_sku']) ? $data['product_sku'] : null; + + $this->container['product_variant_id'] = isset($data['product_variant_id']) ? $data['product_variant_id'] : null; + + $this->container['product_variant_name'] = isset($data['product_variant_name']) ? $data['product_variant_name'] : null; + + $this->container['relative_price_adjustment'] = isset($data['relative_price_adjustment']) ? $data['relative_price_adjustment'] : null; + + $this->container['shipping_required'] = isset($data['shipping_required']) ? $data['shipping_required'] : null; + + $this->container['shop'] = isset($data['shop']) ? $data['shop'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['stock_check_required'] = isset($data['stock_check_required']) ? $data['stock_check_required'] : null; + + $this->container['store_order_confirmation_email_enabled'] = isset($data['store_order_confirmation_email_enabled']) ? $data['store_order_confirmation_email_enabled'] : null; + + $this->container['subscriber_suspension_allowed'] = isset($data['subscriber_suspension_allowed']) ? $data['subscriber_suspension_allowed'] : null; + + $this->container['termination_billing_cycles'] = isset($data['termination_billing_cycles']) ? $data['termination_billing_cycles'] : null; + + $this->container['updated_at'] = isset($data['updated_at']) ? $data['updated_at'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets absolute_price_adjustment + * + * @return float + */ + public function getAbsolutePriceAdjustment() + { + return $this->container['absolute_price_adjustment']; + } + + /** + * Sets absolute_price_adjustment + * + * @param float $absolute_price_adjustment + * + * @return $this + */ + public function setAbsolutePriceAdjustment($absolute_price_adjustment) + { + $this->container['absolute_price_adjustment'] = $absolute_price_adjustment; + + return $this; + } + + + /** + * Gets billing_day_of_month + * + * @return int + */ + public function getBillingDayOfMonth() + { + return $this->container['billing_day_of_month']; + } + + /** + * Sets billing_day_of_month + * + * @param int $billing_day_of_month Define the day of the month on which the recurring orders should be created. + * + * @return $this + */ + public function setBillingDayOfMonth($billing_day_of_month) + { + $this->container['billing_day_of_month'] = $billing_day_of_month; + + return $this; + } + + + /** + * Gets billing_interval_amount + * + * @return int + */ + public function getBillingIntervalAmount() + { + return $this->container['billing_interval_amount']; + } + + /** + * Sets billing_interval_amount + * + * @param int $billing_interval_amount + * + * @return $this + */ + public function setBillingIntervalAmount($billing_interval_amount) + { + $this->container['billing_interval_amount'] = $billing_interval_amount; + + return $this; + } + + + /** + * Gets billing_interval_unit + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionBillingIntervalUnit + */ + public function getBillingIntervalUnit() + { + return $this->container['billing_interval_unit']; + } + + /** + * Sets billing_interval_unit + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionBillingIntervalUnit $billing_interval_unit Define how frequently recurring orders should be created. + * + * @return $this + */ + public function setBillingIntervalUnit($billing_interval_unit) + { + $this->container['billing_interval_unit'] = $billing_interval_unit; + + return $this; + } + + + /** + * Gets billing_weekday + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionWeekday + */ + public function getBillingWeekday() + { + return $this->container['billing_weekday']; + } + + /** + * Sets billing_weekday + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionWeekday $billing_weekday Define the weekday on which the recurring orders should be created. + * + * @return $this + */ + public function setBillingWeekday($billing_weekday) + { + $this->container['billing_weekday'] = $billing_weekday; + + return $this; + } + + + /** + * Gets fixed_price + * + * @return float + */ + public function getFixedPrice() + { + return $this->container['fixed_price']; + } + + /** + * Sets fixed_price + * + * @param float $fixed_price + * + * @return $this + */ + public function setFixedPrice($fixed_price) + { + $this->container['fixed_price'] = $fixed_price; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets maximal_billing_cycles + * + * @return int + */ + public function getMaximalBillingCycles() + { + return $this->container['maximal_billing_cycles']; + } + + /** + * Sets maximal_billing_cycles + * + * @param int $maximal_billing_cycles Define the maximum number of orders the subscription will run for. + * + * @return $this + */ + public function setMaximalBillingCycles($maximal_billing_cycles) + { + $this->container['maximal_billing_cycles'] = $maximal_billing_cycles; + + return $this; + } + + + /** + * Gets maximal_suspendable_cycles + * + * @return int + */ + public function getMaximalSuspendableCycles() + { + return $this->container['maximal_suspendable_cycles']; + } + + /** + * Sets maximal_suspendable_cycles + * + * @param int $maximal_suspendable_cycles Define the maximum number of orders the subscription can be suspended for at a time. + * + * @return $this + */ + public function setMaximalSuspendableCycles($maximal_suspendable_cycles) + { + $this->container['maximal_suspendable_cycles'] = $maximal_suspendable_cycles; + + return $this; + } + + + /** + * Gets minimal_billing_cycles + * + * @return int + */ + public function getMinimalBillingCycles() + { + return $this->container['minimal_billing_cycles']; + } + + /** + * Sets minimal_billing_cycles + * + * @param int $minimal_billing_cycles Define the minimal number of orders the subscription will run for. + * + * @return $this + */ + public function setMinimalBillingCycles($minimal_billing_cycles) + { + $this->container['minimal_billing_cycles'] = $minimal_billing_cycles; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets pricing_option + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductPricingOption + */ + public function getPricingOption() + { + return $this->container['pricing_option']; + } + + /** + * Sets pricing_option + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductPricingOption $pricing_option + * + * @return $this + */ + public function setPricingOption($pricing_option) + { + $this->container['pricing_option'] = $pricing_option; + + return $this; + } + + + /** + * Gets product_id + * + * @return string + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param string $product_id The ID of the Shopify product that is enabled to be ordered as subscription. + * + * @return $this + */ + public function setProductId($product_id) + { + $this->container['product_id'] = $product_id; + + return $this; + } + + + /** + * Gets product_name + * + * @return string + */ + public function getProductName() + { + return $this->container['product_name']; + } + + /** + * Sets product_name + * + * @param string $product_name + * + * @return $this + */ + public function setProductName($product_name) + { + $this->container['product_name'] = $product_name; + + return $this; + } + + + /** + * Gets product_price + * + * @return float + */ + public function getProductPrice() + { + return $this->container['product_price']; + } + + /** + * Sets product_price + * + * @param float $product_price + * + * @return $this + */ + public function setProductPrice($product_price) + { + $this->container['product_price'] = $product_price; + + return $this; + } + + + /** + * Gets product_sku + * + * @return string + */ + public function getProductSku() + { + return $this->container['product_sku']; + } + + /** + * Sets product_sku + * + * @param string $product_sku + * + * @return $this + */ + public function setProductSku($product_sku) + { + $this->container['product_sku'] = $product_sku; + + return $this; + } + + + /** + * Gets product_variant_id + * + * @return string + */ + public function getProductVariantId() + { + return $this->container['product_variant_id']; + } + + /** + * Sets product_variant_id + * + * @param string $product_variant_id + * + * @return $this + */ + public function setProductVariantId($product_variant_id) + { + $this->container['product_variant_id'] = $product_variant_id; + + return $this; + } + + + /** + * Gets product_variant_name + * + * @return string + */ + public function getProductVariantName() + { + return $this->container['product_variant_name']; + } + + /** + * Sets product_variant_name + * + * @param string $product_variant_name + * + * @return $this + */ + public function setProductVariantName($product_variant_name) + { + $this->container['product_variant_name'] = $product_variant_name; + + return $this; + } + + + /** + * Gets relative_price_adjustment + * + * @return float + */ + public function getRelativePriceAdjustment() + { + return $this->container['relative_price_adjustment']; + } + + /** + * Sets relative_price_adjustment + * + * @param float $relative_price_adjustment + * + * @return $this + */ + public function setRelativePriceAdjustment($relative_price_adjustment) + { + $this->container['relative_price_adjustment'] = $relative_price_adjustment; + + return $this; + } + + + /** + * Gets shipping_required + * + * @return bool + */ + public function getShippingRequired() + { + return $this->container['shipping_required']; + } + + /** + * Sets shipping_required + * + * @param bool $shipping_required + * + * @return $this + */ + public function setShippingRequired($shipping_required) + { + $this->container['shipping_required'] = $shipping_required; + + return $this; + } + + + /** + * Gets shop + * + * @return int + */ + public function getShop() + { + return $this->container['shop']; + } + + /** + * Sets shop + * + * @param int $shop + * + * @return $this + */ + public function setShop($shop) + { + $this->container['shop'] = $shop; + + return $this; + } + + + /** + * Gets state + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets stock_check_required + * + * @return bool + */ + public function getStockCheckRequired() + { + return $this->container['stock_check_required']; + } + + /** + * Sets stock_check_required + * + * @param bool $stock_check_required + * + * @return $this + */ + public function setStockCheckRequired($stock_check_required) + { + $this->container['stock_check_required'] = $stock_check_required; + + return $this; + } + + + /** + * Gets store_order_confirmation_email_enabled + * + * @return bool + */ + public function getStoreOrderConfirmationEmailEnabled() + { + return $this->container['store_order_confirmation_email_enabled']; + } + + /** + * Sets store_order_confirmation_email_enabled + * + * @param bool $store_order_confirmation_email_enabled Define whether the order confirmation email of the Shopify shop is sent to the customer for recurring orders. + * + * @return $this + */ + public function setStoreOrderConfirmationEmailEnabled($store_order_confirmation_email_enabled) + { + $this->container['store_order_confirmation_email_enabled'] = $store_order_confirmation_email_enabled; + + return $this; + } + + + /** + * Gets subscriber_suspension_allowed + * + * @return bool + */ + public function getSubscriberSuspensionAllowed() + { + return $this->container['subscriber_suspension_allowed']; + } + + /** + * Sets subscriber_suspension_allowed + * + * @param bool $subscriber_suspension_allowed Define whether the customer is allowed to suspend subscriptions. + * + * @return $this + */ + public function setSubscriberSuspensionAllowed($subscriber_suspension_allowed) + { + $this->container['subscriber_suspension_allowed'] = $subscriber_suspension_allowed; + + return $this; + } + + + /** + * Gets termination_billing_cycles + * + * @return int + */ + public function getTerminationBillingCycles() + { + return $this->container['termination_billing_cycles']; + } + + /** + * Sets termination_billing_cycles + * + * @param int $termination_billing_cycles Define the number of orders the subscription will keep running for after its termination has been requested. + * + * @return $this + */ + public function setTerminationBillingCycles($termination_billing_cycles) + { + $this->container['termination_billing_cycles'] = $termination_billing_cycles; + + return $this; + } + + + /** + * Gets updated_at + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param \DateTime $updated_at + * + * @return $this + */ + public function setUpdatedAt($updated_at) + { + $this->container['updated_at'] = $updated_at; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionProductCreate.php b/lib/Model/ShopifySubscriptionProductCreate.php new file mode 100644 index 0000000..9e23824 --- /dev/null +++ b/lib/Model/ShopifySubscriptionProductCreate.php @@ -0,0 +1,365 @@ + 'string', + 'product_variant_id' => 'string', + 'shop' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'product_id' => null, + 'product_variant_id' => null, + 'shop' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_id' => 'productId', + 'product_variant_id' => 'productVariantId', + 'shop' => 'shop' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_id' => 'setProductId', + 'product_variant_id' => 'setProductVariantId', + 'shop' => 'setShop' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_id' => 'getProductId', + 'product_variant_id' => 'getProductVariantId', + 'shop' => 'getShop' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['product_id'] = isset($data['product_id']) ? $data['product_id'] : null; + + $this->container['product_variant_id'] = isset($data['product_variant_id']) ? $data['product_variant_id'] : null; + + $this->container['shop'] = isset($data['shop']) ? $data['shop'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['product_id'] === null) { + $invalidProperties[] = "'product_id' can't be null"; + } + if ($this->container['product_variant_id'] === null) { + $invalidProperties[] = "'product_variant_id' can't be null"; + } + if ($this->container['shop'] === null) { + $invalidProperties[] = "'shop' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets product_id + * + * @return string + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param string $product_id The ID of the Shopify product that is enabled to be ordered as subscription. + * + * @return $this + */ + public function setProductId($product_id) + { + $this->container['product_id'] = $product_id; + + return $this; + } + + + /** + * Gets product_variant_id + * + * @return string + */ + public function getProductVariantId() + { + return $this->container['product_variant_id']; + } + + /** + * Sets product_variant_id + * + * @param string $product_variant_id + * + * @return $this + */ + public function setProductVariantId($product_variant_id) + { + $this->container['product_variant_id'] = $product_variant_id; + + return $this; + } + + + /** + * Gets shop + * + * @return int + */ + public function getShop() + { + return $this->container['shop']; + } + + /** + * Sets shop + * + * @param int $shop + * + * @return $this + */ + public function setShop($shop) + { + $this->container['shop'] = $shop; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionProductPricingOption.php b/lib/Model/ShopifySubscriptionProductPricingOption.php new file mode 100644 index 0000000..97817fa --- /dev/null +++ b/lib/Model/ShopifySubscriptionProductPricingOption.php @@ -0,0 +1,60 @@ + 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionState.php b/lib/Model/ShopifySubscriptionState.php new file mode 100644 index 0000000..974cd9a --- /dev/null +++ b/lib/Model/ShopifySubscriptionState.php @@ -0,0 +1,62 @@ + 'int', + 'created_on' => '\DateTime', + 'ended_by' => 'int', + 'ended_on' => '\DateTime', + 'id' => 'int', + 'initiator' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionInitiator', + 'linked_space_id' => 'int', + 'planned_end_date' => '\DateTime', + 'shop' => 'int', + 'state' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionState', + 'subscription' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscription', + 'type' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionType', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'ended_by' => 'int64', + 'ended_on' => 'date-time', + 'id' => 'int64', + 'initiator' => null, + 'linked_space_id' => 'int64', + 'planned_end_date' => 'date-time', + 'shop' => 'int64', + 'state' => null, + 'subscription' => null, + 'type' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'ended_by' => 'endedBy', + 'ended_on' => 'endedOn', + 'id' => 'id', + 'initiator' => 'initiator', + 'linked_space_id' => 'linkedSpaceId', + 'planned_end_date' => 'plannedEndDate', + 'shop' => 'shop', + 'state' => 'state', + 'subscription' => 'subscription', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'ended_by' => 'setEndedBy', + 'ended_on' => 'setEndedOn', + 'id' => 'setId', + 'initiator' => 'setInitiator', + 'linked_space_id' => 'setLinkedSpaceId', + 'planned_end_date' => 'setPlannedEndDate', + 'shop' => 'setShop', + 'state' => 'setState', + 'subscription' => 'setSubscription', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'ended_by' => 'getEndedBy', + 'ended_on' => 'getEndedOn', + 'id' => 'getId', + 'initiator' => 'getInitiator', + 'linked_space_id' => 'getLinkedSpaceId', + 'planned_end_date' => 'getPlannedEndDate', + 'shop' => 'getShop', + 'state' => 'getState', + 'subscription' => 'getSubscription', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['ended_by'] = isset($data['ended_by']) ? $data['ended_by'] : null; + + $this->container['ended_on'] = isset($data['ended_on']) ? $data['ended_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['initiator'] = isset($data['initiator']) ? $data['initiator'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['planned_end_date'] = isset($data['planned_end_date']) ? $data['planned_end_date'] : null; + + $this->container['shop'] = isset($data['shop']) ? $data['shop'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets ended_by + * + * @return int + */ + public function getEndedBy() + { + return $this->container['ended_by']; + } + + /** + * Sets ended_by + * + * @param int $ended_by + * + * @return $this + */ + public function setEndedBy($ended_by) + { + $this->container['ended_by'] = $ended_by; + + return $this; + } + + + /** + * Gets ended_on + * + * @return \DateTime + */ + public function getEndedOn() + { + return $this->container['ended_on']; + } + + /** + * Sets ended_on + * + * @param \DateTime $ended_on + * + * @return $this + */ + public function setEndedOn($ended_on) + { + $this->container['ended_on'] = $ended_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets initiator + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionInitiator + */ + public function getInitiator() + { + return $this->container['initiator']; + } + + /** + * Sets initiator + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionInitiator $initiator + * + * @return $this + */ + public function setInitiator($initiator) + { + $this->container['initiator'] = $initiator; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets planned_end_date + * + * @return \DateTime + */ + public function getPlannedEndDate() + { + return $this->container['planned_end_date']; + } + + /** + * Sets planned_end_date + * + * @param \DateTime $planned_end_date + * + * @return $this + */ + public function setPlannedEndDate($planned_end_date) + { + $this->container['planned_end_date'] = $planned_end_date; + + return $this; + } + + + /** + * Gets shop + * + * @return int + */ + public function getShop() + { + return $this->container['shop']; + } + + /** + * Sets shop + * + * @param int $shop + * + * @return $this + */ + public function setShop($shop) + { + $this->container['shop'] = $shop; + + return $this; + } + + + /** + * Gets state + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets subscription + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscription + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscription $subscription + * + * @return $this + */ + public function setSubscription($subscription) + { + $this->container['subscription'] = $subscription; + + return $this; + } + + + /** + * Gets type + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionSuspensionCreate.php b/lib/Model/ShopifySubscriptionSuspensionCreate.php new file mode 100644 index 0000000..36ad366 --- /dev/null +++ b/lib/Model/ShopifySubscriptionSuspensionCreate.php @@ -0,0 +1,371 @@ + '\DateTime', + 'subscription' => 'int', + 'type' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'planned_end_date' => 'date-time', + 'subscription' => 'int64', + 'type' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'planned_end_date' => 'plannedEndDate', + 'subscription' => 'subscription', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'planned_end_date' => 'setPlannedEndDate', + 'subscription' => 'setSubscription', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'planned_end_date' => 'getPlannedEndDate', + 'subscription' => 'getSubscription', + 'type' => 'getType' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['planned_end_date'] = isset($data['planned_end_date']) ? $data['planned_end_date'] : null; + + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['planned_end_date'] === null) { + $invalidProperties[] = "'planned_end_date' can't be null"; + } + if ($this->container['subscription'] === null) { + $invalidProperties[] = "'subscription' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets planned_end_date + * + * @return \DateTime + */ + public function getPlannedEndDate() + { + return $this->container['planned_end_date']; + } + + /** + * Sets planned_end_date + * + * @param \DateTime $planned_end_date + * + * @return $this + */ + public function setPlannedEndDate($planned_end_date) + { + $this->container['planned_end_date'] = $planned_end_date; + + return $this; + } + + + /** + * Gets subscription + * + * @return int + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param int $subscription + * + * @return $this + */ + public function setSubscription($subscription) + { + $this->container['subscription'] = $subscription; + + return $this; + } + + + /** + * Gets type + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionSuspensionInitiator.php b/lib/Model/ShopifySubscriptionSuspensionInitiator.php new file mode 100644 index 0000000..1c27309 --- /dev/null +++ b/lib/Model/ShopifySubscriptionSuspensionInitiator.php @@ -0,0 +1,54 @@ + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddressCreate', + 'id' => 'int', + 'shipping_address' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddressCreate' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'billing_address' => null, + 'id' => 'int64', + 'shipping_address' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address' => 'billingAddress', + 'id' => 'id', + 'shipping_address' => 'shippingAddress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address' => 'setBillingAddress', + 'id' => 'setId', + 'shipping_address' => 'setShippingAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address' => 'getBillingAddress', + 'id' => 'getId', + 'shipping_address' => 'getShippingAddress' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['shipping_address'] = isset($data['shipping_address']) ? $data['shipping_address'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets billing_address + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddressCreate + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddressCreate $billing_address + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets shipping_address + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddressCreate + */ + public function getShippingAddress() + { + return $this->container['shipping_address']; + } + + /** + * Sets shipping_address + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddressCreate $shipping_address + * + * @return $this + */ + public function setShippingAddress($shipping_address) + { + $this->container['shipping_address'] = $shipping_address; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionUpdateRequest.php b/lib/Model/ShopifySubscriptionUpdateRequest.php new file mode 100644 index 0000000..7feaa29 --- /dev/null +++ b/lib/Model/ShopifySubscriptionUpdateRequest.php @@ -0,0 +1,426 @@ + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelBillingConfiguration', + 'id' => 'int', + 'items' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelItem[]', + 'store_order_confirmation_email_enabled' => 'bool', + 'subscriber_suspension_allowed' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'billing_configuration' => null, + 'id' => 'int64', + 'items' => null, + 'store_order_confirmation_email_enabled' => null, + 'subscriber_suspension_allowed' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_configuration' => 'billingConfiguration', + 'id' => 'id', + 'items' => 'items', + 'store_order_confirmation_email_enabled' => 'storeOrderConfirmationEmailEnabled', + 'subscriber_suspension_allowed' => 'subscriberSuspensionAllowed' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_configuration' => 'setBillingConfiguration', + 'id' => 'setId', + 'items' => 'setItems', + 'store_order_confirmation_email_enabled' => 'setStoreOrderConfirmationEmailEnabled', + 'subscriber_suspension_allowed' => 'setSubscriberSuspensionAllowed' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_configuration' => 'getBillingConfiguration', + 'id' => 'getId', + 'items' => 'getItems', + 'store_order_confirmation_email_enabled' => 'getStoreOrderConfirmationEmailEnabled', + 'subscriber_suspension_allowed' => 'getSubscriberSuspensionAllowed' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['billing_configuration'] = isset($data['billing_configuration']) ? $data['billing_configuration'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + + $this->container['store_order_confirmation_email_enabled'] = isset($data['store_order_confirmation_email_enabled']) ? $data['store_order_confirmation_email_enabled'] : null; + + $this->container['subscriber_suspension_allowed'] = isset($data['subscriber_suspension_allowed']) ? $data['subscriber_suspension_allowed'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets billing_configuration + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelBillingConfiguration + */ + public function getBillingConfiguration() + { + return $this->container['billing_configuration']; + } + + /** + * Sets billing_configuration + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelBillingConfiguration $billing_configuration + * + * @return $this + */ + public function setBillingConfiguration($billing_configuration) + { + $this->container['billing_configuration'] = $billing_configuration; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets items + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelItem[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionModelItem[] $items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + + /** + * Gets store_order_confirmation_email_enabled + * + * @return bool + */ + public function getStoreOrderConfirmationEmailEnabled() + { + return $this->container['store_order_confirmation_email_enabled']; + } + + /** + * Sets store_order_confirmation_email_enabled + * + * @param bool $store_order_confirmation_email_enabled + * + * @return $this + */ + public function setStoreOrderConfirmationEmailEnabled($store_order_confirmation_email_enabled) + { + $this->container['store_order_confirmation_email_enabled'] = $store_order_confirmation_email_enabled; + + return $this; + } + + + /** + * Gets subscriber_suspension_allowed + * + * @return bool + */ + public function getSubscriberSuspensionAllowed() + { + return $this->container['subscriber_suspension_allowed']; + } + + /** + * Sets subscriber_suspension_allowed + * + * @param bool $subscriber_suspension_allowed + * + * @return $this + */ + public function setSubscriberSuspensionAllowed($subscriber_suspension_allowed) + { + $this->container['subscriber_suspension_allowed'] = $subscriber_suspension_allowed; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionVersion.php b/lib/Model/ShopifySubscriptionVersion.php new file mode 100644 index 0000000..6b4a29f --- /dev/null +++ b/lib/Model/ShopifySubscriptionVersion.php @@ -0,0 +1,1162 @@ + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddress', + 'billing_day_of_month' => 'int', + 'billing_interval_amount' => 'int', + 'billing_interval_unit' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionBillingIntervalUnit', + 'billing_reference_date' => '\DateTime', + 'billing_weekday' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionWeekday', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'currency' => 'string', + 'discharged_by' => 'int', + 'discharged_on' => '\DateTime', + 'id' => 'int', + 'items' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersionItem[]', + 'linked_space_id' => 'int', + 'maximal_billing_cycles' => 'int', + 'maximal_suspendable_cycles' => 'int', + 'minimal_billing_cycles' => 'int', + 'payment_gateway' => 'string', + 'shipping_address' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddress', + 'shipping_rate' => 'string', + 'shop' => 'int', + 'state' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersionState', + 'store_order_confirmation_email_enabled' => 'bool', + 'subscriber_suspension_allowed' => 'bool', + 'subscription' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscription', + 'termination_billing_cycles' => 'int', + 'token' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'billing_address' => null, + 'billing_day_of_month' => 'int32', + 'billing_interval_amount' => 'int32', + 'billing_interval_unit' => null, + 'billing_reference_date' => 'date-time', + 'billing_weekday' => null, + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'currency' => null, + 'discharged_by' => 'int64', + 'discharged_on' => 'date-time', + 'id' => 'int64', + 'items' => null, + 'linked_space_id' => 'int64', + 'maximal_billing_cycles' => 'int32', + 'maximal_suspendable_cycles' => 'int32', + 'minimal_billing_cycles' => 'int32', + 'payment_gateway' => null, + 'shipping_address' => null, + 'shipping_rate' => null, + 'shop' => 'int64', + 'state' => null, + 'store_order_confirmation_email_enabled' => null, + 'subscriber_suspension_allowed' => null, + 'subscription' => null, + 'termination_billing_cycles' => 'int32', + 'token' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address' => 'billingAddress', + 'billing_day_of_month' => 'billingDayOfMonth', + 'billing_interval_amount' => 'billingIntervalAmount', + 'billing_interval_unit' => 'billingIntervalUnit', + 'billing_reference_date' => 'billingReferenceDate', + 'billing_weekday' => 'billingWeekday', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'currency' => 'currency', + 'discharged_by' => 'dischargedBy', + 'discharged_on' => 'dischargedOn', + 'id' => 'id', + 'items' => 'items', + 'linked_space_id' => 'linkedSpaceId', + 'maximal_billing_cycles' => 'maximalBillingCycles', + 'maximal_suspendable_cycles' => 'maximalSuspendableCycles', + 'minimal_billing_cycles' => 'minimalBillingCycles', + 'payment_gateway' => 'paymentGateway', + 'shipping_address' => 'shippingAddress', + 'shipping_rate' => 'shippingRate', + 'shop' => 'shop', + 'state' => 'state', + 'store_order_confirmation_email_enabled' => 'storeOrderConfirmationEmailEnabled', + 'subscriber_suspension_allowed' => 'subscriberSuspensionAllowed', + 'subscription' => 'subscription', + 'termination_billing_cycles' => 'terminationBillingCycles', + 'token' => 'token', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address' => 'setBillingAddress', + 'billing_day_of_month' => 'setBillingDayOfMonth', + 'billing_interval_amount' => 'setBillingIntervalAmount', + 'billing_interval_unit' => 'setBillingIntervalUnit', + 'billing_reference_date' => 'setBillingReferenceDate', + 'billing_weekday' => 'setBillingWeekday', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'currency' => 'setCurrency', + 'discharged_by' => 'setDischargedBy', + 'discharged_on' => 'setDischargedOn', + 'id' => 'setId', + 'items' => 'setItems', + 'linked_space_id' => 'setLinkedSpaceId', + 'maximal_billing_cycles' => 'setMaximalBillingCycles', + 'maximal_suspendable_cycles' => 'setMaximalSuspendableCycles', + 'minimal_billing_cycles' => 'setMinimalBillingCycles', + 'payment_gateway' => 'setPaymentGateway', + 'shipping_address' => 'setShippingAddress', + 'shipping_rate' => 'setShippingRate', + 'shop' => 'setShop', + 'state' => 'setState', + 'store_order_confirmation_email_enabled' => 'setStoreOrderConfirmationEmailEnabled', + 'subscriber_suspension_allowed' => 'setSubscriberSuspensionAllowed', + 'subscription' => 'setSubscription', + 'termination_billing_cycles' => 'setTerminationBillingCycles', + 'token' => 'setToken', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address' => 'getBillingAddress', + 'billing_day_of_month' => 'getBillingDayOfMonth', + 'billing_interval_amount' => 'getBillingIntervalAmount', + 'billing_interval_unit' => 'getBillingIntervalUnit', + 'billing_reference_date' => 'getBillingReferenceDate', + 'billing_weekday' => 'getBillingWeekday', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'currency' => 'getCurrency', + 'discharged_by' => 'getDischargedBy', + 'discharged_on' => 'getDischargedOn', + 'id' => 'getId', + 'items' => 'getItems', + 'linked_space_id' => 'getLinkedSpaceId', + 'maximal_billing_cycles' => 'getMaximalBillingCycles', + 'maximal_suspendable_cycles' => 'getMaximalSuspendableCycles', + 'minimal_billing_cycles' => 'getMinimalBillingCycles', + 'payment_gateway' => 'getPaymentGateway', + 'shipping_address' => 'getShippingAddress', + 'shipping_rate' => 'getShippingRate', + 'shop' => 'getShop', + 'state' => 'getState', + 'store_order_confirmation_email_enabled' => 'getStoreOrderConfirmationEmailEnabled', + 'subscriber_suspension_allowed' => 'getSubscriberSuspensionAllowed', + 'subscription' => 'getSubscription', + 'termination_billing_cycles' => 'getTerminationBillingCycles', + 'token' => 'getToken', + 'version' => 'getVersion' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['billing_day_of_month'] = isset($data['billing_day_of_month']) ? $data['billing_day_of_month'] : null; + + $this->container['billing_interval_amount'] = isset($data['billing_interval_amount']) ? $data['billing_interval_amount'] : null; + + $this->container['billing_interval_unit'] = isset($data['billing_interval_unit']) ? $data['billing_interval_unit'] : null; + + $this->container['billing_reference_date'] = isset($data['billing_reference_date']) ? $data['billing_reference_date'] : null; + + $this->container['billing_weekday'] = isset($data['billing_weekday']) ? $data['billing_weekday'] : null; + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + $this->container['discharged_by'] = isset($data['discharged_by']) ? $data['discharged_by'] : null; + + $this->container['discharged_on'] = isset($data['discharged_on']) ? $data['discharged_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['maximal_billing_cycles'] = isset($data['maximal_billing_cycles']) ? $data['maximal_billing_cycles'] : null; + + $this->container['maximal_suspendable_cycles'] = isset($data['maximal_suspendable_cycles']) ? $data['maximal_suspendable_cycles'] : null; + + $this->container['minimal_billing_cycles'] = isset($data['minimal_billing_cycles']) ? $data['minimal_billing_cycles'] : null; + + $this->container['payment_gateway'] = isset($data['payment_gateway']) ? $data['payment_gateway'] : null; + + $this->container['shipping_address'] = isset($data['shipping_address']) ? $data['shipping_address'] : null; + + $this->container['shipping_rate'] = isset($data['shipping_rate']) ? $data['shipping_rate'] : null; + + $this->container['shop'] = isset($data['shop']) ? $data['shop'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['store_order_confirmation_email_enabled'] = isset($data['store_order_confirmation_email_enabled']) ? $data['store_order_confirmation_email_enabled'] : null; + + $this->container['subscriber_suspension_allowed'] = isset($data['subscriber_suspension_allowed']) ? $data['subscriber_suspension_allowed'] : null; + + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + + $this->container['termination_billing_cycles'] = isset($data['termination_billing_cycles']) ? $data['termination_billing_cycles'] : null; + + $this->container['token'] = isset($data['token']) ? $data['token'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets billing_address + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddress + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddress $billing_address + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets billing_day_of_month + * + * @return int + */ + public function getBillingDayOfMonth() + { + return $this->container['billing_day_of_month']; + } + + /** + * Sets billing_day_of_month + * + * @param int $billing_day_of_month + * + * @return $this + */ + public function setBillingDayOfMonth($billing_day_of_month) + { + $this->container['billing_day_of_month'] = $billing_day_of_month; + + return $this; + } + + + /** + * Gets billing_interval_amount + * + * @return int + */ + public function getBillingIntervalAmount() + { + return $this->container['billing_interval_amount']; + } + + /** + * Sets billing_interval_amount + * + * @param int $billing_interval_amount + * + * @return $this + */ + public function setBillingIntervalAmount($billing_interval_amount) + { + $this->container['billing_interval_amount'] = $billing_interval_amount; + + return $this; + } + + + /** + * Gets billing_interval_unit + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionBillingIntervalUnit + */ + public function getBillingIntervalUnit() + { + return $this->container['billing_interval_unit']; + } + + /** + * Sets billing_interval_unit + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionBillingIntervalUnit $billing_interval_unit + * + * @return $this + */ + public function setBillingIntervalUnit($billing_interval_unit) + { + $this->container['billing_interval_unit'] = $billing_interval_unit; + + return $this; + } + + + /** + * Gets billing_reference_date + * + * @return \DateTime + */ + public function getBillingReferenceDate() + { + return $this->container['billing_reference_date']; + } + + /** + * Sets billing_reference_date + * + * @param \DateTime $billing_reference_date + * + * @return $this + */ + public function setBillingReferenceDate($billing_reference_date) + { + $this->container['billing_reference_date'] = $billing_reference_date; + + return $this; + } + + + /** + * Gets billing_weekday + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionWeekday + */ + public function getBillingWeekday() + { + return $this->container['billing_weekday']; + } + + /** + * Sets billing_weekday + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionWeekday $billing_weekday + * + * @return $this + */ + public function setBillingWeekday($billing_weekday) + { + $this->container['billing_weekday'] = $billing_weekday; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + + /** + * Gets discharged_by + * + * @return int + */ + public function getDischargedBy() + { + return $this->container['discharged_by']; + } + + /** + * Sets discharged_by + * + * @param int $discharged_by + * + * @return $this + */ + public function setDischargedBy($discharged_by) + { + $this->container['discharged_by'] = $discharged_by; + + return $this; + } + + + /** + * Gets discharged_on + * + * @return \DateTime + */ + public function getDischargedOn() + { + return $this->container['discharged_on']; + } + + /** + * Sets discharged_on + * + * @param \DateTime $discharged_on + * + * @return $this + */ + public function setDischargedOn($discharged_on) + { + $this->container['discharged_on'] = $discharged_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets items + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersionItem[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersionItem[] $items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets maximal_billing_cycles + * + * @return int + */ + public function getMaximalBillingCycles() + { + return $this->container['maximal_billing_cycles']; + } + + /** + * Sets maximal_billing_cycles + * + * @param int $maximal_billing_cycles + * + * @return $this + */ + public function setMaximalBillingCycles($maximal_billing_cycles) + { + $this->container['maximal_billing_cycles'] = $maximal_billing_cycles; + + return $this; + } + + + /** + * Gets maximal_suspendable_cycles + * + * @return int + */ + public function getMaximalSuspendableCycles() + { + return $this->container['maximal_suspendable_cycles']; + } + + /** + * Sets maximal_suspendable_cycles + * + * @param int $maximal_suspendable_cycles + * + * @return $this + */ + public function setMaximalSuspendableCycles($maximal_suspendable_cycles) + { + $this->container['maximal_suspendable_cycles'] = $maximal_suspendable_cycles; + + return $this; + } + + + /** + * Gets minimal_billing_cycles + * + * @return int + */ + public function getMinimalBillingCycles() + { + return $this->container['minimal_billing_cycles']; + } + + /** + * Sets minimal_billing_cycles + * + * @param int $minimal_billing_cycles + * + * @return $this + */ + public function setMinimalBillingCycles($minimal_billing_cycles) + { + $this->container['minimal_billing_cycles'] = $minimal_billing_cycles; + + return $this; + } + + + /** + * Gets payment_gateway + * + * @return string + */ + public function getPaymentGateway() + { + return $this->container['payment_gateway']; + } + + /** + * Sets payment_gateway + * + * @param string $payment_gateway + * + * @return $this + */ + public function setPaymentGateway($payment_gateway) + { + $this->container['payment_gateway'] = $payment_gateway; + + return $this; + } + + + /** + * Gets shipping_address + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddress + */ + public function getShippingAddress() + { + return $this->container['shipping_address']; + } + + /** + * Sets shipping_address + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionAddress $shipping_address + * + * @return $this + */ + public function setShippingAddress($shipping_address) + { + $this->container['shipping_address'] = $shipping_address; + + return $this; + } + + + /** + * Gets shipping_rate + * + * @return string + */ + public function getShippingRate() + { + return $this->container['shipping_rate']; + } + + /** + * Sets shipping_rate + * + * @param string $shipping_rate + * + * @return $this + */ + public function setShippingRate($shipping_rate) + { + $this->container['shipping_rate'] = $shipping_rate; + + return $this; + } + + + /** + * Gets shop + * + * @return int + */ + public function getShop() + { + return $this->container['shop']; + } + + /** + * Sets shop + * + * @param int $shop + * + * @return $this + */ + public function setShop($shop) + { + $this->container['shop'] = $shop; + + return $this; + } + + + /** + * Gets state + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets store_order_confirmation_email_enabled + * + * @return bool + */ + public function getStoreOrderConfirmationEmailEnabled() + { + return $this->container['store_order_confirmation_email_enabled']; + } + + /** + * Sets store_order_confirmation_email_enabled + * + * @param bool $store_order_confirmation_email_enabled + * + * @return $this + */ + public function setStoreOrderConfirmationEmailEnabled($store_order_confirmation_email_enabled) + { + $this->container['store_order_confirmation_email_enabled'] = $store_order_confirmation_email_enabled; + + return $this; + } + + + /** + * Gets subscriber_suspension_allowed + * + * @return bool + */ + public function getSubscriberSuspensionAllowed() + { + return $this->container['subscriber_suspension_allowed']; + } + + /** + * Sets subscriber_suspension_allowed + * + * @param bool $subscriber_suspension_allowed + * + * @return $this + */ + public function setSubscriberSuspensionAllowed($subscriber_suspension_allowed) + { + $this->container['subscriber_suspension_allowed'] = $subscriber_suspension_allowed; + + return $this; + } + + + /** + * Gets subscription + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscription + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscription $subscription + * + * @return $this + */ + public function setSubscription($subscription) + { + $this->container['subscription'] = $subscription; + + return $this; + } + + + /** + * Gets termination_billing_cycles + * + * @return int + */ + public function getTerminationBillingCycles() + { + return $this->container['termination_billing_cycles']; + } + + /** + * Sets termination_billing_cycles + * + * @param int $termination_billing_cycles + * + * @return $this + */ + public function setTerminationBillingCycles($termination_billing_cycles) + { + $this->container['termination_billing_cycles'] = $termination_billing_cycles; + + return $this; + } + + + /** + * Gets token + * + * @return int + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param int $token + * + * @return $this + */ + public function setToken($token) + { + $this->container['token'] = $token; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionVersionItem.php b/lib/Model/ShopifySubscriptionVersionItem.php new file mode 100644 index 0000000..d2d2c7c --- /dev/null +++ b/lib/Model/ShopifySubscriptionVersionItem.php @@ -0,0 +1,426 @@ + 'float', + 'price_strategy' => '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersionItemPriceStrategy', + 'product' => 'int', + 'quantity' => 'float', + 'tax_lines' => '\PostFinanceCheckout\Sdk\Model\ShopifyTaxLine[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'price_including_tax' => null, + 'price_strategy' => null, + 'product' => 'int64', + 'quantity' => null, + 'tax_lines' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'price_including_tax' => 'priceIncludingTax', + 'price_strategy' => 'priceStrategy', + 'product' => 'product', + 'quantity' => 'quantity', + 'tax_lines' => 'taxLines' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'price_including_tax' => 'setPriceIncludingTax', + 'price_strategy' => 'setPriceStrategy', + 'product' => 'setProduct', + 'quantity' => 'setQuantity', + 'tax_lines' => 'setTaxLines' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'price_including_tax' => 'getPriceIncludingTax', + 'price_strategy' => 'getPriceStrategy', + 'product' => 'getProduct', + 'quantity' => 'getQuantity', + 'tax_lines' => 'getTaxLines' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['price_including_tax'] = isset($data['price_including_tax']) ? $data['price_including_tax'] : null; + + $this->container['price_strategy'] = isset($data['price_strategy']) ? $data['price_strategy'] : null; + + $this->container['product'] = isset($data['product']) ? $data['product'] : null; + + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + + $this->container['tax_lines'] = isset($data['tax_lines']) ? $data['tax_lines'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets price_including_tax + * + * @return float + */ + public function getPriceIncludingTax() + { + return $this->container['price_including_tax']; + } + + /** + * Sets price_including_tax + * + * @param float $price_including_tax + * + * @return $this + */ + public function setPriceIncludingTax($price_including_tax) + { + $this->container['price_including_tax'] = $price_including_tax; + + return $this; + } + + + /** + * Gets price_strategy + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersionItemPriceStrategy + */ + public function getPriceStrategy() + { + return $this->container['price_strategy']; + } + + /** + * Sets price_strategy + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersionItemPriceStrategy $price_strategy + * + * @return $this + */ + public function setPriceStrategy($price_strategy) + { + $this->container['price_strategy'] = $price_strategy; + + return $this; + } + + + /** + * Gets product + * + * @return int + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param int $product + * + * @return $this + */ + public function setProduct($product) + { + $this->container['product'] = $product; + + return $this; + } + + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + + /** + * Gets tax_lines + * + * @return \PostFinanceCheckout\Sdk\Model\ShopifyTaxLine[] + */ + public function getTaxLines() + { + return $this->container['tax_lines']; + } + + /** + * Sets tax_lines + * + * @param \PostFinanceCheckout\Sdk\Model\ShopifyTaxLine[] $tax_lines + * + * @return $this + */ + public function setTaxLines($tax_lines) + { + $this->container['tax_lines'] = $tax_lines; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShopifySubscriptionVersionItemPriceStrategy.php b/lib/Model/ShopifySubscriptionVersionItemPriceStrategy.php new file mode 100644 index 0000000..92a5d43 --- /dev/null +++ b/lib/Model/ShopifySubscriptionVersionItemPriceStrategy.php @@ -0,0 +1,54 @@ + 'float', + 'id' => 'int', + 'rate' => 'float', + 'title' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'fraction_rate' => null, + 'id' => 'int64', + 'rate' => null, + 'title' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'fraction_rate' => 'fractionRate', + 'id' => 'id', + 'rate' => 'rate', + 'title' => 'title', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fraction_rate' => 'setFractionRate', + 'id' => 'setId', + 'rate' => 'setRate', + 'title' => 'setTitle', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fraction_rate' => 'getFractionRate', + 'id' => 'getId', + 'rate' => 'getRate', + 'title' => 'getTitle', + 'version' => 'getVersion' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['fraction_rate'] = isset($data['fraction_rate']) ? $data['fraction_rate'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['rate'] = isset($data['rate']) ? $data['rate'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets fraction_rate + * + * @return float + */ + public function getFractionRate() + { + return $this->container['fraction_rate']; + } + + /** + * Sets fraction_rate + * + * @param float $fraction_rate + * + * @return $this + */ + public function setFractionRate($fraction_rate) + { + $this->container['fraction_rate'] = $fraction_rate; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float $rate + * + * @return $this + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TerminalReceiptFetchRequest.php b/lib/Model/TerminalReceiptFetchRequest.php new file mode 100644 index 0000000..86d3703 --- /dev/null +++ b/lib/Model/TerminalReceiptFetchRequest.php @@ -0,0 +1,368 @@ + '\PostFinanceCheckout\Sdk\Model\TerminalReceiptFormat', + 'transaction' => 'int', + 'width' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'format' => null, + 'transaction' => 'int64', + 'width' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'format' => 'format', + 'transaction' => 'transaction', + 'width' => 'width' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'format' => 'setFormat', + 'transaction' => 'setTransaction', + 'width' => 'setWidth' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'format' => 'getFormat', + 'transaction' => 'getTransaction', + 'width' => 'getWidth' + ]; + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + + $this->container['format'] = isset($data['format']) ? $data['format'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + $this->container['width'] = isset($data['width']) ? $data['width'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['format'] === null) { + $invalidProperties[] = "'format' can't be null"; + } + if ($this->container['transaction'] === null) { + $invalidProperties[] = "'transaction' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets format + * + * @return \PostFinanceCheckout\Sdk\Model\TerminalReceiptFormat + */ + public function getFormat() + { + return $this->container['format']; + } + + /** + * Sets format + * + * @param \PostFinanceCheckout\Sdk\Model\TerminalReceiptFormat $format The format determines in what format the receipts will be returned in. + * + * @return $this + */ + public function setFormat($format) + { + $this->container['format'] = $format; + + return $this; + } + + + /** + * Gets transaction + * + * @return int + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param int $transaction Provide here the ID of the transaction for which the receipts should be fetched. + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + return $this; + } + + + /** + * Gets width + * + * @return int + */ + public function getWidth() + { + return $this->container['width']; + } + + /** + * Sets width + * + * @param int $width The width controls how width the document will be rendered. In case of the PDF format the width is in mm. In case of the text format the width is in the number of chars per line. + * + * @return $this + */ + public function setWidth($width) + { + $this->container['width'] = $width; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TerminalReceiptFormat.php b/lib/Model/TerminalReceiptFormat.php new file mode 100644 index 0000000..02d9d96 --- /dev/null +++ b/lib/Model/TerminalReceiptFormat.php @@ -0,0 +1,54 @@ +container['external_id']) && (mb_strlen($this->container['external_id']) > 100)) { - $invalidProperties[] = "invalid value for 'external_id', the character length must be smaller than or equal to 100."; - } - - if (!is_null($this->container['external_id']) && (mb_strlen($this->container['external_id']) < 1)) { - $invalidProperties[] = "invalid value for 'external_id', the character length must be bigger than or equal to 1."; - } - if (!is_null($this->container['token_reference']) && (mb_strlen($this->container['token_reference']) > 100)) { $invalidProperties[] = "invalid value for 'token_reference', the character length must be smaller than or equal to 100."; } @@ -417,19 +409,12 @@ public function getExternalId() /** * Sets external_id * - * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * @param string $external_id A client generated nonce which identifies the entity to be created. Subsequent creation requests with the same external ID will not create new entities but return the initially created entity instead. * * @return $this */ public function setExternalId($external_id) { - if (!is_null($external_id) && (mb_strlen($external_id) > 100)) { - throw new \InvalidArgumentException('invalid length for $external_id when calling Token., must be smaller than or equal to 100.'); - } - if (!is_null($external_id) && (mb_strlen($external_id) < 1)) { - throw new \InvalidArgumentException('invalid length for $external_id when calling Token., must be bigger than or equal to 1.'); - } - $this->container['external_id'] = $external_id; return $this; diff --git a/lib/Model/TokenCreate.php b/lib/Model/TokenCreate.php index 0177406..0d707d6 100644 --- a/lib/Model/TokenCreate.php +++ b/lib/Model/TokenCreate.php @@ -132,14 +132,6 @@ public function listInvalidProperties() if ($this->container['external_id'] === null) { $invalidProperties[] = "'external_id' can't be null"; } - if ((mb_strlen($this->container['external_id']) > 100)) { - $invalidProperties[] = "invalid value for 'external_id', the character length must be smaller than or equal to 100."; - } - - if ((mb_strlen($this->container['external_id']) < 1)) { - $invalidProperties[] = "invalid value for 'external_id', the character length must be bigger than or equal to 1."; - } - return $invalidProperties; } @@ -233,19 +225,12 @@ public function getExternalId() /** * Sets external_id * - * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * @param string $external_id A client generated nonce which identifies the entity to be created. Subsequent creation requests with the same external ID will not create new entities but return the initially created entity instead. * * @return $this */ public function setExternalId($external_id) { - if ((mb_strlen($external_id) > 100)) { - throw new \InvalidArgumentException('invalid length for $external_id when calling TokenCreate., must be smaller than or equal to 100.'); - } - if ((mb_strlen($external_id) < 1)) { - throw new \InvalidArgumentException('invalid length for $external_id when calling TokenCreate., must be bigger than or equal to 1.'); - } - $this->container['external_id'] = $external_id; return $this; diff --git a/lib/Model/Transaction.php b/lib/Model/Transaction.php index 9cd2487..803b2bb 100644 --- a/lib/Model/Transaction.php +++ b/lib/Model/Transaction.php @@ -608,8 +608,8 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'device_session_identifier', the character length must be bigger than or equal to 10."; } - if (!is_null($this->container['failed_url']) && (mb_strlen($this->container['failed_url']) > 1000)) { - $invalidProperties[] = "invalid value for 'failed_url', the character length must be smaller than or equal to 1000."; + if (!is_null($this->container['failed_url']) && (mb_strlen($this->container['failed_url']) > 2000)) { + $invalidProperties[] = "invalid value for 'failed_url', the character length must be smaller than or equal to 2000."; } if (!is_null($this->container['failed_url']) && (mb_strlen($this->container['failed_url']) < 9)) { @@ -628,8 +628,8 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'shipping_method', the character length must be smaller than or equal to 200."; } - if (!is_null($this->container['success_url']) && (mb_strlen($this->container['success_url']) > 1000)) { - $invalidProperties[] = "invalid value for 'success_url', the character length must be smaller than or equal to 1000."; + if (!is_null($this->container['success_url']) && (mb_strlen($this->container['success_url']) > 2000)) { + $invalidProperties[] = "invalid value for 'success_url', the character length must be smaller than or equal to 2000."; } if (!is_null($this->container['success_url']) && (mb_strlen($this->container['success_url']) < 9)) { @@ -1521,8 +1521,8 @@ public function getFailedUrl() */ public function setFailedUrl($failed_url) { - if (!is_null($failed_url) && (mb_strlen($failed_url) > 1000)) { - throw new \InvalidArgumentException('invalid length for $failed_url when calling Transaction., must be smaller than or equal to 1000.'); + if (!is_null($failed_url) && (mb_strlen($failed_url) > 2000)) { + throw new \InvalidArgumentException('invalid length for $failed_url when calling Transaction., must be smaller than or equal to 2000.'); } if (!is_null($failed_url) && (mb_strlen($failed_url) < 9)) { throw new \InvalidArgumentException('invalid length for $failed_url when calling Transaction., must be bigger than or equal to 9.'); @@ -2165,8 +2165,8 @@ public function getSuccessUrl() */ public function setSuccessUrl($success_url) { - if (!is_null($success_url) && (mb_strlen($success_url) > 1000)) { - throw new \InvalidArgumentException('invalid length for $success_url when calling Transaction., must be smaller than or equal to 1000.'); + if (!is_null($success_url) && (mb_strlen($success_url) > 2000)) { + throw new \InvalidArgumentException('invalid length for $success_url when calling Transaction., must be smaller than or equal to 2000.'); } if (!is_null($success_url) && (mb_strlen($success_url) < 9)) { throw new \InvalidArgumentException('invalid length for $success_url when calling Transaction., must be bigger than or equal to 9.'); diff --git a/lib/Model/TransactionCreate.php b/lib/Model/TransactionCreate.php index 7ed2723..844bf65 100644 --- a/lib/Model/TransactionCreate.php +++ b/lib/Model/TransactionCreate.php @@ -167,8 +167,8 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'customer_email_address', the character length must be smaller than or equal to 254."; } - if (!is_null($this->container['failed_url']) && (mb_strlen($this->container['failed_url']) > 1000)) { - $invalidProperties[] = "invalid value for 'failed_url', the character length must be smaller than or equal to 1000."; + if (!is_null($this->container['failed_url']) && (mb_strlen($this->container['failed_url']) > 2000)) { + $invalidProperties[] = "invalid value for 'failed_url', the character length must be smaller than or equal to 2000."; } if (!is_null($this->container['failed_url']) && (mb_strlen($this->container['failed_url']) < 9)) { @@ -190,8 +190,8 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'shipping_method', the character length must be smaller than or equal to 200."; } - if (!is_null($this->container['success_url']) && (mb_strlen($this->container['success_url']) > 1000)) { - $invalidProperties[] = "invalid value for 'success_url', the character length must be smaller than or equal to 1000."; + if (!is_null($this->container['success_url']) && (mb_strlen($this->container['success_url']) > 2000)) { + $invalidProperties[] = "invalid value for 'success_url', the character length must be smaller than or equal to 2000."; } if (!is_null($this->container['success_url']) && (mb_strlen($this->container['success_url']) < 9)) { diff --git a/lib/Model/TransactionPending.php b/lib/Model/TransactionPending.php index a110abe..ee0a725 100644 --- a/lib/Model/TransactionPending.php +++ b/lib/Model/TransactionPending.php @@ -125,8 +125,8 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'customer_email_address', the character length must be smaller than or equal to 254."; } - if (!is_null($this->container['failed_url']) && (mb_strlen($this->container['failed_url']) > 1000)) { - $invalidProperties[] = "invalid value for 'failed_url', the character length must be smaller than or equal to 1000."; + if (!is_null($this->container['failed_url']) && (mb_strlen($this->container['failed_url']) > 2000)) { + $invalidProperties[] = "invalid value for 'failed_url', the character length must be smaller than or equal to 2000."; } if (!is_null($this->container['failed_url']) && (mb_strlen($this->container['failed_url']) < 9)) { @@ -145,8 +145,8 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'shipping_method', the character length must be smaller than or equal to 200."; } - if (!is_null($this->container['success_url']) && (mb_strlen($this->container['success_url']) > 1000)) { - $invalidProperties[] = "invalid value for 'success_url', the character length must be smaller than or equal to 1000."; + if (!is_null($this->container['success_url']) && (mb_strlen($this->container['success_url']) > 2000)) { + $invalidProperties[] = "invalid value for 'success_url', the character length must be smaller than or equal to 2000."; } if (!is_null($this->container['success_url']) && (mb_strlen($this->container['success_url']) < 9)) { diff --git a/lib/Service/PaymentTerminalService.php b/lib/Service/PaymentTerminalService.php new file mode 100644 index 0000000..7c426fe --- /dev/null +++ b/lib/Service/PaymentTerminalService.php @@ -0,0 +1,408 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation count + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return int + */ + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); + } + + /** + * Operation countWithHttpInfo + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/payment-terminal/count'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($filter)) { + $tempBody = $filter; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + 'int', + '/payment-terminal/count' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the payment terminal which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\PaymentTerminal + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the payment terminal which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/payment-terminal/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\PaymentTerminal', + '/payment-terminal/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\PaymentTerminal', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\PaymentTerminal', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation search + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the payment terminals which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\PaymentTerminal[] + */ + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); + } + + /** + * Operation searchWithHttpInfo + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the payment terminals which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); + } + // verify the required parameter 'query' is set + if (is_null($query)) { + throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/payment-terminal/search'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($query)) { + $tempBody = $query; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\PaymentTerminal[]', + '/payment-terminal/search' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\PaymentTerminal[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\PaymentTerminal[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/lib/Service/PaymentTerminalTillService.php b/lib/Service/PaymentTerminalTillService.php new file mode 100644 index 0000000..0fadc57 --- /dev/null +++ b/lib/Service/PaymentTerminalTillService.php @@ -0,0 +1,355 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation performTransaction + * + * Perform Payment Terminal Transaction + * + * @param int $space_id (required) + * @param int $transaction_id The ID of the transaction which is used to process with the terminal. (required) + * @param int $terminal_id The ID of the terminal which should be used to process the transaction. (required) + * @param string $language The language in which the messages should be rendered in. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\Transaction + */ + public function performTransaction($space_id, $transaction_id, $terminal_id, $language = null) { + return $this->performTransactionWithHttpInfo($space_id, $transaction_id, $terminal_id, $language)->getData(); + } + + /** + * Operation performTransactionWithHttpInfo + * + * Perform Payment Terminal Transaction + * + * @param int $space_id (required) + * @param int $transaction_id The ID of the transaction which is used to process with the terminal. (required) + * @param int $terminal_id The ID of the terminal which should be used to process the transaction. (required) + * @param string $language The language in which the messages should be rendered in. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function performTransactionWithHttpInfo($space_id, $transaction_id, $terminal_id, $language = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling performTransaction'); + } + // verify the required parameter 'transaction_id' is set + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('Missing the required parameter $transaction_id when calling performTransaction'); + } + // verify the required parameter 'terminal_id' is set + if (is_null($terminal_id)) { + throw new \InvalidArgumentException('Missing the required parameter $terminal_id when calling performTransaction'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($transaction_id)) { + $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transaction_id); + } + if (!is_null($terminal_id)) { + $queryParams['terminalId'] = $this->apiClient->getSerializer()->toQueryValue($terminal_id); + } + if (!is_null($language)) { + $queryParams['language'] = $this->apiClient->getSerializer()->toQueryValue($language); + } + + // path params + $resourcePath = '/payment-terminal-till/perform-transaction'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(90); + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\Transaction', + '/payment-terminal-till/perform-transaction' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\Transaction', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\Transaction', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 543: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation performTransactionByIdentifier + * + * Perform Payment Terminal Transaction (using TID) + * + * @param int $space_id (required) + * @param int $transaction_id The ID of the transaction which is used to process with the terminal. (required) + * @param string $terminal_identifier The identifier (aka TID) of the terminal which should be used to process the transaction. (required) + * @param string $language The language in which the messages should be rendered in. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\Transaction + */ + public function performTransactionByIdentifier($space_id, $transaction_id, $terminal_identifier, $language = null) { + return $this->performTransactionByIdentifierWithHttpInfo($space_id, $transaction_id, $terminal_identifier, $language)->getData(); + } + + /** + * Operation performTransactionByIdentifierWithHttpInfo + * + * Perform Payment Terminal Transaction (using TID) + * + * @param int $space_id (required) + * @param int $transaction_id The ID of the transaction which is used to process with the terminal. (required) + * @param string $terminal_identifier The identifier (aka TID) of the terminal which should be used to process the transaction. (required) + * @param string $language The language in which the messages should be rendered in. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function performTransactionByIdentifierWithHttpInfo($space_id, $transaction_id, $terminal_identifier, $language = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling performTransactionByIdentifier'); + } + // verify the required parameter 'transaction_id' is set + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('Missing the required parameter $transaction_id when calling performTransactionByIdentifier'); + } + // verify the required parameter 'terminal_identifier' is set + if (is_null($terminal_identifier)) { + throw new \InvalidArgumentException('Missing the required parameter $terminal_identifier when calling performTransactionByIdentifier'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($transaction_id)) { + $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transaction_id); + } + if (!is_null($terminal_identifier)) { + $queryParams['terminalIdentifier'] = $this->apiClient->getSerializer()->toQueryValue($terminal_identifier); + } + if (!is_null($language)) { + $queryParams['language'] = $this->apiClient->getSerializer()->toQueryValue($language); + } + + // path params + $resourcePath = '/payment-terminal-till/perform-transaction-by-identifier'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(90); + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\Transaction', + '/payment-terminal-till/perform-transaction-by-identifier' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\Transaction', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\Transaction', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 543: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/lib/Service/ShopifyRecurringOrderService.php b/lib/Service/ShopifyRecurringOrderService.php new file mode 100644 index 0000000..020913a --- /dev/null +++ b/lib/Service/ShopifyRecurringOrderService.php @@ -0,0 +1,515 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation count + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return int + */ + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); + } + + /** + * Operation countWithHttpInfo + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-recurring-order/count'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($filter)) { + $tempBody = $filter; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + 'int', + '/shopify-recurring-order/count' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the Shopify recurring order which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrder + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the Shopify recurring order which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/shopify-recurring-order/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrder', + '/shopify-recurring-order/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrder', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrder', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation search + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the Shopify recurring orders which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrder[] + */ + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); + } + + /** + * Operation searchWithHttpInfo + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the Shopify recurring orders which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); + } + // verify the required parameter 'query' is set + if (is_null($query)) { + throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-recurring-order/search'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($query)) { + $tempBody = $query; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrder[]', + '/shopify-recurring-order/search' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrder[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrder[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation update + * + * Update + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrderUpdateRequest $update_request (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return void + */ + public function update($space_id, $update_request) { + return $this->updateWithHttpInfo($space_id, $update_request)->getData(); + } + + /** + * Operation updateWithHttpInfo + * + * Update + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifyRecurringOrderUpdateRequest $update_request (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function updateWithHttpInfo($space_id, $update_request) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); + } + // verify the required parameter 'update_request' is set + if (is_null($update_request)) { + throw new \InvalidArgumentException('Missing the required parameter $update_request when calling update'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-recurring-order/update'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($update_request)) { + $tempBody = $update_request; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + null, + '/shopify-recurring-order/update' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/lib/Service/ShopifySubscriberService.php b/lib/Service/ShopifySubscriberService.php new file mode 100644 index 0000000..fe62b08 --- /dev/null +++ b/lib/Service/ShopifySubscriberService.php @@ -0,0 +1,531 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation count + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return int + */ + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); + } + + /** + * Operation countWithHttpInfo + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscriber/count'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($filter)) { + $tempBody = $filter; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + 'int', + '/shopify-subscriber/count' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the Shopify subscriber which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriber + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the Shopify subscriber which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/shopify-subscriber/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriber', + '/shopify-subscriber/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriber', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriber', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation search + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the Shopify subscribers which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriber[] + */ + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); + } + + /** + * Operation searchWithHttpInfo + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the Shopify subscribers which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); + } + // verify the required parameter 'query' is set + if (is_null($query)) { + throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscriber/search'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($query)) { + $tempBody = $query; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriber[]', + '/shopify-subscriber/search' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriber[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriber[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation update + * + * Update + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriberActive $query The Shopify subscriber object with all the properties which should be updated. The id and the version are required properties. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriber + */ + public function update($space_id, $query) { + return $this->updateWithHttpInfo($space_id, $query)->getData(); + } + + /** + * Operation updateWithHttpInfo + * + * Update + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriberActive $query The Shopify subscriber object with all the properties which should be updated. The id and the version are required properties. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function updateWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); + } + // verify the required parameter 'query' is set + if (is_null($query)) { + throw new \InvalidArgumentException('Missing the required parameter $query when calling update'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscriber/update'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($query)) { + $tempBody = $query; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriber', + '/shopify-subscriber/update' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriber', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriber', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/lib/Service/ShopifySubscriptionProductService.php b/lib/Service/ShopifySubscriptionProductService.php new file mode 100644 index 0000000..dd6765b --- /dev/null +++ b/lib/Service/ShopifySubscriptionProductService.php @@ -0,0 +1,646 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation count + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return int + */ + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); + } + + /** + * Operation countWithHttpInfo + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription-product/count'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($filter)) { + $tempBody = $filter; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + 'int', + '/shopify-subscription-product/count' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation create + * + * Create + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductCreate $entity The Shopify subscription product object with the properties which should be created. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct + */ + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation createWithHttpInfo + * + * Create + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductCreate $entity The Shopify subscription product object with the properties which should be created. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription-product/create'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct', + '/shopify-subscription-product/create' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the Shopify subscription product which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the Shopify subscription product which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/shopify-subscription-product/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct', + '/shopify-subscription-product/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation search + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the Shopify subscription products which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct[] + */ + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); + } + + /** + * Operation searchWithHttpInfo + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the Shopify subscription products which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); + } + // verify the required parameter 'query' is set + if (is_null($query)) { + throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription-product/search'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($query)) { + $tempBody = $query; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct[]', + '/shopify-subscription-product/search' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation update + * + * Update + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductUpdate $entity The Shopify subscription product object with all the properties which should be updated. The id and the version are required properties. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct + */ + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation updateWithHttpInfo + * + * Update + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProductUpdate $entity The Shopify subscription product object with all the properties which should be updated. The id and the version are required properties. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription-product/update'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct', + '/shopify-subscription-product/update' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionProduct', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/lib/Service/ShopifySubscriptionService.php b/lib/Service/ShopifySubscriptionService.php new file mode 100644 index 0000000..62beb6b --- /dev/null +++ b/lib/Service/ShopifySubscriptionService.php @@ -0,0 +1,867 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation count + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return int + */ + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); + } + + /** + * Operation countWithHttpInfo + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription/count'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($filter)) { + $tempBody = $filter; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + 'int', + '/shopify-subscription/count' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation create + * + * Create + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionCreationRequest $creation_request (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion + */ + public function create($space_id, $creation_request) { + return $this->createWithHttpInfo($space_id, $creation_request)->getData(); + } + + /** + * Operation createWithHttpInfo + * + * Create + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionCreationRequest $creation_request (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function createWithHttpInfo($space_id, $creation_request) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); + } + // verify the required parameter 'creation_request' is set + if (is_null($creation_request)) { + throw new \InvalidArgumentException('Missing the required parameter $creation_request when calling create'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription/create'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($creation_request)) { + $tempBody = $creation_request; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', + '/shopify-subscription/create' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the Shopify subscription which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscription + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the Shopify subscription which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/shopify-subscription/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscription', + '/shopify-subscription/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscription', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscription', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation search + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the Shopify subscriptions which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscription[] + */ + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); + } + + /** + * Operation searchWithHttpInfo + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the Shopify subscriptions which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); + } + // verify the required parameter 'query' is set + if (is_null($query)) { + throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription/search'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($query)) { + $tempBody = $query; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscription[]', + '/shopify-subscription/search' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscription[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscription[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation terminate + * + * Terminate + * + * @param int $space_id (required) + * @param int $subscription_id The ID identifies the Shopify subscription which should be terminated. (required) + * @param bool $respect_termination_period The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return void + */ + public function terminate($space_id, $subscription_id, $respect_termination_period) { + return $this->terminateWithHttpInfo($space_id, $subscription_id, $respect_termination_period)->getData(); + } + + /** + * Operation terminateWithHttpInfo + * + * Terminate + * + * @param int $space_id (required) + * @param int $subscription_id The ID identifies the Shopify subscription which should be terminated. (required) + * @param bool $respect_termination_period The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function terminateWithHttpInfo($space_id, $subscription_id, $respect_termination_period) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling terminate'); + } + // verify the required parameter 'subscription_id' is set + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('Missing the required parameter $subscription_id when calling terminate'); + } + // verify the required parameter 'respect_termination_period' is set + if (is_null($respect_termination_period)) { + throw new \InvalidArgumentException('Missing the required parameter $respect_termination_period when calling terminate'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($subscription_id)) { + $queryParams['subscriptionId'] = $this->apiClient->getSerializer()->toQueryValue($subscription_id); + } + if (!is_null($respect_termination_period)) { + $queryParams['respectTerminationPeriod'] = $this->apiClient->getSerializer()->toQueryValue($respect_termination_period); + } + + // path params + $resourcePath = '/shopify-subscription/terminate'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + null, + '/shopify-subscription/terminate' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation update + * + * Update + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionUpdateRequest $subscription (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion + */ + public function update($space_id, $subscription) { + return $this->updateWithHttpInfo($space_id, $subscription)->getData(); + } + + /** + * Operation updateWithHttpInfo + * + * Update + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionUpdateRequest $subscription (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function updateWithHttpInfo($space_id, $subscription) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); + } + // verify the required parameter 'subscription' is set + if (is_null($subscription)) { + throw new \InvalidArgumentException('Missing the required parameter $subscription when calling update'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription/update'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($subscription)) { + $tempBody = $subscription; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', + '/shopify-subscription/update' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateAddresses + * + * Update Addresses + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionUpdateAddressesRequest $update_request (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion + */ + public function updateAddresses($space_id, $update_request) { + return $this->updateAddressesWithHttpInfo($space_id, $update_request)->getData(); + } + + /** + * Operation updateAddressesWithHttpInfo + * + * Update Addresses + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionUpdateAddressesRequest $update_request (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function updateAddressesWithHttpInfo($space_id, $update_request) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling updateAddresses'); + } + // verify the required parameter 'update_request' is set + if (is_null($update_request)) { + throw new \InvalidArgumentException('Missing the required parameter $update_request when calling updateAddresses'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription/update-addresses'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($update_request)) { + $tempBody = $update_request; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', + '/shopify-subscription/update-addresses' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/lib/Service/ShopifySubscriptionSuspensionService.php b/lib/Service/ShopifySubscriptionSuspensionService.php new file mode 100644 index 0000000..ee2c1b0 --- /dev/null +++ b/lib/Service/ShopifySubscriptionSuspensionService.php @@ -0,0 +1,628 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation count + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return int + */ + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); + } + + /** + * Operation countWithHttpInfo + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription-suspension/count'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($filter)) { + $tempBody = $filter; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + 'int', + '/shopify-subscription-suspension/count' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation reactivate + * + * Reactivate + * + * @param int $space_id (required) + * @param int $subscription_id The ID identifies the suspended Shopify subscription which should be reactivated. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return void + */ + public function reactivate($space_id, $subscription_id) { + return $this->reactivateWithHttpInfo($space_id, $subscription_id)->getData(); + } + + /** + * Operation reactivateWithHttpInfo + * + * Reactivate + * + * @param int $space_id (required) + * @param int $subscription_id The ID identifies the suspended Shopify subscription which should be reactivated. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function reactivateWithHttpInfo($space_id, $subscription_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling reactivate'); + } + // verify the required parameter 'subscription_id' is set + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('Missing the required parameter $subscription_id when calling reactivate'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($subscription_id)) { + $queryParams['subscriptionId'] = $this->apiClient->getSerializer()->toQueryValue($subscription_id); + } + + // path params + $resourcePath = '/shopify-subscription-suspension/reactivate'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + null, + '/shopify-subscription-suspension/reactivate' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the Shopify subscription suspension which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspension + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the Shopify subscription suspension which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/shopify-subscription-suspension/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspension', + '/shopify-subscription-suspension/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspension', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspension', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation search + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the Shopify subscription suspensions which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspension[] + */ + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); + } + + /** + * Operation searchWithHttpInfo + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the Shopify subscription suspensions which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); + } + // verify the required parameter 'query' is set + if (is_null($query)) { + throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription-suspension/search'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($query)) { + $tempBody = $query; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspension[]', + '/shopify-subscription-suspension/search' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspension[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspension[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation suspend + * + * Suspend + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionCreate $suspension (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspension + */ + public function suspend($space_id, $suspension) { + return $this->suspendWithHttpInfo($space_id, $suspension)->getData(); + } + + /** + * Operation suspendWithHttpInfo + * + * Suspend + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspensionCreate $suspension (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function suspendWithHttpInfo($space_id, $suspension) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling suspend'); + } + // verify the required parameter 'suspension' is set + if (is_null($suspension)) { + throw new \InvalidArgumentException('Missing the required parameter $suspension when calling suspend'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription-suspension/suspend'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($suspension)) { + $tempBody = $suspension; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspension', + '/shopify-subscription-suspension/suspend' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspension', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionSuspension', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/lib/Service/ShopifySubscriptionVersionService.php b/lib/Service/ShopifySubscriptionVersionService.php new file mode 100644 index 0000000..a291727 --- /dev/null +++ b/lib/Service/ShopifySubscriptionVersionService.php @@ -0,0 +1,408 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation count + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return int + */ + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); + } + + /** + * Operation countWithHttpInfo + * + * Count + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription-version/count'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($filter)) { + $tempBody = $filter; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + 'int', + '/shopify-subscription-version/count' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the Shopify subscription version which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the Shopify subscription version which should be returned. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/shopify-subscription-version/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', + '/shopify-subscription-version/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation search + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the Shopify subscription versions which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion[] + */ + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); + } + + /** + * Operation searchWithHttpInfo + * + * Search + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\EntityQuery $query The query restricts the Shopify subscription versions which are returned by the search. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); + } + // verify the required parameter 'query' is set + if (is_null($query)) { + throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/shopify-subscription-version/search'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($query)) { + $tempBody = $query; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion[]', + '/shopify-subscription-version/search' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ShopifySubscriptionVersion[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/lib/Service/TokenService.php b/lib/Service/TokenService.php index b976f00..5649511 100644 --- a/lib/Service/TokenService.php +++ b/lib/Service/TokenService.php @@ -746,6 +746,119 @@ public function deleteWithHttpInfo($space_id, $id) { } } + /** + * Operation processTransaction + * + * Process Transaction + * + * @param int $space_id (required) + * @param int $transaction_id The id of the transaction for which we want to check if the token can be created or not. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\Charge + */ + public function processTransaction($space_id, $transaction_id) { + return $this->processTransactionWithHttpInfo($space_id, $transaction_id)->getData(); + } + + /** + * Operation processTransactionWithHttpInfo + * + * Process Transaction + * + * @param int $space_id (required) + * @param int $transaction_id The id of the transaction for which we want to check if the token can be created or not. (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function processTransactionWithHttpInfo($space_id, $transaction_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling processTransaction'); + } + // verify the required parameter 'transaction_id' is set + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('Missing the required parameter $transaction_id when calling processTransaction'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($transaction_id)) { + $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transaction_id); + } + + // path params + $resourcePath = '/token/process-transaction'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\Charge', + '/token/process-transaction' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\Charge', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\Charge', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** * Operation read * diff --git a/lib/Service/TransactionTerminalService.php b/lib/Service/TransactionTerminalService.php new file mode 100644 index 0000000..b6918ef --- /dev/null +++ b/lib/Service/TransactionTerminalService.php @@ -0,0 +1,311 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation fetchReceipts + * + * Fetch Receipts + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\TerminalReceiptFetchRequest $request (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return \PostFinanceCheckout\Sdk\Model\RenderedTerminalReceipt[] + */ + public function fetchReceipts($space_id, $request) { + return $this->fetchReceiptsWithHttpInfo($space_id, $request)->getData(); + } + + /** + * Operation fetchReceiptsWithHttpInfo + * + * Fetch Receipts + * + * @param int $space_id (required) + * @param \PostFinanceCheckout\Sdk\Model\TerminalReceiptFetchRequest $request (required) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function fetchReceiptsWithHttpInfo($space_id, $request) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling fetchReceipts'); + } + // verify the required parameter 'request' is set + if (is_null($request)) { + throw new \InvalidArgumentException('Missing the required parameter $request when calling fetchReceipts'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/transaction-terminal/fetch-receipts'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($request)) { + $tempBody = $request; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\PostFinanceCheckout\Sdk\Model\RenderedTerminalReceipt[]', + '/transaction-terminal/fetch-receipts' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\RenderedTerminalReceipt[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\RenderedTerminalReceipt[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation tillConnectionCredentials + * + * Create Till Connection Credentials + * + * @param int $space_id (required) + * @param int $transaction_id The ID of the transaction which is used to process with the terminal. (required) + * @param int $terminal_id The ID of the terminal which should be used to process the transaction. (required) + * @param string $language The language in which the messages should be rendered in. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return string + */ + public function tillConnectionCredentials($space_id, $transaction_id, $terminal_id, $language = null) { + return $this->tillConnectionCredentialsWithHttpInfo($space_id, $transaction_id, $terminal_id, $language)->getData(); + } + + /** + * Operation tillConnectionCredentialsWithHttpInfo + * + * Create Till Connection Credentials + * + * @param int $space_id (required) + * @param int $transaction_id The ID of the transaction which is used to process with the terminal. (required) + * @param int $terminal_id The ID of the terminal which should be used to process the transaction. (required) + * @param string $language The language in which the messages should be rendered in. (optional) + * @throws \PostFinanceCheckout\Sdk\ApiException + * @throws \PostFinanceCheckout\Sdk\VersioningException + * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function tillConnectionCredentialsWithHttpInfo($space_id, $transaction_id, $terminal_id, $language = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling tillConnectionCredentials'); + } + // verify the required parameter 'transaction_id' is set + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('Missing the required parameter $transaction_id when calling tillConnectionCredentials'); + } + // verify the required parameter 'terminal_id' is set + if (is_null($terminal_id)) { + throw new \InvalidArgumentException('Missing the required parameter $terminal_id when calling tillConnectionCredentials'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($transaction_id)) { + $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transaction_id); + } + if (!is_null($terminal_id)) { + $queryParams['terminalId'] = $this->apiClient->getSerializer()->toQueryValue($terminal_id); + } + if (!is_null($language)) { + $queryParams['language'] = $this->apiClient->getSerializer()->toQueryValue($language); + } + + // path params + $resourcePath = '/transaction-terminal/till-connection-credentials'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $this->apiClient->setConnectionTimeout(ApiClient::CONNECTION_TIMEOUT); + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + 'string', + '/transaction-terminal/till-connection-credentials' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'string', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PostFinanceCheckout\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +}