From 37ebcdb3ce83650f571071c80ba6a911891487f6 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:11:00 +0200 Subject: [PATCH] separate the coin reward assignment and campaign/material reward assignment --- reference/OpenAPI.json | 102 ++++++++++++++++++++++++++++++----------- 1 file changed, 76 insertions(+), 26 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 90ca96c40..88e5ec1d3 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -10452,28 +10452,6 @@ "enum": [ "campaign" ] - }, - "parameters": { - "description": "Defines the cost of the reward.", - "type": "object", - "properties": { - "loyalty": { - "type": "object", - "description": "Defines the equivalent points value of the reward.", - "required": [ - "points" - ], - "properties": { - "points": { - "type": "integer", - "description": "The number of points required to redeem the reward." - } - } - } - }, - "required": [ - "loyalty" - ] } }, "required": [ @@ -10539,8 +10517,54 @@ "object" ] }, + "reward_assignment_campaign_and_material_reward_parameters": { + "title": "Reward Assignment Campaign and MAterial Reward Parameters", + "type": "object", + "x-tags": [ + "REWARDS API" + ], + "properties": { + "parameters": { + "description": "Defines the cost of the reward.", + "type": "object", + "properties": { + "loyalty": { + "type": "object", + "description": "Defines the equivalent points value of the reward.", + "required": [ + "points" + ], + "properties": { + "points": { + "type": "integer", + "description": "The number of points required to redeem the reward." + } + } + } + }, + "required": [ + "loyalty" + ] + } + }, + "required": [ + "parameters" + ] + }, "reward_assignment": { "title": "Reward Assignment", + "oneOf": [ + { + "$ref": "#/components/schemas/reward_assignment_coin_reward" + }, + { + "$ref": "#/components/schemas/reward_assignment_campaign_and_material_reward" + } + ], + "type": "object" + }, + "reward_assignment_coin_reward": { + "title": "Reward Assignment - Coin Reward", "allOf": [ { "$ref": "#/components/schemas/reward_assignment_identity" @@ -10554,6 +10578,24 @@ ], "type": "object" }, + "reward_assignment_campaign_and_material_reward": { + "title": "Reward Assignment - Campaign and Material Reward", + "allOf": [ + { + "$ref": "#/components/schemas/reward_assignment_identity" + }, + { + "$ref": "#/components/schemas/reward_assignment_base" + }, + { + "$ref": "#/components/schemas/reward_assignment_response_data" + }, + { + "$ref": "#/components/schemas/reward_assignment_campaign_and_material_reward_parameters" + } + ], + "type": "object" + }, "rewards_list_assignments_response_body": { "type": "object", "description": "Response body schema for **GET** `/rewards/{rewardID}/assignments`.", @@ -10592,14 +10634,14 @@ "title": "Create Reward Assignment Request Body", "oneOf": [ { - "$ref": "#/components/schemas/rewards_create_assignment_main_reward_request_body" + "$ref": "#/components/schemas/rewards_create_assignment_campaign_and_material_reward_request_body" }, { "$ref": "#/components/schemas/rewards_create_assignment_coin_reward_request_body" } ] }, - "rewards_create_assignment_main_reward_request_body": { + "rewards_create_assignment_campaign_and_material_reward_request_body": { "description": "Request body schema for **POST** `/rewards/{rewardID}/assignments`.", "title": "Main Reward", "properties": { @@ -10635,16 +10677,24 @@ "rewards_create_assignment_coin_reward_request_body": { "description": "Request body schema for **POST** `/rewards/{rewardID}/assignments`.", "title": "Coin Reward", + "type": "object", "properties": { "campaign": { "type": "string", "description": "The campaign ID of the campaign to which the reward is to be assigned." + }, + "validation_rules": { + "type": "array", + "items": { + "type": "string", + "maxLength": 1, + "minLength": 0 + } } }, "required": [ "campaign" - ], - "type": "object" + ] }, "5_obj_publication_object": { "title": "Publication Object",