From 8a45687a90804953e372540fe209c87ad74f5c99 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:05:37 +0100 Subject: [PATCH] dockerfile --- Dockerfile | 22 + README.md | 16 +- __tests__/index.php | 324 +++++++++ docs/Model/BusValRuleAssignment.md | 4 +- ...alificationsCheckEligibilityRequestBody.md | 2 +- .../CustomerActivityDataOrderItemsItem.md | 2 +- ...merActivityDataRedemptionOrderItemsItem.md | 2 +- docs/Model/OrderCalculated.md | 2 +- docs/Model/OrderCalculatedBase.md | 2 +- docs/Model/OrderCalculatedNoCustomerData.md | 2 +- docs/Model/OrderItemCalculated.md | 1 + docs/Model/OrdersCreateResponseBody.md | 2 +- docs/Model/OrdersGetResponseBody.md | 2 +- docs/Model/OrdersUpdateResponseBody.md | 2 +- ...alificationsCheckEligibilityRequestBody.md | 2 +- docs/Model/QualificationsOption.md | 13 + docs/Model/QualificationsOptionFilters.md | 15 + src/Model/BusValRuleAssignment.php | 14 +- ...lificationsCheckEligibilityRequestBody.php | 6 +- .../CustomerActivityDataOrderItemsItem.php | 80 +-- ...erActivityDataRedemptionOrderItemsItem.php | 80 +-- src/Model/OrderCalculated.php | 7 +- src/Model/OrderCalculatedBase.php | 7 +- src/Model/OrderCalculatedNoCustomerData.php | 7 +- src/Model/OrderItemCalculated.php | 34 + src/Model/OrdersCreateResponseBody.php | 7 +- src/Model/OrdersGetResponseBody.php | 7 +- src/Model/OrdersUpdateResponseBody.php | 7 +- ...lificationsCheckEligibilityRequestBody.php | 6 +- src/Model/QualificationsOption.php | 625 +++++++++++++++++ src/Model/QualificationsOptionFilters.php | 649 ++++++++++++++++++ 31 files changed, 1804 insertions(+), 147 deletions(-) create mode 100644 Dockerfile create mode 100644 __tests__/index.php create mode 100644 docs/Model/QualificationsOption.md create mode 100644 docs/Model/QualificationsOptionFilters.md create mode 100644 src/Model/QualificationsOption.php create mode 100644 src/Model/QualificationsOptionFilters.php diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..383e05d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +# Stage 1: Build stage +FROM composer:2.6.6 AS composer + +WORKDIR /app + +VOLUME /app/data + +COPY . . + +RUN composer install + + +# Stage 2: Final image +FROM php:8.3 + +WORKDIR /app + +COPY --from=composer /app /app + +VOLUME /app/data + +CMD ["php", "-S", "0.0.0.0:5050", "./__tests__/index.php"] diff --git a/README.md b/README.md index 785ee1c..0e8ed72 100644 --- a/README.md +++ b/README.md @@ -272,8 +272,6 @@ Class | Method | HTTP request | Description - [ClientEventsCreateRequestBodyReferral](docs/Model/ClientEventsCreateRequestBodyReferral.md) - [ClientEventsCreateResponseBody](docs/Model/ClientEventsCreateResponseBody.md) - [ClientQualificationsCheckEligibilityRequestBody](docs/Model/ClientQualificationsCheckEligibilityRequestBody.md) -- [ClientQualificationsCheckEligibilityRequestBodyOptions](docs/Model/ClientQualificationsCheckEligibilityRequestBodyOptions.md) -- [ClientQualificationsCheckEligibilityRequestBodyOptionsFilters](docs/Model/ClientQualificationsCheckEligibilityRequestBodyOptionsFilters.md) - [ClientQualificationsCheckEligibilityResponseBody](docs/Model/ClientQualificationsCheckEligibilityResponseBody.md) - [ClientRedemptionsRedeemRequestBody](docs/Model/ClientRedemptionsRedeemRequestBody.md) - [ClientRedemptionsRedeemRequestBodyAllOfOptions](docs/Model/ClientRedemptionsRedeemRequestBodyAllOfOptions.md) @@ -607,6 +605,8 @@ Class | Method | HTTP request | Description - [QualificationsCheckEligibilityResponseBody](docs/Model/QualificationsCheckEligibilityResponseBody.md) - [QualificationsFieldConditions](docs/Model/QualificationsFieldConditions.md) - [QualificationsFiltersCondition](docs/Model/QualificationsFiltersCondition.md) +- [QualificationsOption](docs/Model/QualificationsOption.md) +- [QualificationsOptionFilters](docs/Model/QualificationsOptionFilters.md) - [QualificationsRedeemable](docs/Model/QualificationsRedeemable.md) - [QualificationsRedeemableBase](docs/Model/QualificationsRedeemableBase.md) - [QualificationsRedeemables](docs/Model/QualificationsRedeemables.md) @@ -885,14 +885,12 @@ Class | Method | HTTP request | Description - **Location**: URL query string -## Tests +## Run local tests with docker -To run the tests, use: - -```bash -composer install -vendor/bin/phpunit -``` +1. Copy `.env.example` to `.env` and fill in the values. +2. Run `docker build -t php .` to build the image. +3. Run `docker run --rm php` to run the tests and delete container immediately after. +4. Make changes Your desire and run again command from step 3. It uses volumes so no need to rebuild the image. ## Author diff --git a/__tests__/index.php b/__tests__/index.php new file mode 100644 index 0000000..26c7006 --- /dev/null +++ b/__tests__/index.php @@ -0,0 +1,324 @@ +setApiKey('X-App-Id', $env["X_APP_ID"]); +$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Token', $env["X_APP_TOKEN"]); +$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setHost($env["VOUCHERIFY_HOST"]); + +//create productsApi +$productsApiInstance = new OpenAPI\Client\Api\ProductsApi( + new GuzzleHttp\Client(), + $config +); + +//create variables to store products data +$created_product; +$created_product2; +//create Products +$products_create_request_body = new \OpenAPI\Client\Model\ProductsCreateRequestBody(); +$products_create_request_body->setSourceId(generateRandomString()); +$products_create_request_body->setName(generateRandomString()); +$products_create_request_body->setPrice(20000); +$products_create_request_body->setAttributes(["color", "memory", "processor"]); +try { + $created_product = $productsApiInstance->createProduct($products_create_request_body); + echo '
createProduct'; +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->createProduct: ', $e->getMessage(), PHP_EOL; +} +$products_create_request_body->setSourceId(generateRandomString()); +$products_create_request_body->setName(generateRandomString()); +$products_create_request_body->setPrice(66000); +try { + $created_product2 = $productsApiInstance->createProduct($products_create_request_body); + echo '
' . json_encode($created_product, JSON_PRETTY_PRINT) . '
createProduct'; +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->createProduct: ', $e->getMessage(), PHP_EOL; +} + +//create campaignsApi +$campaignsApiInstance = new OpenAPI\Client\Api\CampaignsApi( + new GuzzleHttp\Client(), + $config +); + +//create validationRulesApi +$validationRulesApiInstance = new OpenAPI\Client\Api\ValidationRulesApi( + new GuzzleHttp\Client(), + $config +); + +//create variable to store campaign data +$created_validation_rule; +//create validation rule +$validation_rules_create_request_body = new \OpenAPI\Client\Model\ValidationRulesCreateRequestBody(); +$applicable_to_created_product2 = new \OpenAPI\Client\Model\ApplicableTo(); +$applicable_to_created_product2->setProductId($created_product2->getId()); +$applicable_to_created_product2->setObject("product"); +$validation_rules_create_request_body->setApplicableTo(new \OpenAPI\Client\Model\ValidationRuleBaseApplicableTo()); +$validation_rules_create_request_body->getApplicableTo()->setIncluded([$applicable_to_created_product2]); +$validation_rules_create_request_body->setType("basic"); +$validation_rules_create_request_body->setName(generateRandomString()); +try { + echo '
' . json_encode($created_product, JSON_PRETTY_PRINT) . '
createValidationRules'; + $created_validation_rule = $validationRulesApiInstance->createValidationRules($validation_rules_create_request_body); + echo '
' . json_encode($validation_rules_create_request_body, JSON_PRETTY_PRINT) . '
createValidationRules'; +} catch (Exception $e) { + echo 'Exception when calling ValidationRulesApi->createValidationRules: ', $e->getMessage(), PHP_EOL; +} + +//create variable to store campaign data +$created_discount_campaign; +//createCampaign - DISCOUNT_COUPONS +$campaigns_create_request_body_discount = new \OpenAPI\Client\Model\CampaignsCreateRequestBody(); +$campaigns_create_request_body_discount->setName(generateRandomString(12)); +$campaigns_create_request_body_discount->setCampaignType("DISCOUNT_COUPONS"); +$campaigns_create_request_body_discount->setType("AUTO_UPDATE"); +$campaigns_create_request_body_discount->setVoucher(new \OpenAPI\Client\Model\CampaignsCreateRequestBodyVoucher()); +$campaigns_create_request_body_discount->getVoucher()->setType("DISCOUNT_VOUCHER"); +$campaigns_create_request_body_discount->getVoucher()->setDiscount(new \OpenAPI\Client\Model\Discount()); +$campaigns_create_request_body_discount->getVoucher()->getDiscount()->setType("AMOUNT"); +$campaigns_create_request_body_discount->getVoucher()->getDiscount()->setAmountOff(1000); +try { + $created_discount_campaign = $campaignsApiInstance->createCampaign($campaigns_create_request_body_discount); + echo '
' . json_encode($created_validation_rule, JSON_PRETTY_PRINT) . '
createCampaign - DISCOUNT_COUPONS'; +} catch (Exception $e) { + echo 'Exception when calling CampaignsApi->createCampaign: ', $e->getMessage(), PHP_EOL; +} + +//addVouchersToCampaign +$campaign_voucher; +try { + $campaign_voucher = $campaignsApiInstance->addVouchersToCampaign($created_discount_campaign->getId(), 1); + echo '
' . json_encode($created_discount_campaign, JSON_PRETTY_PRINT) . '
addVouchersToCampaign'; +} catch (Exception $e) { + echo 'Exception when calling CampaignsApi->getCampaign: ', $e->getMessage(), PHP_EOL; +} + +//create variable to store campaign data +$created_promotion_campaign; +//promotionTierCreateParams +$promotionTierCreateParams = new \OpenAPI\Client\Model\PromotionTierCreateParams(); +$promotionTierCreateParams->setName(generateRandomString()); +$promotionTierCreateParams->setBanner('testBanner'); +$promotionTierCreateParams->setAction(new \OpenAPI\Client\Model\PromotionTierAction()); +$promotionTierCreateParams->getAction()->setDiscount(new \OpenAPI\Client\Model\Discount()); +$promotionTierCreateParams->getAction()->getDiscount()->setType("AMOUNT"); +$promotionTierCreateParams->getAction()->getDiscount()->setAmountOff(1000); +//createCampaign - PROMOTION +$campaigns_create_request_body_promotion = new \OpenAPI\Client\Model\CampaignsCreateRequestBody(); +$campaigns_create_request_body_promotion->setName(generateRandomString(12)); +$campaigns_create_request_body_promotion->setCampaignType("PROMOTION"); +$campaigns_create_request_body_promotion->setPromotion(new \OpenAPI\Client\Model\CampaignsCreateRequestBodyPromotion()); +$campaigns_create_request_body_promotion->getPromotion()->setTiers([$promotionTierCreateParams]); +try { + $created_promotion_campaign = $campaignsApiInstance->createCampaign($campaigns_create_request_body_promotion); + echo '
' . json_encode($campaign_voucher, JSON_PRETTY_PRINT) . '
createCampaign - PROMOTION'; +} catch (Exception $e) { + echo 'Exception when calling CampaignsApi->createCampaign: ', $e->getMessage(), PHP_EOL; +} + + +//listCampaigns +$limit = 2; // int | A limit on the number of objects to be returned. Limit can range between 1 and 100 items. +$page = 1; // int | Which page of results to return. +$campaign_type = \OpenAPI\Client\Model\ParameterCampaignType::DISCOUNT_COUPONS->value; // ParameterCampaignType +$expand = \OpenAPI\Client\Model\ParameterExpandListCampaigns::CATEGORY->value; // ParameterExpandListCampaigns +$order = \OpenAPI\Client\Model\ParameterOrderListCampaigns::CREATED_AT2->value; // ParameterOrderListCampaigns +try { + $result = $campaignsApiInstance->listCampaigns($limit, $page, $campaign_type, $expand, $order); + echo '
' . json_encode($created_promotion_campaign, JSON_PRETTY_PRINT) . '
listCampaigns'; +} catch (Exception $e) { + echo 'Exception when calling CampaignsApi->listCampaigns: ', $e->getMessage(), PHP_EOL; +} + +//getCampaign +try { + $result = $campaignsApiInstance->getCampaign($created_discount_campaign->getId()); + echo '
' . json_encode($result, JSON_PRETTY_PRINT) . '
getCampaign'; + echo '
' . json_encode($result, JSON_PRETTY_PRINT) . '
getValidationRulesAssignments'; +} catch (Exception $e) { + echo 'Exception when calling CampaignsApi->getCampaign: ', $e->getMessage(), PHP_EOL; +} + +//create customersApi +$customersApiInstance = new OpenAPI\Client\Api\CustomersApi( + new GuzzleHttp\Client(), + $config +); + +//create variable to store customer data +$created_customer; + +//createCustomer +$customersCreateRequestBody = new \OpenAPI\Client\Model\CustomersCreateRequestBody(); +$customersCreateRequestBody->setSourceId('test123'); +$customersCreateRequestBody->setName('test123'); +$customersCreateRequestBody->setAddress(new \OpenAPI\Client\Model\CustomerBaseAddress()); +$customersCreateRequestBody->getAddress()->setCountry('US'); +$customersCreateRequestBody->getAddress()->setCity('Vice City'); +$customersCreateRequestBody->getAddress()->setLine1('123'); +$customersCreateRequestBody->getAddress()->setPostalCode('60089'); +try { + $created_customer = $customersApiInstance->createCustomer($customersCreateRequestBody); + echo '
' . json_encode($result->getValidationRulesAssignments(), JSON_PRETTY_PRINT) . '
createCustomer'; +} catch (Exception $e) { + echo 'Exception when calling CustomersApi->createCustomer: ', $e->getMessage(), PHP_EOL; +} + +//create qualificationsApi +$qualificationsApiInstance = new OpenAPI\Client\Api\QualificationsApi( + new GuzzleHttp\Client(), + $config +); + +//create variable to store checkEligibility result data +$check_eligibility_result; + + +//create orderItem +$order_item = new \OpenAPI\Client\Model\OrderItem(); +$order_item->setPrice($created_product->getPrice()); +$order_item->setQuantity(3); +$order_item->setProductId($created_product->getId()); + +//qualifications_check_eligibility_request_body +$qualifications_check_eligibility_request_body = new \OpenAPI\Client\Model\QualificationsCheckEligibilityRequestBody(); +$qualifications_check_eligibility_request_body->setCustomer(new \OpenAPI\Client\Model\Customer()); +$qualifications_check_eligibility_request_body->getCustomer()->setId($created_customer->getId()); +$qualifications_check_eligibility_request_body->setOrder(new \OpenAPI\Client\Model\Order()); +$qualifications_check_eligibility_request_body->getOrder()->setStatus("CREATED"); +$qualifications_check_eligibility_request_body->getOrder()->setItems([$order_item]); +$qualifications_check_eligibility_request_body->setMode("BASIC"); +$qualifications_check_eligibility_request_body->setScenario("ALL"); +try { + $check_eligibility_result = $qualificationsApiInstance->checkEligibility($qualifications_check_eligibility_request_body); + echo '
' . json_encode($created_customer, JSON_PRETTY_PRINT) . '
checkEligibility'; +} catch (Exception $e) { + echo 'Exception when calling CustomersApi->createCustomer: ', $e->getMessage(), PHP_EOL; +} +$applicable_promotion_tiers = array_slice(array_filter($check_eligibility_result->getRedeemables()->getData(), function ($redeemable) { + return $redeemable->getObject() === 'promotion_tier'; +}), 0, 3); +$applicable_promotion_tiers_ids = array_map(function ($promotion_tier) { + return $promotion_tier->getId(); +}, $applicable_promotion_tiers); + +//create stackableDiscountsApi +$stackedDiscountsApiInstance = new OpenAPI\Client\Api\StackableDiscountsApi( + new GuzzleHttp\Client(), + $config +); + +//validateStackedDiscounts +$validations_validate_request_body = new \OpenAPI\Client\Model\ValidationsValidateRequestBody(); +$validations_validate_request_body->setOrder(new \OpenAPI\Client\Model\Order()); +$validations_validate_request_body->getOrder()->setStatus("CREATED"); +$validations_validate_request_body->getOrder()->setItems([$order_item]); +$validations_validate_request_body->setCustomer(new \OpenAPI\Client\Model\Customer()); +$validations_validate_request_body->getCustomer()->setSourceId($created_customer->getSourceId()); +$validations_validate_request_body_redeemables = []; +foreach ($applicable_promotion_tiers_ids as $promotion_tier_id) { + $redeemable = new \OpenAPI\Client\Model\StackableValidateRedeemBaseRedeemablesItem(); + $redeemable->setId($promotion_tier_id); + $redeemable->setObject("promotion_tier"); + array_push($validations_validate_request_body_redeemables, $redeemable); +} +$voucher_redeemable = new \OpenAPI\Client\Model\StackableValidateRedeemBaseRedeemablesItem(); +$voucher_redeemable->setId($campaign_voucher->getCode()); +$voucher_redeemable->setObject("voucher"); +array_push($validations_validate_request_body_redeemables, $voucher_redeemable); +$validations_validate_request_body->setRedeemables($validations_validate_request_body_redeemables); +try { + $result = $stackedDiscountsApiInstance->validateStackedDiscounts($validations_validate_request_body); + echo '
' . json_encode($check_eligibility_result, JSON_PRETTY_PRINT) . '
validateStackedDiscounts'; + $result->getOrder(); + echo '
' . json_encode($result, JSON_PRETTY_PRINT) . '
order.amount = ' . $result->getOrder()->getAmount() . ''; +} catch (Exception $e) { + echo 'Exception when calling StackableDiscountsApi->redeemStackedDiscounts: ', $e->getMessage(), PHP_EOL; +} + +//validateStackedDiscounts +$redemptions_redeem_request_body = new \OpenAPI\Client\Model\RedemptionsRedeemRequestBody(); +$redemptions_redeem_request_body->setOrder(new \OpenAPI\Client\Model\Order()); +$redemptions_redeem_request_body->getOrder()->setStatus("CREATED"); +$redemptions_redeem_request_body->getOrder()->setItems([$order_item]); +$redemptions_redeem_request_body->setCustomer(new \OpenAPI\Client\Model\Customer()); +$redemptions_redeem_request_body->getCustomer()->setSourceId($created_customer->getSourceId()); +$redemptions_redeem_request_body->setRedeemables($validations_validate_request_body_redeemables); +try { + $result = $stackedDiscountsApiInstance->redeemStackedDiscounts($redemptions_redeem_request_body); + echo '
order.total_discount_amount = ' . $result->getOrder()->getTotalDiscountAmount() + . '
order.total_amount = ' . $result->getOrder()->getTotalAmount() . '
redeemStackedDiscounts'; + $result->getOrder(); + echo '
' . json_encode($result, JSON_PRETTY_PRINT) . '
order.amount = ' . $result->getOrder()->getAmount() . ''; +} catch (Exception $e) { + echo 'Exception when calling StackableDiscountsApi->redeemStackedDiscounts: ', $e->getMessage(), PHP_EOL; +} + +//create redemptionsApi +$redemptionsApiInstance = new OpenAPI\Client\Api\RedemptionsApi( + new GuzzleHttp\Client(), + $config +); + +//listRedemptions +try { + $result = $redemptionsApiInstance->listRedemptions(1, 1); + echo '
order.total_discount_amount = ' . $result->getOrder()->getTotalDiscountAmount() + . '
order.total_amount = ' . $result->getOrder()->getTotalAmount() . '
listRedemptions'; +} catch (Exception $e) { + echo 'Exception when calling RedemptionsApi->listRedemptions: ', $e->getMessage(), PHP_EOL; +} + + +//deleteCampaign - DISCOUNT_COUPONS +try { + $result = $campaignsApiInstance->deleteCampaign($created_discount_campaign->getId(), true); + echo '
' . json_encode($result, JSON_PRETTY_PRINT) . '
deleteCampaign - DISCOUNT_COUPONS'; +} catch (Exception $e) { + echo 'Exception when calling CampaignsApi->listCampaigns: ', $e->getMessage(), PHP_EOL; +} + +//deleteCampaign - PROMOTION +try { + $result = $campaignsApiInstance->deleteCampaign($created_promotion_campaign->getId(), true); + echo '
' . json_encode($result, JSON_PRETTY_PRINT) . '
deleteCampaign - PROMOTION'; +} catch (Exception $e) { + echo 'Exception when calling CampaignsApi->listCampaigns: ', $e->getMessage(), PHP_EOL; +} + +//deleteCustomer +try { + $result = $customersApiInstance->deleteCustomer($created_customer->getId()); + echo '
' . json_encode($result, JSON_PRETTY_PRINT) . '
deleteCustomer'; +} catch (Exception $e) { + echo 'Exception when calling CustomersApi->createCustomer: ', $e->getMessage(), PHP_EOL; +} + +//deleteProduct +try { + $productsApiInstance->deleteProduct($created_product->getId(), true); + echo '
' . json_encode($result, JSON_PRETTY_PRINT) . '
deleteProduct'; +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->deleteProduct: ', $e->getMessage(), PHP_EOL; +} diff --git a/docs/Model/BusValRuleAssignment.md b/docs/Model/BusValRuleAssignment.md index 3179bb4..2b9508f 100644 --- a/docs/Model/BusValRuleAssignment.md +++ b/docs/Model/BusValRuleAssignment.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **created_at** | **\DateTime** | Timestamp representing the date and time when the object was created in ISO 8601 format. | [optional] **updated_at** | **\DateTime** | Timestamp representing the date and time when the object was last updated in ISO 8601 format. | [optional] **object** | **string** | The type of object represented by JSON. | [default to 'validation_rules_assignment'] -**validation_status** | **string** | The validation status of the assignment | -**validation_omitted_rules** | **string[]** | The list of omitted rules | +**validation_status** | **string** | The validation status of the assignment | [optional] +**validation_omitted_rules** | **string[]** | The list of omitted rules | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ClientQualificationsCheckEligibilityRequestBody.md b/docs/Model/ClientQualificationsCheckEligibilityRequestBody.md index 27169da..d2cb847 100644 --- a/docs/Model/ClientQualificationsCheckEligibilityRequestBody.md +++ b/docs/Model/ClientQualificationsCheckEligibilityRequestBody.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **mode** | **string** | Defines which resources Voucherify will use. The `ADVANCED` mode is available after purchase only. | [optional] **tracking_id** | **string** | Is correspondent to Customer's source_id | [optional] **scenario** | **string** | Defines the scenario Voucherify should consider during the qualification process. - `ALL` - Scenario that returns all redeemables available for the customer in one API request. This scenario is used by default when no value is selected. - `CUSTOMER_WALLET` - returns vouchers applicable to the customer’s cart based on the vouchers assigned to the customer’s profile. - `AUDIENCE_ONLY` - returns all vouchers, promotion tiers, and campaigns available to the customer. Voucherify validates the rules based on the customer profile only. - `PRODUCTS` - returns all promotions available for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule). - `PRODUCTS_DISCOUNT` - returns all promotions available for products when a discount is defined as applicable to specific item(s). - `PROMOTION_STACKS` - returns the applicable promotion stacks. - `PRODUCTS_BY_CUSTOMER` - returns all promotions available for a customer for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule). - `PRODUCTS_DISCOUNT_BY_CUSTOMER` - returns all promotions available for a customer for products when a discount is defined as applicable to specific item(s). | [optional] -**options** | [**\OpenAPI\Client\Model\ClientQualificationsCheckEligibilityRequestBodyOptions**](ClientQualificationsCheckEligibilityRequestBodyOptions.md) | | [optional] +**options** | [**\OpenAPI\Client\Model\QualificationsOption**](QualificationsOption.md) | | [optional] **metadata** | **object** | A set of key/value pairs that you can send in the request body to check against redeemables requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the <!-- [Create Validation Rules](https://docs.voucherify.io/reference/create-validation-rules) -->[Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CustomerActivityDataOrderItemsItem.md b/docs/Model/CustomerActivityDataOrderItemsItem.md index 85a6727..6afd2da 100644 --- a/docs/Model/CustomerActivityDataOrderItemsItem.md +++ b/docs/Model/CustomerActivityDataOrderItemsItem.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **initial_quantity** | **int** | A positive integer in the smallest unit quantity representing the total amount of the order; this is the sum of the order items' quantity. | [optional] **amount** | **int** | The total amount of the order item (price * quantity). | [optional] **discount_amount** | **int** | Sum of all order-item-level discounts applied to the order. | [optional] +**applied_discount_amount** | **int** | This field shows the order-level discount applied. | [optional] **initial_amount** | **int** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] **total_applied_discount_amount** | **int** | Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] **price** | **int** | Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example `10000 cents` for `$100.00`. | [optional] @@ -21,6 +22,5 @@ Name | Type | Description | Notes **sku** | [**\OpenAPI\Client\Model\CustomerActivityDataOrderItemsItemSku**](CustomerActivityDataOrderItemsItemSku.md) | | [optional] **object** | **string** | | [optional] [default to 'order_item'] **metadata** | **object** | | [optional] -**applied_discount_amount** | **int** | This field shows the order-level discount applied. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CustomerActivityDataRedemptionOrderItemsItem.md b/docs/Model/CustomerActivityDataRedemptionOrderItemsItem.md index 73c8b31..15062d2 100644 --- a/docs/Model/CustomerActivityDataRedemptionOrderItemsItem.md +++ b/docs/Model/CustomerActivityDataRedemptionOrderItemsItem.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **initial_quantity** | **int** | A positive integer in the smallest unit quantity representing the total amount of the order; this is the sum of the order items' quantity. | [optional] **amount** | **int** | The total amount of the order item (price * quantity). | [optional] **discount_amount** | **int** | Sum of all order-item-level discounts applied to the order. | [optional] +**applied_discount_amount** | **int** | This field shows the order-level discount applied. | [optional] **initial_amount** | **int** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] **total_applied_discount_amount** | **int** | Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] **price** | **int** | Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example `10000 cents` for `$100.00`. | [optional] @@ -21,6 +22,5 @@ Name | Type | Description | Notes **sku** | [**\OpenAPI\Client\Model\CustomerActivityDataRedemptionOrderItemsItemSku**](CustomerActivityDataRedemptionOrderItemsItemSku.md) | | [optional] **object** | **string** | | [optional] [default to 'order_item'] **metadata** | **object** | | [optional] -**applied_discount_amount** | **int** | This field shows the order-level discount applied. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrderCalculated.md b/docs/Model/OrderCalculated.md index 76580c7..58e0d66 100644 --- a/docs/Model/OrderCalculated.md +++ b/docs/Model/OrderCalculated.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | +**id** | **string** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] **source_id** | **string** | Unique source ID of an existing order that will be linked to the redemption of this request. | **created_at** | **\DateTime** | Timestamp representing the date and time when the order was created in ISO 8601 format. | [optional] **updated_at** | **\DateTime** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] diff --git a/docs/Model/OrderCalculatedBase.md b/docs/Model/OrderCalculatedBase.md index 4be494b..7194464 100644 --- a/docs/Model/OrderCalculatedBase.md +++ b/docs/Model/OrderCalculatedBase.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | +**id** | **string** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] **source_id** | **string** | Unique source ID of an existing order that will be linked to the redemption of this request. | **created_at** | **\DateTime** | Timestamp representing the date and time when the order was created in ISO 8601 format. | [optional] **updated_at** | **\DateTime** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] diff --git a/docs/Model/OrderCalculatedNoCustomerData.md b/docs/Model/OrderCalculatedNoCustomerData.md index 1304e69..c905b9f 100644 --- a/docs/Model/OrderCalculatedNoCustomerData.md +++ b/docs/Model/OrderCalculatedNoCustomerData.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | +**id** | **string** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] **source_id** | **string** | Unique source ID of an existing order that will be linked to the redemption of this request. | **created_at** | **\DateTime** | Timestamp representing the date and time when the order was created in ISO 8601 format. | [optional] **updated_at** | **\DateTime** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] diff --git a/docs/Model/OrderItemCalculated.md b/docs/Model/OrderItemCalculated.md index 5ac4e41..ceeb24f 100644 --- a/docs/Model/OrderItemCalculated.md +++ b/docs/Model/OrderItemCalculated.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **initial_quantity** | **int** | A positive integer in the smallest unit quantity representing the total amount of the order; this is the sum of the order items' quantity. | [optional] **amount** | **int** | The total amount of the order item (price * quantity). | [optional] **discount_amount** | **int** | Sum of all order-item-level discounts applied to the order. | [optional] +**applied_discount_amount** | **int** | This field shows the order-level discount applied. | [optional] **initial_amount** | **int** | A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts. | [optional] **total_applied_discount_amount** | **int** | Sum of all order-level AND all product-specific discounts applied in a particular request. `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | [optional] **price** | **int** | Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example `10000 cents` for `$100.00`. | [optional] diff --git a/docs/Model/OrdersCreateResponseBody.md b/docs/Model/OrdersCreateResponseBody.md index 9e7af81..11a667d 100644 --- a/docs/Model/OrdersCreateResponseBody.md +++ b/docs/Model/OrdersCreateResponseBody.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | +**id** | **string** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] **source_id** | **string** | Unique source ID of an existing order that will be linked to the redemption of this request. | **created_at** | **\DateTime** | Timestamp representing the date and time when the order was created in ISO 8601 format. | [optional] **updated_at** | **\DateTime** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] diff --git a/docs/Model/OrdersGetResponseBody.md b/docs/Model/OrdersGetResponseBody.md index 7cca4dd..a0aff43 100644 --- a/docs/Model/OrdersGetResponseBody.md +++ b/docs/Model/OrdersGetResponseBody.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | +**id** | **string** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] **source_id** | **string** | Unique source ID of an existing order that will be linked to the redemption of this request. | **created_at** | **\DateTime** | Timestamp representing the date and time when the order was created in ISO 8601 format. | [optional] **updated_at** | **\DateTime** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] diff --git a/docs/Model/OrdersUpdateResponseBody.md b/docs/Model/OrdersUpdateResponseBody.md index b4bdde7..44b19ee 100644 --- a/docs/Model/OrdersUpdateResponseBody.md +++ b/docs/Model/OrdersUpdateResponseBody.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | +**id** | **string** | Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. | [optional] **source_id** | **string** | Unique source ID of an existing order that will be linked to the redemption of this request. | **created_at** | **\DateTime** | Timestamp representing the date and time when the order was created in ISO 8601 format. | [optional] **updated_at** | **\DateTime** | Timestamp representing the date and time when the order was last updated in ISO 8601 format. | [optional] diff --git a/docs/Model/QualificationsCheckEligibilityRequestBody.md b/docs/Model/QualificationsCheckEligibilityRequestBody.md index e937c4d..cf58bfa 100644 --- a/docs/Model/QualificationsCheckEligibilityRequestBody.md +++ b/docs/Model/QualificationsCheckEligibilityRequestBody.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **mode** | **string** | Defines which resources Voucherify will use. The `ADVANCED` mode is available after purchase only. | [optional] **tracking_id** | **string** | Is correspondent to Customer's source_id | [optional] **scenario** | **string** | Defines the scenario Voucherify should consider during the qualification process. - `ALL` - Scenario that returns all redeemables available for the customer in one API request. This scenario is used by default when no value is selected. - `CUSTOMER_WALLET` - returns vouchers applicable to the customer’s cart based on the vouchers assigned to the customer’s profile. - `AUDIENCE_ONLY` - returns all vouchers, promotion tiers, and campaigns available to the customer. Voucherify validates the rules based on the customer profile only. - `PRODUCTS` - returns all promotions available for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule). - `PRODUCTS_DISCOUNT` - returns all promotions available for products when a discount is defined as applicable to specific item(s). - `PROMOTION_STACKS` - returns the applicable promotion stacks. - `PRODUCTS_BY_CUSTOMER` - returns all promotions available for a customer for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule). - `PRODUCTS_DISCOUNT_BY_CUSTOMER` - returns all promotions available for a customer for products when a discount is defined as applicable to specific item(s). | [optional] -**options** | [**\OpenAPI\Client\Model\ClientQualificationsCheckEligibilityRequestBodyOptions**](ClientQualificationsCheckEligibilityRequestBodyOptions.md) | | [optional] +**options** | [**\OpenAPI\Client\Model\QualificationsOption**](QualificationsOption.md) | | [optional] **metadata** | **object** | A set of key/value pairs that you can send in the request body to check against redeemables requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the <!-- [Create Validation Rules](https://docs.voucherify.io/reference/create-validation-rules) -->[Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/QualificationsOption.md b/docs/Model/QualificationsOption.md new file mode 100644 index 0000000..1a8d63f --- /dev/null +++ b/docs/Model/QualificationsOption.md @@ -0,0 +1,13 @@ +# # QualificationsOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**limit** | **int** | The maximum number of redeemables to be returned in the API request. The actual number of returned redeemables will be determined by the API. The default value is set to 5 | [optional] +**starting_after** | **\DateTime** | Cursor used for paging. | [optional] +**filters** | [**\OpenAPI\Client\Model\QualificationsOptionFilters**](QualificationsOptionFilters.md) | | [optional] +**expand** | **string[]** | The expand array lets you configure the parameters included in the response. Depending on the strings included in the array, the response will contain different details. | **Expand Option** | **Response Body** | |:---|:---| | [\"redeemable\"] | - Returns the redeemables' metadata. | | [\"category\"] | - Returns an expanded `categories` object, showing details about the category. | | [\"validation_rules\"] | - Returns an expanded `validation_rules` object, showing details about the validation rules. | | [optional] +**sorting_rule** | **string** | Is used to determine the order in which data is displayed in the result array. - `DEFAULT` - Sorting descending by `created_at` - `BEST_DEAL` - Sorting descending by `total_applied_discount_amount` - `LEAST_DEAL` - Sorting ascending by `total_applied_discount_amount` | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/QualificationsOptionFilters.md b/docs/Model/QualificationsOptionFilters.md new file mode 100644 index 0000000..ac0abd3 --- /dev/null +++ b/docs/Model/QualificationsOptionFilters.md @@ -0,0 +1,15 @@ +# # QualificationsOptionFilters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**junction** | **string** | Logical Operator Between Filters. Filter by conditions set on the `junction` parameter indicating how the `conditions` should be accounted for in the query. An `AND` is an all-inclusive logical operator, meaning the `AND` operator displays a record if **ALL** the conditions separated by AND are TRUE, while an `OR` operator displays a record if **ANY** of the conditions separated by OR is TRUE. | [optional] +**category_id** | [**\OpenAPI\Client\Model\QualificationsFieldConditions**](QualificationsFieldConditions.md) | | [optional] +**campaign_id** | [**\OpenAPI\Client\Model\QualificationsFieldConditions**](QualificationsFieldConditions.md) | | [optional] +**resource_id** | [**\OpenAPI\Client\Model\QualificationsFieldConditions**](QualificationsFieldConditions.md) | | [optional] +**resource_type** | [**\OpenAPI\Client\Model\QualificationsFieldConditions**](QualificationsFieldConditions.md) | | [optional] +**voucher_type** | [**\OpenAPI\Client\Model\QualificationsFieldConditions**](QualificationsFieldConditions.md) | | [optional] +**code** | [**\OpenAPI\Client\Model\QualificationsFieldConditions**](QualificationsFieldConditions.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Model/BusValRuleAssignment.php b/src/Model/BusValRuleAssignment.php index 50c4296..5562ce9 100644 --- a/src/Model/BusValRuleAssignment.php +++ b/src/Model/BusValRuleAssignment.php @@ -386,9 +386,6 @@ public function listInvalidProperties() ); } - if ($this->container['validation_status'] === null) { - $invalidProperties[] = "'validation_status' can't be null"; - } $allowedValues = $this->getValidationStatusAllowableValues(); if (!is_null($this->container['validation_status']) && !in_array($this->container['validation_status'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -398,9 +395,6 @@ public function listInvalidProperties() ); } - if ($this->container['validation_omitted_rules'] === null) { - $invalidProperties[] = "'validation_omitted_rules' can't be null"; - } return $invalidProperties; } @@ -618,7 +612,7 @@ public function setObject($object) /** * Gets validation_status * - * @return string + * @return string|null */ public function getValidationStatus() { @@ -628,7 +622,7 @@ public function getValidationStatus() /** * Sets validation_status * - * @param string $validation_status The validation status of the assignment + * @param string|null $validation_status The validation status of the assignment * * @return self */ @@ -655,7 +649,7 @@ public function setValidationStatus($validation_status) /** * Gets validation_omitted_rules * - * @return string[] + * @return string[]|null */ public function getValidationOmittedRules() { @@ -665,7 +659,7 @@ public function getValidationOmittedRules() /** * Sets validation_omitted_rules * - * @param string[] $validation_omitted_rules The list of omitted rules + * @param string[]|null $validation_omitted_rules The list of omitted rules * * @return self */ diff --git a/src/Model/ClientQualificationsCheckEligibilityRequestBody.php b/src/Model/ClientQualificationsCheckEligibilityRequestBody.php index e4bca32..08d3213 100644 --- a/src/Model/ClientQualificationsCheckEligibilityRequestBody.php +++ b/src/Model/ClientQualificationsCheckEligibilityRequestBody.php @@ -64,7 +64,7 @@ class ClientQualificationsCheckEligibilityRequestBody implements ModelInterface, 'mode' => 'string', 'tracking_id' => 'string', 'scenario' => 'string', - 'options' => '\OpenAPI\Client\Model\ClientQualificationsCheckEligibilityRequestBodyOptions', + 'options' => '\OpenAPI\Client\Model\QualificationsOption', 'metadata' => 'object' ]; @@ -551,7 +551,7 @@ public function setScenario($scenario) /** * Gets options * - * @return \OpenAPI\Client\Model\ClientQualificationsCheckEligibilityRequestBodyOptions|null + * @return \OpenAPI\Client\Model\QualificationsOption|null */ public function getOptions() { @@ -561,7 +561,7 @@ public function getOptions() /** * Sets options * - * @param \OpenAPI\Client\Model\ClientQualificationsCheckEligibilityRequestBodyOptions|null $options options + * @param \OpenAPI\Client\Model\QualificationsOption|null $options options * * @return self */ diff --git a/src/Model/CustomerActivityDataOrderItemsItem.php b/src/Model/CustomerActivityDataOrderItemsItem.php index c53f0d6..4d39d60 100644 --- a/src/Model/CustomerActivityDataOrderItemsItem.php +++ b/src/Model/CustomerActivityDataOrderItemsItem.php @@ -67,6 +67,7 @@ class CustomerActivityDataOrderItemsItem implements ModelInterface, ArrayAccess, 'initial_quantity' => 'int', 'amount' => 'int', 'discount_amount' => 'int', + 'applied_discount_amount' => 'int', 'initial_amount' => 'int', 'total_applied_discount_amount' => 'int', 'price' => 'int', @@ -74,8 +75,7 @@ class CustomerActivityDataOrderItemsItem implements ModelInterface, ArrayAccess, 'product' => '\OpenAPI\Client\Model\CustomerActivityDataOrderItemsItemProduct', 'sku' => '\OpenAPI\Client\Model\CustomerActivityDataOrderItemsItemSku', 'object' => 'string', - 'metadata' => 'object', - 'applied_discount_amount' => 'int' + 'metadata' => 'object' ]; /** @@ -95,6 +95,7 @@ class CustomerActivityDataOrderItemsItem implements ModelInterface, ArrayAccess, 'initial_quantity' => null, 'amount' => null, 'discount_amount' => null, + 'applied_discount_amount' => null, 'initial_amount' => null, 'total_applied_discount_amount' => null, 'price' => null, @@ -102,8 +103,7 @@ class CustomerActivityDataOrderItemsItem implements ModelInterface, ArrayAccess, 'product' => null, 'sku' => null, 'object' => null, - 'metadata' => null, - 'applied_discount_amount' => null + 'metadata' => null ]; /** @@ -121,6 +121,7 @@ class CustomerActivityDataOrderItemsItem implements ModelInterface, ArrayAccess, 'initial_quantity' => false, 'amount' => false, 'discount_amount' => false, + 'applied_discount_amount' => false, 'initial_amount' => false, 'total_applied_discount_amount' => false, 'price' => false, @@ -128,8 +129,7 @@ class CustomerActivityDataOrderItemsItem implements ModelInterface, ArrayAccess, 'product' => false, 'sku' => false, 'object' => false, - 'metadata' => false, - 'applied_discount_amount' => false + 'metadata' => false ]; /** @@ -227,6 +227,7 @@ public function isNullableSetToNull(string $property): bool 'initial_quantity' => 'initial_quantity', 'amount' => 'amount', 'discount_amount' => 'discount_amount', + 'applied_discount_amount' => 'applied_discount_amount', 'initial_amount' => 'initial_amount', 'total_applied_discount_amount' => 'total_applied_discount_amount', 'price' => 'price', @@ -234,8 +235,7 @@ public function isNullableSetToNull(string $property): bool 'product' => 'product', 'sku' => 'sku', 'object' => 'object', - 'metadata' => 'metadata', - 'applied_discount_amount' => 'applied_discount_amount' + 'metadata' => 'metadata' ]; /** @@ -253,6 +253,7 @@ public function isNullableSetToNull(string $property): bool 'initial_quantity' => 'setInitialQuantity', 'amount' => 'setAmount', 'discount_amount' => 'setDiscountAmount', + 'applied_discount_amount' => 'setAppliedDiscountAmount', 'initial_amount' => 'setInitialAmount', 'total_applied_discount_amount' => 'setTotalAppliedDiscountAmount', 'price' => 'setPrice', @@ -260,8 +261,7 @@ public function isNullableSetToNull(string $property): bool 'product' => 'setProduct', 'sku' => 'setSku', 'object' => 'setObject', - 'metadata' => 'setMetadata', - 'applied_discount_amount' => 'setAppliedDiscountAmount' + 'metadata' => 'setMetadata' ]; /** @@ -279,6 +279,7 @@ public function isNullableSetToNull(string $property): bool 'initial_quantity' => 'getInitialQuantity', 'amount' => 'getAmount', 'discount_amount' => 'getDiscountAmount', + 'applied_discount_amount' => 'getAppliedDiscountAmount', 'initial_amount' => 'getInitialAmount', 'total_applied_discount_amount' => 'getTotalAppliedDiscountAmount', 'price' => 'getPrice', @@ -286,8 +287,7 @@ public function isNullableSetToNull(string $property): bool 'product' => 'getProduct', 'sku' => 'getSku', 'object' => 'getObject', - 'metadata' => 'getMetadata', - 'applied_discount_amount' => 'getAppliedDiscountAmount' + 'metadata' => 'getMetadata' ]; /** @@ -384,6 +384,7 @@ public function __construct(array $data = null) $this->setIfExists('initial_quantity', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('discount_amount', $data ?? [], null); + $this->setIfExists('applied_discount_amount', $data ?? [], null); $this->setIfExists('initial_amount', $data ?? [], null); $this->setIfExists('total_applied_discount_amount', $data ?? [], null); $this->setIfExists('price', $data ?? [], null); @@ -392,7 +393,6 @@ public function __construct(array $data = null) $this->setIfExists('sku', $data ?? [], null); $this->setIfExists('object', $data ?? [], 'order_item'); $this->setIfExists('metadata', $data ?? [], null); - $this->setIfExists('applied_discount_amount', $data ?? [], null); } /** @@ -708,6 +708,33 @@ public function setDiscountAmount($discount_amount) return $this; } + /** + * Gets applied_discount_amount + * + * @return int|null + */ + public function getAppliedDiscountAmount() + { + return $this->container['applied_discount_amount']; + } + + /** + * Sets applied_discount_amount + * + * @param int|null $applied_discount_amount This field shows the order-level discount applied. + * + * @return self + */ + public function setAppliedDiscountAmount($applied_discount_amount) + { + if (is_null($applied_discount_amount)) { + throw new \InvalidArgumentException('non-nullable applied_discount_amount cannot be null'); + } + $this->container['applied_discount_amount'] = $applied_discount_amount; + + return $this; + } + /** * Gets initial_amount * @@ -933,33 +960,6 @@ public function setMetadata($metadata) return $this; } - - /** - * Gets applied_discount_amount - * - * @return int|null - */ - public function getAppliedDiscountAmount() - { - return $this->container['applied_discount_amount']; - } - - /** - * Sets applied_discount_amount - * - * @param int|null $applied_discount_amount This field shows the order-level discount applied. - * - * @return self - */ - public function setAppliedDiscountAmount($applied_discount_amount) - { - if (is_null($applied_discount_amount)) { - throw new \InvalidArgumentException('non-nullable applied_discount_amount cannot be null'); - } - $this->container['applied_discount_amount'] = $applied_discount_amount; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/CustomerActivityDataRedemptionOrderItemsItem.php b/src/Model/CustomerActivityDataRedemptionOrderItemsItem.php index cf5cbfd..0b5450e 100644 --- a/src/Model/CustomerActivityDataRedemptionOrderItemsItem.php +++ b/src/Model/CustomerActivityDataRedemptionOrderItemsItem.php @@ -67,6 +67,7 @@ class CustomerActivityDataRedemptionOrderItemsItem implements ModelInterface, Ar 'initial_quantity' => 'int', 'amount' => 'int', 'discount_amount' => 'int', + 'applied_discount_amount' => 'int', 'initial_amount' => 'int', 'total_applied_discount_amount' => 'int', 'price' => 'int', @@ -74,8 +75,7 @@ class CustomerActivityDataRedemptionOrderItemsItem implements ModelInterface, Ar 'product' => '\OpenAPI\Client\Model\CustomerActivityDataRedemptionOrderItemsItemProduct', 'sku' => '\OpenAPI\Client\Model\CustomerActivityDataRedemptionOrderItemsItemSku', 'object' => 'string', - 'metadata' => 'object', - 'applied_discount_amount' => 'int' + 'metadata' => 'object' ]; /** @@ -95,6 +95,7 @@ class CustomerActivityDataRedemptionOrderItemsItem implements ModelInterface, Ar 'initial_quantity' => null, 'amount' => null, 'discount_amount' => null, + 'applied_discount_amount' => null, 'initial_amount' => null, 'total_applied_discount_amount' => null, 'price' => null, @@ -102,8 +103,7 @@ class CustomerActivityDataRedemptionOrderItemsItem implements ModelInterface, Ar 'product' => null, 'sku' => null, 'object' => null, - 'metadata' => null, - 'applied_discount_amount' => null + 'metadata' => null ]; /** @@ -121,6 +121,7 @@ class CustomerActivityDataRedemptionOrderItemsItem implements ModelInterface, Ar 'initial_quantity' => false, 'amount' => false, 'discount_amount' => false, + 'applied_discount_amount' => false, 'initial_amount' => false, 'total_applied_discount_amount' => false, 'price' => false, @@ -128,8 +129,7 @@ class CustomerActivityDataRedemptionOrderItemsItem implements ModelInterface, Ar 'product' => false, 'sku' => false, 'object' => false, - 'metadata' => false, - 'applied_discount_amount' => false + 'metadata' => false ]; /** @@ -227,6 +227,7 @@ public function isNullableSetToNull(string $property): bool 'initial_quantity' => 'initial_quantity', 'amount' => 'amount', 'discount_amount' => 'discount_amount', + 'applied_discount_amount' => 'applied_discount_amount', 'initial_amount' => 'initial_amount', 'total_applied_discount_amount' => 'total_applied_discount_amount', 'price' => 'price', @@ -234,8 +235,7 @@ public function isNullableSetToNull(string $property): bool 'product' => 'product', 'sku' => 'sku', 'object' => 'object', - 'metadata' => 'metadata', - 'applied_discount_amount' => 'applied_discount_amount' + 'metadata' => 'metadata' ]; /** @@ -253,6 +253,7 @@ public function isNullableSetToNull(string $property): bool 'initial_quantity' => 'setInitialQuantity', 'amount' => 'setAmount', 'discount_amount' => 'setDiscountAmount', + 'applied_discount_amount' => 'setAppliedDiscountAmount', 'initial_amount' => 'setInitialAmount', 'total_applied_discount_amount' => 'setTotalAppliedDiscountAmount', 'price' => 'setPrice', @@ -260,8 +261,7 @@ public function isNullableSetToNull(string $property): bool 'product' => 'setProduct', 'sku' => 'setSku', 'object' => 'setObject', - 'metadata' => 'setMetadata', - 'applied_discount_amount' => 'setAppliedDiscountAmount' + 'metadata' => 'setMetadata' ]; /** @@ -279,6 +279,7 @@ public function isNullableSetToNull(string $property): bool 'initial_quantity' => 'getInitialQuantity', 'amount' => 'getAmount', 'discount_amount' => 'getDiscountAmount', + 'applied_discount_amount' => 'getAppliedDiscountAmount', 'initial_amount' => 'getInitialAmount', 'total_applied_discount_amount' => 'getTotalAppliedDiscountAmount', 'price' => 'getPrice', @@ -286,8 +287,7 @@ public function isNullableSetToNull(string $property): bool 'product' => 'getProduct', 'sku' => 'getSku', 'object' => 'getObject', - 'metadata' => 'getMetadata', - 'applied_discount_amount' => 'getAppliedDiscountAmount' + 'metadata' => 'getMetadata' ]; /** @@ -384,6 +384,7 @@ public function __construct(array $data = null) $this->setIfExists('initial_quantity', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('discount_amount', $data ?? [], null); + $this->setIfExists('applied_discount_amount', $data ?? [], null); $this->setIfExists('initial_amount', $data ?? [], null); $this->setIfExists('total_applied_discount_amount', $data ?? [], null); $this->setIfExists('price', $data ?? [], null); @@ -392,7 +393,6 @@ public function __construct(array $data = null) $this->setIfExists('sku', $data ?? [], null); $this->setIfExists('object', $data ?? [], 'order_item'); $this->setIfExists('metadata', $data ?? [], null); - $this->setIfExists('applied_discount_amount', $data ?? [], null); } /** @@ -708,6 +708,33 @@ public function setDiscountAmount($discount_amount) return $this; } + /** + * Gets applied_discount_amount + * + * @return int|null + */ + public function getAppliedDiscountAmount() + { + return $this->container['applied_discount_amount']; + } + + /** + * Sets applied_discount_amount + * + * @param int|null $applied_discount_amount This field shows the order-level discount applied. + * + * @return self + */ + public function setAppliedDiscountAmount($applied_discount_amount) + { + if (is_null($applied_discount_amount)) { + throw new \InvalidArgumentException('non-nullable applied_discount_amount cannot be null'); + } + $this->container['applied_discount_amount'] = $applied_discount_amount; + + return $this; + } + /** * Gets initial_amount * @@ -933,33 +960,6 @@ public function setMetadata($metadata) return $this; } - - /** - * Gets applied_discount_amount - * - * @return int|null - */ - public function getAppliedDiscountAmount() - { - return $this->container['applied_discount_amount']; - } - - /** - * Sets applied_discount_amount - * - * @param int|null $applied_discount_amount This field shows the order-level discount applied. - * - * @return self - */ - public function setAppliedDiscountAmount($applied_discount_amount) - { - if (is_null($applied_discount_amount)) { - throw new \InvalidArgumentException('non-nullable applied_discount_amount cannot be null'); - } - $this->container['applied_discount_amount'] = $applied_discount_amount; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/OrderCalculated.php b/src/Model/OrderCalculated.php index b6ef93c..00a4f3b 100644 --- a/src/Model/OrderCalculated.php +++ b/src/Model/OrderCalculated.php @@ -454,9 +454,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } if ($this->container['source_id'] === null) { $invalidProperties[] = "'source_id' can't be null"; } @@ -505,7 +502,7 @@ public function valid() /** * Gets id * - * @return string + * @return string|null */ public function getId() { @@ -515,7 +512,7 @@ public function getId() /** * Sets id * - * @param string $id Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. + * @param string|null $id Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. * * @return self */ diff --git a/src/Model/OrderCalculatedBase.php b/src/Model/OrderCalculatedBase.php index deb77ff..3e65003 100644 --- a/src/Model/OrderCalculatedBase.php +++ b/src/Model/OrderCalculatedBase.php @@ -441,9 +441,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } if ($this->container['source_id'] === null) { $invalidProperties[] = "'source_id' can't be null"; } @@ -492,7 +489,7 @@ public function valid() /** * Gets id * - * @return string + * @return string|null */ public function getId() { @@ -502,7 +499,7 @@ public function getId() /** * Sets id * - * @param string $id Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. + * @param string|null $id Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. * * @return self */ diff --git a/src/Model/OrderCalculatedNoCustomerData.php b/src/Model/OrderCalculatedNoCustomerData.php index 03f1bb7..8a6b28b 100644 --- a/src/Model/OrderCalculatedNoCustomerData.php +++ b/src/Model/OrderCalculatedNoCustomerData.php @@ -454,9 +454,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } if ($this->container['source_id'] === null) { $invalidProperties[] = "'source_id' can't be null"; } @@ -505,7 +502,7 @@ public function valid() /** * Gets id * - * @return string + * @return string|null */ public function getId() { @@ -515,7 +512,7 @@ public function getId() /** * Sets id * - * @param string $id Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. + * @param string|null $id Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. * * @return self */ diff --git a/src/Model/OrderItemCalculated.php b/src/Model/OrderItemCalculated.php index c577390..67c7592 100644 --- a/src/Model/OrderItemCalculated.php +++ b/src/Model/OrderItemCalculated.php @@ -67,6 +67,7 @@ class OrderItemCalculated implements ModelInterface, ArrayAccess, \JsonSerializa 'initial_quantity' => 'int', 'amount' => 'int', 'discount_amount' => 'int', + 'applied_discount_amount' => 'int', 'initial_amount' => 'int', 'total_applied_discount_amount' => 'int', 'price' => 'int', @@ -94,6 +95,7 @@ class OrderItemCalculated implements ModelInterface, ArrayAccess, \JsonSerializa 'initial_quantity' => null, 'amount' => null, 'discount_amount' => null, + 'applied_discount_amount' => null, 'initial_amount' => null, 'total_applied_discount_amount' => null, 'price' => null, @@ -119,6 +121,7 @@ class OrderItemCalculated implements ModelInterface, ArrayAccess, \JsonSerializa 'initial_quantity' => false, 'amount' => false, 'discount_amount' => false, + 'applied_discount_amount' => false, 'initial_amount' => false, 'total_applied_discount_amount' => false, 'price' => false, @@ -224,6 +227,7 @@ public function isNullableSetToNull(string $property): bool 'initial_quantity' => 'initial_quantity', 'amount' => 'amount', 'discount_amount' => 'discount_amount', + 'applied_discount_amount' => 'applied_discount_amount', 'initial_amount' => 'initial_amount', 'total_applied_discount_amount' => 'total_applied_discount_amount', 'price' => 'price', @@ -249,6 +253,7 @@ public function isNullableSetToNull(string $property): bool 'initial_quantity' => 'setInitialQuantity', 'amount' => 'setAmount', 'discount_amount' => 'setDiscountAmount', + 'applied_discount_amount' => 'setAppliedDiscountAmount', 'initial_amount' => 'setInitialAmount', 'total_applied_discount_amount' => 'setTotalAppliedDiscountAmount', 'price' => 'setPrice', @@ -274,6 +279,7 @@ public function isNullableSetToNull(string $property): bool 'initial_quantity' => 'getInitialQuantity', 'amount' => 'getAmount', 'discount_amount' => 'getDiscountAmount', + 'applied_discount_amount' => 'getAppliedDiscountAmount', 'initial_amount' => 'getInitialAmount', 'total_applied_discount_amount' => 'getTotalAppliedDiscountAmount', 'price' => 'getPrice', @@ -378,6 +384,7 @@ public function __construct(array $data = null) $this->setIfExists('initial_quantity', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('discount_amount', $data ?? [], null); + $this->setIfExists('applied_discount_amount', $data ?? [], null); $this->setIfExists('initial_amount', $data ?? [], null); $this->setIfExists('total_applied_discount_amount', $data ?? [], null); $this->setIfExists('price', $data ?? [], null); @@ -704,6 +711,33 @@ public function setDiscountAmount($discount_amount) return $this; } + /** + * Gets applied_discount_amount + * + * @return int|null + */ + public function getAppliedDiscountAmount() + { + return $this->container['applied_discount_amount']; + } + + /** + * Sets applied_discount_amount + * + * @param int|null $applied_discount_amount This field shows the order-level discount applied. + * + * @return self + */ + public function setAppliedDiscountAmount($applied_discount_amount) + { + if (is_null($applied_discount_amount)) { + throw new \InvalidArgumentException('non-nullable applied_discount_amount cannot be null'); + } + $this->container['applied_discount_amount'] = $applied_discount_amount; + + return $this; + } + /** * Gets initial_amount * diff --git a/src/Model/OrdersCreateResponseBody.php b/src/Model/OrdersCreateResponseBody.php index f3ae3dc..a088b6f 100644 --- a/src/Model/OrdersCreateResponseBody.php +++ b/src/Model/OrdersCreateResponseBody.php @@ -455,9 +455,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } if ($this->container['source_id'] === null) { $invalidProperties[] = "'source_id' can't be null"; } @@ -506,7 +503,7 @@ public function valid() /** * Gets id * - * @return string + * @return string|null */ public function getId() { @@ -516,7 +513,7 @@ public function getId() /** * Sets id * - * @param string $id Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. + * @param string|null $id Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. * * @return self */ diff --git a/src/Model/OrdersGetResponseBody.php b/src/Model/OrdersGetResponseBody.php index 2411f90..bf815dc 100644 --- a/src/Model/OrdersGetResponseBody.php +++ b/src/Model/OrdersGetResponseBody.php @@ -455,9 +455,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } if ($this->container['source_id'] === null) { $invalidProperties[] = "'source_id' can't be null"; } @@ -506,7 +503,7 @@ public function valid() /** * Gets id * - * @return string + * @return string|null */ public function getId() { @@ -516,7 +513,7 @@ public function getId() /** * Sets id * - * @param string $id Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. + * @param string|null $id Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. * * @return self */ diff --git a/src/Model/OrdersUpdateResponseBody.php b/src/Model/OrdersUpdateResponseBody.php index 7ee14e3..a0a01db 100644 --- a/src/Model/OrdersUpdateResponseBody.php +++ b/src/Model/OrdersUpdateResponseBody.php @@ -455,9 +455,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } if ($this->container['source_id'] === null) { $invalidProperties[] = "'source_id' can't be null"; } @@ -506,7 +503,7 @@ public function valid() /** * Gets id * - * @return string + * @return string|null */ public function getId() { @@ -516,7 +513,7 @@ public function getId() /** * Sets id * - * @param string $id Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. + * @param string|null $id Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request. * * @return self */ diff --git a/src/Model/QualificationsCheckEligibilityRequestBody.php b/src/Model/QualificationsCheckEligibilityRequestBody.php index 49a441e..d2d9bfe 100644 --- a/src/Model/QualificationsCheckEligibilityRequestBody.php +++ b/src/Model/QualificationsCheckEligibilityRequestBody.php @@ -64,7 +64,7 @@ class QualificationsCheckEligibilityRequestBody implements ModelInterface, Array 'mode' => 'string', 'tracking_id' => 'string', 'scenario' => 'string', - 'options' => '\OpenAPI\Client\Model\ClientQualificationsCheckEligibilityRequestBodyOptions', + 'options' => '\OpenAPI\Client\Model\QualificationsOption', 'metadata' => 'object' ]; @@ -551,7 +551,7 @@ public function setScenario($scenario) /** * Gets options * - * @return \OpenAPI\Client\Model\ClientQualificationsCheckEligibilityRequestBodyOptions|null + * @return \OpenAPI\Client\Model\QualificationsOption|null */ public function getOptions() { @@ -561,7 +561,7 @@ public function getOptions() /** * Sets options * - * @param \OpenAPI\Client\Model\ClientQualificationsCheckEligibilityRequestBodyOptions|null $options options + * @param \OpenAPI\Client\Model\QualificationsOption|null $options options * * @return self */ diff --git a/src/Model/QualificationsOption.php b/src/Model/QualificationsOption.php new file mode 100644 index 0000000..f858b62 --- /dev/null +++ b/src/Model/QualificationsOption.php @@ -0,0 +1,625 @@ + + */ +class QualificationsOption implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QualificationsOption'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'limit' => 'int', + 'starting_after' => '\DateTime', + 'filters' => '\OpenAPI\Client\Model\QualificationsOptionFilters', + 'expand' => 'string[]', + 'sorting_rule' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array
' . json_encode($result, JSON_PRETTY_PRINT) . '