From 6a3c656de5377ca7677548baa0a259edfc9c9ffe Mon Sep 17 00:00:00 2001 From: jorgemucientesfayos Date: Thu, 26 Sep 2024 16:09:20 +0200 Subject: [PATCH] Add new objective parameter to create campaign request --- .../android/fluxc/model/blaze/BlazeCampaignCreationRequest.kt | 3 ++- .../fluxc/network/rest/wpcom/blaze/BlazeCreationRestClient.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fluxc/src/main/java/org/wordpress/android/fluxc/model/blaze/BlazeCampaignCreationRequest.kt b/fluxc/src/main/java/org/wordpress/android/fluxc/model/blaze/BlazeCampaignCreationRequest.kt index c2d0ae195f..05d0c97d7b 100644 --- a/fluxc/src/main/java/org/wordpress/android/fluxc/model/blaze/BlazeCampaignCreationRequest.kt +++ b/fluxc/src/main/java/org/wordpress/android/fluxc/model/blaze/BlazeCampaignCreationRequest.kt @@ -20,7 +20,8 @@ data class BlazeCampaignCreationRequest( val mainImage: MediaModel, val targetingParameters: BlazeTargetingParameters?, val timeZoneId: String = TimeZone.getDefault().id, - val isEndlessCampaign: Boolean + val isEndlessCampaign: Boolean, + val objectiveId: String ) data class BlazeCampaignCreationRequestBudget( diff --git a/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/blaze/BlazeCreationRestClient.kt b/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/blaze/BlazeCreationRestClient.kt index 618ccb8322..004458d8f3 100644 --- a/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/blaze/BlazeCreationRestClient.kt +++ b/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/blaze/BlazeCreationRestClient.kt @@ -248,7 +248,8 @@ class BlazeCreationRestClient @Inject constructor( "page_topics" to it.topics ).filterNotNull() }, - "is_evergreen" to request.isEndlessCampaign + "is_evergreen" to request.isEndlessCampaign, + "objective" to request.objectiveId ).filterNotNull() val response = wpComNetwork.executePostGsonRequest(