Skip to content

Commit

Permalink
anyOf to oneOf
Browse files Browse the repository at this point in the history
  • Loading branch information
p-zielinski committed Nov 29, 2023
1 parent 8da5573 commit 1c5f1f9
Show file tree
Hide file tree
Showing 24 changed files with 203 additions and 239 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ How to edit OpenAPI file:
"GiftCardTransaction": {
"title": "Gift Card Transaction",
"description": "List of gift card transactions",
"anyOf": [
"oneOf": [
{
"title": "Redemption",
"allOf": [
Expand Down Expand Up @@ -123,7 +123,7 @@ For example:
Good practices:
- for literal unions use `enum`
- for types unions, use `anyOf`,
- for types unions, use `oneOf`,
- for attributes that may contain `null`, add `"nullable": true`
- for dates use `"type": "string", "format": "date-time"` or `"type": "string", "format": "date"`
- for the object, add the "required" attribute which should contain a list of required attributes in the object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ order: 1
| id</br>`string` | <p>Async action unique ID.</p> **Example:** <p>aa_0adad13d6f057f088e</p> |
| type</br>`string` | <p>Type of async action.</p> Available values: `CAMPAIGN.VOUCHERS_IMPORT`, `CAMPAIGN.VOUCHERS_IMPORT_CSV`, `CAMPAIGN.VOUCHERS_UPDATE`, `CAMPAIGN.VOUCHERS_DELETE`, `CAMPAIGN.VOUCHERS_GENERATE`, `CAMPAIGNS.METADATA_KEY_PURGE`, `CUSTOMERS.IMPORT_CSV`, `CUSTOMERS.BULK_UPDATE`, `CUSTOMERS.METADATA_UPDATE`, `CUSTOMERS.METADATA_KEY_PURGE`, `PRODUCTS.BULK_UPDATE`, `PRODUCTS.METADATA_UPDATE`, `PRODUCTS.METADATA_KEY_PURGE`, `PRODUCTS.IMPORT_CSV`, `SKUS.IMPORT_CSV`, `VOUCHERS.IMPORT`, `VOUCHERS.IMPORT_CSV`, `VOUCHERS.BULK_UPDATE`, `VOUCHERS.METADATA_UPDATE`, `VOUCHERS.METADATA_KEY_PURGE`, `ORDERS.IMPORT`, `ORDERS.METADATA_KEY_PURGE` |
| status</br>`string` | <p>Status of async action. Informs you whether the async action has already been completed.</p> Available values: `ENQUEUED`, `IN_PROGRESS`, `DONE`, `FAILED` |
| result | Any of: [CAMPAIGN.VOUCHERS_IMPORT](#campaign.vouchers_import), [CAMPAIGN.VOUCHERS_IMPORT_CSV](#campaign.vouchers_import_csv), [CAMPAIGN.VOUCHERS_UPDATE](#campaign.vouchers_update), [CAMPAIGN.VOUCHERS_DELETE](#campaign.vouchers_delete), [CAMPAIGN.VOUCHERS_GENERATE](#campaign.vouchers_generate), [CAMPAIGNS.METADATA_KEY_PURGE](#campaigns.metadata_key_purge), [CUSTOMERS.IMPORT_CSV](#customers.import_csv), [CUSTOMERS.BULK_UPDATE](#customers.bulk_update), [CUSTOMERS.METADATA_UPDATE](#customers.metadata_update), [CUSTOMERS.METADATA_KEY_PURGE](#customers.metadata_key_purge), [PRODUCTS.BULK_UPDATE](#products.bulk_update), [PRODUCTS.METADATA_UPDATE](#products.metadata_update), [PRODUCTS.IMPORT_CSV](#products.import_csv), [SKUS.IMPORT_CSV](#skus.import_csv), [PRODUCTS.METADATA_KEY_PURGE](#products.metadata_key_purge), [VOUCHERS.IMPORT](#vouchers.import), [VOUCHERS.IMPORT_CSV](#vouchers.import_csv), [VOUCHERS.BULK_UPDATE](#vouchers.bulk_update), [VOUCHERS.METADATA_UPDATE](#vouchers.metadata_update), [VOUCHERS.METADATA_KEY_PURGE](#vouchers.metadata_key_purge), [ORDERS.IMPORT](#orders.import), [ORDERS.METADATA_KEY_PURGE](#orders.metadata_key_purge) |
| result | One of: [CAMPAIGN.VOUCHERS_IMPORT](#campaign.vouchers_import), [CAMPAIGN.VOUCHERS_IMPORT_CSV](#campaign.vouchers_import_csv), [CAMPAIGN.VOUCHERS_UPDATE](#campaign.vouchers_update), [CAMPAIGN.VOUCHERS_DELETE](#campaign.vouchers_delete), [CAMPAIGN.VOUCHERS_GENERATE](#campaign.vouchers_generate), [CAMPAIGNS.METADATA_KEY_PURGE](#campaigns.metadata_key_purge), [CUSTOMERS.IMPORT_CSV](#customers.import_csv), [CUSTOMERS.BULK_UPDATE](#customers.bulk_update), [CUSTOMERS.METADATA_UPDATE](#customers.metadata_update), [CUSTOMERS.METADATA_KEY_PURGE](#customers.metadata_key_purge), [PRODUCTS.BULK_UPDATE](#products.bulk_update), [PRODUCTS.METADATA_UPDATE](#products.metadata_update), [PRODUCTS.IMPORT_CSV](#products.import_csv), [SKUS.IMPORT_CSV](#skus.import_csv), [PRODUCTS.METADATA_KEY_PURGE](#products.metadata_key_purge), [VOUCHERS.IMPORT](#vouchers.import), [VOUCHERS.IMPORT_CSV](#vouchers.import_csv), [VOUCHERS.BULK_UPDATE](#vouchers.bulk_update), [VOUCHERS.METADATA_UPDATE](#vouchers.metadata_update), [VOUCHERS.METADATA_KEY_PURGE](#vouchers.metadata_key_purge), [ORDERS.IMPORT](#orders.import), [ORDERS.METADATA_KEY_PURGE](#orders.metadata_key_purge) |
| created_at</br>`string` | <p>Timestamp representing the date and time when the async action was scheduled in ISO 8601 format.</p> **Example:** <p>2022-06-23T11:21:45.578Z</p> |
| updated_at</br>`string` | <p>Timestamp representing the date and time when the async action was updated in ISO 8601 format.</p> **Example:** <p>2022-06-23T11:21:46.795Z</p> |
| request_id</br>`string` | <p>Unique request ID.</p> **Example:** <p>v-0b45cee140c3c9b5ca</p> |
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ All of:
## Discount
<p>Contains information about discount.</p>

Any of:
One of:

[Amount](#amount), [Unit](#unit), [Unit Multiple](#unit-multiple), [Percent](#percent), [Fixed](#fixed)

Expand Down
20 changes: 10 additions & 10 deletions docs/reference-docs/CUSTOMERS-API-Customer-Activity-Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ order: 2
## Customer Activity Data
<p>Event data object schema.</p>

Any of:
One of:

[Event Customer Confirmed](#event-customer-confirmed), [Event Customer Created](#event-customer-created), [Event Customer Updated](#event-customer-updated), [Event Customer Deleted](#event-customer-deleted), [Event Customer Referred](#event-customer-referred), [Event Customer Custom Event](#event-customer-custom-event), [Event Customer Segment Entered](#event-customer-segment-entered), [Event Customer Segment Left](#event-customer-segment-left), [Event Customer SMS Sent](#event-customer-sms-sent), [Event Customer SMS Recovered](#event-customer-sms-recovered), [Event Customer SMS Failed](#event-customer-sms-failed), [Event Customer Email Sent](#event-customer-email-sent), [Event Customer Email Recovered](#event-customer-email-recovered), [Event Customer Email Failed](#event-customer-email-failed), [Event Customer ActiveCampaign Sent](#event-customer-activecampaign-sent), [Event Customer ActiveCampaign Recovered](#event-customer-activecampaign-recovered), [Event Customer ActiveCampaign Failed](#event-customer-activecampaign-failed), [Event Customer Braze Sent](#event-customer-braze-sent), [Event Customer Braze Recovered](#event-customer-braze-recovered), [Event Customer Braze Failed](#event-customer-braze-failed), [Event Customer Mailchimp Sent](#event-customer-mailchimp-sent), [Event Customer Mailchimp Recovered](#event-customer-mailchimp-recovered), [Event Customer Mailchimp Failed](#event-customer-mailchimp-failed), [Event Customer Intercom Sent](#event-customer-intercom-sent), [Event Customer Intercom Recovered](#event-customer-intercom-recovered), [Event Customer Intercom Failed](#event-customer-intercom-failed), [Event Customer Shopify Sent](#event-customer-shopify-sent), [Event Customer Shopify Recovered](#event-customer-shopify-recovered), [Event Customer Shopify Failed](#event-customer-shopify-failed), [Event Customer Klaviyo Sent](#event-customer-klaviyo-sent), [Event Customer Klaviyo Recovered](#event-customer-klaviyo-recovered), [Event Customer Klaviyo Failed](#event-customer-klaviyo-failed), [Event Customer Batch Sent](#event-customer-batch-sent), [Event Customer Batch Recovered](#event-customer-batch-recovered), [Event Customer Batch Failed](#event-customer-batch-failed), [Event Customer Rewarded](#event-customer-rewarded), [Event Customer Rewarded Loyalty Points](#event-customer-rewarded-loyalty-points), [Event Customer Gift Voucher Balance Added](#event-customer-gift-voucher-balance-added), [Event Customer Loyalty Card Points Added](#event-customer-loyalty-card-points-added), [Event Customer Loyalty Card Points Transferred](#event-customer-loyalty-card-points-transferred), [Event Customer Loyalty Card Points Expired](#event-customer-loyalty-card-points-expired), [Event Customer Voucher Deleted](#event-customer-voucher-deleted), [Event Customer Publication Succeeded](#event-customer-publication-succeeded), [Event Customer Publication Failed](#event-customer-publication-failed), [Event Customer Validation Succeeded](#event-customer-validation-succeeded), [Event Customer Validation Failed](#event-customer-validation-failed), [Event Customer Redemption Succeeded](#event-customer-redemption-succeeded), [Event Customer Redemption Failed](#event-customer-redemption-failed), [Event Customer Redemption Rollback Succeeded](#event-customer-redemption-rollback-succeeded), [Event Customer Redemption Rollback Failed](#event-customer-redemption-rollback-failed), [Event Customer Consents Given](#event-customer-consents-given), [Event Customer Consents Revoked](#event-customer-consents-revoked), [Event Customer Order Canceled](#event-customer-order-canceled), [Event Customer Order Created](#event-customer-order-created), [Event Customer Order Fulfilled](#event-customer-order-fulfilled), [Event Customer Order Paid](#event-customer-order-paid), [Event Customer Order Processing](#event-customer-order-processing), [Event Customer Order Updated](#event-customer-order-updated), [Event Customer Reward Redemptions Created](#event-customer-reward-redemptions-created), [Event Customer Reward Redemptions Pending](#event-customer-reward-redemptions-pending), [Event Customer Reward Redemptions Completed](#event-customer-reward-redemptions-completed), [Event Customer Reward Redemptions Rolled Back](#event-customer-reward-redemptions-rolled-back), [Event Customer Loyalty Updated](#event-customer-loyalty-updated), [Event Customer Loyalty Tier Upgraded](#event-customer-loyalty-tier-upgraded), [Event Customer Loyalty Tier Downgraded](#event-customer-loyalty-tier-downgraded), [Event Customer Loyalty Tier Prolonged](#event-customer-loyalty-tier-prolonged), [Event Customer Loyalty Tier Expiration Changed](#event-customer-loyalty-tier-expiration-changed), [Event Customer Loyalty Tier Joined](#event-customer-loyalty-tier-joined), [Event Customer Loyalty Tier Left](#event-customer-loyalty-tier-left)

Expand Down Expand Up @@ -691,7 +691,7 @@ All of:
All of:

1. [Order Response Base](#order-response-base)
2. <h3>Order Response</h3><table><thead><tr><th style="text-align:left">Attributes</th><th style="text-align:left">Description</th></tr></thead><tbody><tr><td style="text-align:left">customer</td><td style="text-align:left">Any of: <a href="#customer-response">Customer Response</a>, <a href="#customer-id">Customer Id</a></td></tr><tr><td style="text-align:left">referrer</td><td style="text-align:left">Any of: <a href="#referrer-response">Referrer Response</a>, <a href="#referrer-id">Referrer Id</a></td></tr></tbody></table>
2. <h3>Order Response</h3><table><thead><tr><th style="text-align:left">Attributes</th><th style="text-align:left">Description</th></tr></thead><tbody><tr><td style="text-align:left">customer</td><td style="text-align:left">One of: <a href="#customer-response">Customer Response</a>, <a href="#customer-id">Customer Id</a></td></tr><tr><td style="text-align:left">referrer</td><td style="text-align:left">One of: <a href="#referrer-response">Referrer Response</a>, <a href="#referrer-id">Referrer Id</a></td></tr></tbody></table>

## Voucher Transaction
| Attributes | Description |
Expand Down Expand Up @@ -828,7 +828,7 @@ All of:
## Discount
<p>Contains information about discount.</p>

Any of:
One of:

[Amount](#amount), [Unit](#unit), [Unit Multiple](#unit-multiple), [Percent](#percent), [Fixed](#fixed)

Expand Down Expand Up @@ -949,7 +949,7 @@ Any of:
|:-----|:--------|
| id</br>`string` | <p>Assigned by the Voucherify API, identifies the earning rule object.</p> |
| created_at</br>`string` | <p>Timestamp representing the date and time when the earning rule was created in ISO 8601 format.</p> |
| loyalty | Any of: [Define fixed amount of points](#define-fixed-amount-of-points), [Calculate points proportionally](#calculate-points-proportionally) |
| loyalty | One of: [Define fixed amount of points](#define-fixed-amount-of-points), [Calculate points proportionally](#calculate-points-proportionally) |
| event | <p>Defines the event which triggers the earning rule to add points to a loyalty card.</p> See: [Earning Rule Event](#earning-rule-event) |
| custom_event</br>`object` | <table><thead><tr><th style="text-align:left">Attributes</th><th style="text-align:left">Description</th></tr></thead><tbody><tr><td style="text-align:left">schema_id</br><code>string</code></td><td style="text-align:left"></td></tr></tbody></table> |
| segment</br>`object` | <p>Contains the id of a customer segment. Required for the customer.segment.entered option in event.</p> <table><thead><tr><th style="text-align:left">Attributes</th><th style="text-align:left">Description</th></tr></thead><tbody><tr><td style="text-align:left">id</br><code>string</code></td><td style="text-align:left"><p>Contains a unique identifier of a customer segment. Assigned by the Voucherify API.</p></td></tr></tbody></table> |
Expand Down Expand Up @@ -1014,7 +1014,7 @@ Available values: `POINTS_ACCRUAL`, `POINTS_CANCELLATION`, `POINTS_REDEMPTION`,
| order | See: [Order Response](#order-response) |
| applicable_to | See: [Applicable To](#applicable-to) |
| inapplicable_to | See: [Inapplicable To](#inapplicable-to) |
| result | <p>Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.</p> Any of: [Coupon Code](#coupon-code), [Gift Card](#gift-card), [Loyalty Card](#loyalty-card), [Promotion Tier](#promotion-tier), [Promotion Stack](#promotion-stack) |
| result | <p>Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.</p> One of: [Coupon Code](#coupon-code), [Gift Card](#gift-card), [Loyalty Card](#loyalty-card), [Promotion Tier](#promotion-tier), [Promotion Stack](#promotion-stack) |
| metadata</br>`object` | <p>The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable.</p> |
| categories</br>`array` | Array of [Category](#category) |

Expand Down Expand Up @@ -1209,7 +1209,7 @@ All of:
| total</br>`integer` | <p>Total number of validation rule assignments.</p> |

## MappingPoints
Any of:
One of:

[MappingMultiply](#mappingmultiply), [MappingFixed](#mappingfixed)

Expand All @@ -1220,7 +1220,7 @@ Any of:
| points</br>`integer` | <p>Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points.</p> |

## Calculate points proportionally
Any of:
One of:

[Order](#order), [Order Items](#order-items), [Customer Metadata](#customer-metadata), [Custom Event](#custom-event)

Expand Down Expand Up @@ -1301,7 +1301,7 @@ All of:
## Promotion Tier
| Attributes | Description |
|:-----|:--------|
| discount | <p>Discount details about the type of discount to be applied for the redeemable.</p> Any of: [Amount](#amount), [Unit](#unit), [Unit Multiple](#unit-multiple), [Percent](#percent), [Fixed](#fixed) |
| discount | <p>Discount details about the type of discount to be applied for the redeemable.</p> One of: [Amount](#amount), [Unit](#unit), [Unit Multiple](#unit-multiple), [Percent](#percent), [Fixed](#fixed) |

## Promotion Stack
| Attributes | Description |
Expand Down Expand Up @@ -1429,12 +1429,12 @@ One of:
| points</br>`integer` | <p>Fixed number of points to be applied.</p> |

## Order
Any of:
One of:

[Order Amount](#order-amount), [Order Total Amount](#order-total-amount), [Order Metadata](#order-metadata)

## Order Items
Any of:
One of:

[Order Items Quantity](#order-items-quantity), [Order Items Amount](#order-items-amount), [Order Items Subtotal Amount](#order-items-subtotal-amount)

Expand Down
4 changes: 2 additions & 2 deletions docs/reference-docs/EXPORTS-API-Export-Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ order: 1
All of:

1. [Export Base](#export-base)
2. Any of: [Export Vouchers](#export-vouchers), [Export Redemptions](#export-redemptions), [Export Customers](#export-customers), [Export Publications](#export-publications), [Export Orders](#export-orders), [Export Points Expirations](#export-points-expirations), [Export Vouchers Transactions Expiration](#export-vouchers-transactions-expiration)
2. One of: [Export Vouchers](#export-vouchers), [Export Redemptions](#export-redemptions), [Export Customers](#export-customers), [Export Publications](#export-publications), [Export Orders](#export-orders), [Export Points Expirations](#export-points-expirations), [Export Vouchers Transactions Expiration](#export-vouchers-transactions-expiration)

## Export Base
| Attributes | Description |
Expand Down Expand Up @@ -298,7 +298,7 @@ Available values: `and`, `AND`, `or`, `OR`
| $count_more | See: [Any](#any) |

## Any
Any of:
One of:

1. Array any of: string, number, object
2. string
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-docs/LOCATIONS-API-Location-Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ order: 1
| id</br>`string` | <p>Unique location ID, assigned by the Voucherify API.</p> **Example:** <p>loc_NoMGXmHO9OUs7iz9mGWpamma</p> |
| object</br>`string` | <p>The type of object represented by JSON. This object stores information about a <code>location</code>.</p> |
| name</br>`string` | <p>Location name.</p> |
| shape</br>`object` | <p>Defines the shape and boundaries of the location.</p> Any of: [Circle](#circle), [Polygon](#polygon) |
| shape</br>`object` | <p>Defines the shape and boundaries of the location.</p> One of: [Circle](#circle), [Polygon](#polygon) |
| created_at</br>`string` | <p>Timestamp representing the date and time when the location was created in ISO 8601 format.</p> **Example:** <p>2022-02-14T15:12:06.817Z</p> |
| updated_at</br>`string` | <p>Timestamp representing the date and time when the location was updated in ISO 8601 format.</p> **Example:** <p>2022-03-14T15:12:06.817Z</p> |

Expand Down
8 changes: 4 additions & 4 deletions docs/reference-docs/LOYALTIES-API-Earning-Rule-Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ All of:
|:-----|:--------|
| id</br>`string` | <p>Assigned by the Voucherify API, identifies the earning rule object.</p> |
| created_at</br>`string` | <p>Timestamp representing the date and time when the earning rule was created in ISO 8601 format.</p> |
| loyalty | Any of: [Define fixed amount of points](#define-fixed-amount-of-points), [Calculate points proportionally](#calculate-points-proportionally) |
| loyalty | One of: [Define fixed amount of points](#define-fixed-amount-of-points), [Calculate points proportionally](#calculate-points-proportionally) |
| event | <p>Defines the event which triggers the earning rule to add points to a loyalty card.</p> See: [Earning Rule Event](#earning-rule-event) |
| custom_event</br>`object` | <table><thead><tr><th style="text-align:left">Attributes</th><th style="text-align:left">Description</th></tr></thead><tbody><tr><td style="text-align:left">schema_id</br><code>string</code></td><td style="text-align:left"></td></tr></tbody></table> |
| segment</br>`object` | <p>Contains the id of a customer segment. Required for the customer.segment.entered option in event.</p> <table><thead><tr><th style="text-align:left">Attributes</th><th style="text-align:left">Description</th></tr></thead><tbody><tr><td style="text-align:left">id</br><code>string</code></td><td style="text-align:left"><p>Contains a unique identifier of a customer segment. Assigned by the Voucherify API.</p></td></tr></tbody></table> |
Expand All @@ -39,20 +39,20 @@ All of:
| points</br>`integer` | <p>Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points.</p> |

## Calculate points proportionally
Any of:
One of:

[Order](#order), [Order Items](#order-items), [Customer Metadata](#customer-metadata), [Custom Event](#custom-event)

## Earning Rule Event
Available values: `order.paid`, `customer.segment.entered`, `custom_event`, `customer.loyalty.tier.upgraded`, `customer.loyalty.tier.downgraded`, `customer.loyalty.tier.prolonged`, `customer.loyalty.tier.joined`, `customer.loyalty.tier.left`

## Order
Any of:
One of:

[Order Amount](#order-amount), [Order Total Amount](#order-total-amount), [Order Metadata](#order-metadata)

## Order Items
Any of:
One of:

[Order Items Quantity](#order-items-quantity), [Order Items Amount](#order-items-amount), [Order Items Subtotal Amount](#order-items-subtotal-amount)

Expand Down
Loading

0 comments on commit 1c5f1f9

Please sign in to comment.