From 181e629166cb15e51ce18b95e6ef2dd526f91b66 Mon Sep 17 00:00:00 2001 From: lararojasmr Date: Wed, 5 Oct 2016 04:05:26 -0430 Subject: [PATCH 01/27] =?UTF-8?q?Primer=20commit,=20se=20trabajara=20imple?= =?UTF-8?q?mentando=20campa=C3=B1as=20qun=20no=20implementado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../method/v3_0/campaign/CampaignInfo.kt | 83 ++++++++++++++ .../v3_0/campaign/DeleteCampaignMethod.kt | 25 ++++ .../v3_0/campaign/EditCampaignMethod.kt | 108 ++++++++++++++++++ .../method/v3_0/campaign/GetCampaignMethod.kt | 30 +++++ .../v3_0/campaign/GetCampaignsMethod.kt | 68 +++++++++++ 5 files changed, 314 insertions(+) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/DeleteCampaignMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/EditCampaignMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt new file mode 100644 index 0000000..7fceead --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt @@ -0,0 +1,83 @@ +package com.ecwid.maleorang.method.v3_0.lists.members + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class MemberInfo : MailchimpObject() { + @JvmField + @Field + var id: String? = null + + @JvmField + @Field + var email_address: String? = null + + @JvmField + @Field + var unique_email_id: String? = null + + @JvmField + @Field + var status: String? = null + + @JvmField + @Field + var merge_fields: MailchimpObject? = null + + @JvmField + @Field + var interests: MailchimpObject? = null + + @JvmField + @Field + var stats: MailchimpObject? = null + + @JvmField + @Field + var ip_signup: String? = null + + @JvmField + @Field + var timestamp_signup: Date? = null + + @JvmField + @Field + var ip_opt: String? = null + + @JvmField + @Field + var timestamp_opt: Date? = null + + @JvmField + @Field + var member_rating: Int? = null + + @JvmField + @Field + var last_changed: Date? = null + + @JvmField + @Field + var language: String? = null + + @JvmField + @Field + var vip: Boolean? = null + + @JvmField + @Field + var email_client: String? = null + + @JvmField + @Field + var location: MailchimpObject? = null + + @JvmField + @Field + var last_note: MailchimpObject? = null + + @JvmField + @Field + var list_id: String? = null +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/DeleteCampaignMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/DeleteCampaignMethod.kt new file mode 100644 index 0000000..2b73d4f --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/DeleteCampaignMethod.kt @@ -0,0 +1,25 @@ +package com.ecwid.maleorang.method.v3_0.lists.members + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.APIVersion +import com.ecwid.maleorang.annotation.HttpMethod +import com.ecwid.maleorang.annotation.Method +import com.ecwid.maleorang.annotation.PathParam +import org.apache.commons.codec.digest.DigestUtils + +/** + * [Remove a list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#delete-delete_lists_list_id_members_subscriber_hash) + */ +@Method(httpMethod = HttpMethod.DELETE, version = APIVersion.v3_0, path = "/lists/{list_id}/members/{subscriber_hash}") +class DeleteMemberMethod( + @JvmField + @PathParam + val list_id: String, + + email: String +) : MailchimpMethod() { + @JvmField + @PathParam + val subscriber_hash: String = DigestUtils.md5Hex(email.toLowerCase()) +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/EditCampaignMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/EditCampaignMethod.kt new file mode 100644 index 0000000..d1737d6 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/EditCampaignMethod.kt @@ -0,0 +1,108 @@ +package com.ecwid.maleorang.method.v3_0.lists.members + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import org.apache.commons.codec.digest.DigestUtils +import java.util.* + +/** + * Base class for member create or update operations. + */ +sealed class EditMemberMethod : MailchimpMethod() { + /** + * [Add a new list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#create-post_lists_list_id_members) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/lists/{list_id}/members") + class Create( + @JvmField + @PathParam + val list_id: String, + + @JvmField + @Field + val email_address: String + ) : EditMemberMethod() + + /** + * [Update a list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#edit-patch_lists_list_id_members_subscriber_hash) + */ + @Method(httpMethod = HttpMethod.PATCH, version = APIVersion.v3_0, path = "/lists/{list_id}/members/{subscriber_hash}") + class Update( + @JvmField + @PathParam + val list_id: String, + + email_address: String + ) : EditMemberMethod() { + @JvmField + @PathParam + val subscriber_hash: String = DigestUtils.md5Hex(email_address.toLowerCase()) + } + + /** + * [Add or update a list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#edit-put_lists_list_id_members_subscriber_hash) + */ + @Method(httpMethod = HttpMethod.PUT, version = APIVersion.v3_0, path = "/lists/{list_id}/members/{subscriber_hash}") + class CreateOrUpdate( + @JvmField + @PathParam + val list_id: String, + + @JvmField + @Field + val email_address: String + ) : EditMemberMethod() { + @JvmField + @PathParam + val subscriber_hash: String = DigestUtils.md5Hex(email_address.toLowerCase()) + + @JvmField + @Field + var status_if_new: String? = null + } + + @JvmField + @Field + var email_type: String? = null + + @JvmField + @Field + var status: String? = null + + @JvmField + @Field + var merge_fields: MailchimpObject? = null + + @JvmField + @Field + var interests: MailchimpObject? = null + + @JvmField + @Field + var language: String? = null + + @JvmField + @Field + var vip: Boolean? = null + + @JvmField + @Field + var location: MailchimpObject? = null + + @JvmField + @Field + var ip_signup: String? = null + + @JvmField + @Field + var timestamp_signup: Date? = null + + @JvmField + @Field + var ip_opt: String? = null + + @JvmField + @Field + var timestamp_opt: Date? = null +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt new file mode 100644 index 0000000..b0901a2 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt @@ -0,0 +1,30 @@ +package com.ecwid.maleorang.method.v3_0.lists.members + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.annotation.* +import org.apache.commons.codec.digest.DigestUtils + +/** + * [Get information about a specific list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#read-get_lists_list_id_members_subscriber_hash) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/lists/{list_id}/members/{subscriber_hash}") +class GetMemberMethod( + @JvmField + @PathParam + val list_id: String, + + email: String +) : MailchimpMethod() { + @JvmField + @PathParam + val subscriber_hash: String = DigestUtils.md5Hex(email.toLowerCase()) + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt new file mode 100644 index 0000000..12fe6a2 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt @@ -0,0 +1,68 @@ +package com.ecwid.maleorang.method.v3_0.lists.members + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import java.util.* + +/** + * [Get information about members in a list](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#read-get_lists_list_id_members) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/lists/{list_id}/members") +class GetMembersMethod( + @JvmField + @PathParam + val list_id: String +) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + @JvmField + @QueryStringParam + var count: Int? = null + + @JvmField + @QueryStringParam + var offset: Int? = null + + @JvmField + @QueryStringParam + var email_type: String? = null + + @JvmField + @QueryStringParam + var status: String? = null + + @JvmField + @QueryStringParam + var since_timestamp_opt: Date? = null + + @JvmField + @QueryStringParam + var before_timestamp_opt: Date? = null + + @JvmField + @QueryStringParam + var since_last_changed: Date? = null + + @JvmField + @QueryStringParam + var before_last_changed: Date? = null + + class Response : MailchimpObject() { + @JvmField + @Field + var members: List? = null + + @JvmField + @Field + var total_items: Int? = null + } +} From f0c7045a8d9f8ecc87fc355342ca1d1d5a8d0283 Mon Sep 17 00:00:00 2001 From: lararojasmr Date: Wed, 5 Oct 2016 17:04:04 -0430 Subject: [PATCH 02/27] =?UTF-8?q?Se=20impelemtan=20los=20metodos=20de=20co?= =?UTF-8?q?nsulta=20para=20campa=C3=B1as.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish.gradle | 7 +- .../method/v3_0/campaign/CampaignInfo.kt | 77 +++---------- .../v3_0/campaign/DeleteCampaignMethod.kt | 25 ---- .../v3_0/campaign/EditCampaignMethod.kt | 108 ------------------ .../method/v3_0/campaign/GetCampaignMethod.kt | 13 +-- .../v3_0/campaign/GetCampaignsMethod.kt | 33 +++--- 6 files changed, 46 insertions(+), 217 deletions(-) delete mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/DeleteCampaignMethod.kt delete mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/EditCampaignMethod.kt diff --git a/publish.gradle b/publish.gradle index edb7d28..ad139e2 100644 --- a/publish.gradle +++ b/publish.gradle @@ -3,7 +3,7 @@ apply plugin: 'signing' group = 'com.ecwid' archivesBaseName = "maleorang" -version = '3.0-0.9.4' +version = '3.0-0.9.5' task javadocJar(type: Jar) { classifier = 'javadoc' @@ -64,6 +64,11 @@ if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePass name 'Vasily Karyaev' email 'v.karyaev@gmail.com' } + developer { + id 'lararojasmr' + name 'Manuel Lara' + email 'lararojas.mr@gmail.com' + } } } } diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt index 7fceead..f9d9f64 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt @@ -1,83 +1,44 @@ -package com.ecwid.maleorang.method.v3_0.lists.members +package com.ecwid.maleorang.method.v3_0.campaign import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* -class MemberInfo : MailchimpObject() { +class CampaignInfo : MailchimpObject() { @JvmField @Field var id: String? = null - - @JvmField - @Field - var email_address: String? = null - - @JvmField - @Field - var unique_email_id: String? = null - - @JvmField - @Field - var status: String? = null - - @JvmField - @Field - var merge_fields: MailchimpObject? = null - - @JvmField - @Field - var interests: MailchimpObject? = null - - @JvmField - @Field - var stats: MailchimpObject? = null - + @JvmField @Field - var ip_signup: String? = null - - @JvmField - @Field - var timestamp_signup: Date? = null - - @JvmField - @Field - var ip_opt: String? = null - - @JvmField - @Field - var timestamp_opt: Date? = null - + var type: String? = null + @JvmField @Field - var member_rating: Int? = null - + var create_time: String? = null + @JvmField @Field - var last_changed: Date? = null - - @JvmField - @Field - var language: String? = null - + var archive_url: String? = null + @JvmField @Field - var vip: Boolean? = null - + var long_archive_url: String? = null + @JvmField @Field - var email_client: String? = null - + var status: String? = null + @JvmField @Field - var location: MailchimpObject? = null - + var emails_sent: Int? = null + @JvmField @Field - var last_note: MailchimpObject? = null - + var content_type: String? = null + @JvmField @Field - var list_id: String? = null + var recipients: MailchimpObject? = null + } diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/DeleteCampaignMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/DeleteCampaignMethod.kt deleted file mode 100644 index 2b73d4f..0000000 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/DeleteCampaignMethod.kt +++ /dev/null @@ -1,25 +0,0 @@ -package com.ecwid.maleorang.method.v3_0.lists.members - -import com.ecwid.maleorang.MailchimpMethod -import com.ecwid.maleorang.MailchimpObject -import com.ecwid.maleorang.annotation.APIVersion -import com.ecwid.maleorang.annotation.HttpMethod -import com.ecwid.maleorang.annotation.Method -import com.ecwid.maleorang.annotation.PathParam -import org.apache.commons.codec.digest.DigestUtils - -/** - * [Remove a list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#delete-delete_lists_list_id_members_subscriber_hash) - */ -@Method(httpMethod = HttpMethod.DELETE, version = APIVersion.v3_0, path = "/lists/{list_id}/members/{subscriber_hash}") -class DeleteMemberMethod( - @JvmField - @PathParam - val list_id: String, - - email: String -) : MailchimpMethod() { - @JvmField - @PathParam - val subscriber_hash: String = DigestUtils.md5Hex(email.toLowerCase()) -} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/EditCampaignMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/EditCampaignMethod.kt deleted file mode 100644 index d1737d6..0000000 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/EditCampaignMethod.kt +++ /dev/null @@ -1,108 +0,0 @@ -package com.ecwid.maleorang.method.v3_0.lists.members - -import com.ecwid.maleorang.MailchimpMethod -import com.ecwid.maleorang.MailchimpObject -import com.ecwid.maleorang.annotation.* -import org.apache.commons.codec.digest.DigestUtils -import java.util.* - -/** - * Base class for member create or update operations. - */ -sealed class EditMemberMethod : MailchimpMethod() { - /** - * [Add a new list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#create-post_lists_list_id_members) - */ - @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/lists/{list_id}/members") - class Create( - @JvmField - @PathParam - val list_id: String, - - @JvmField - @Field - val email_address: String - ) : EditMemberMethod() - - /** - * [Update a list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#edit-patch_lists_list_id_members_subscriber_hash) - */ - @Method(httpMethod = HttpMethod.PATCH, version = APIVersion.v3_0, path = "/lists/{list_id}/members/{subscriber_hash}") - class Update( - @JvmField - @PathParam - val list_id: String, - - email_address: String - ) : EditMemberMethod() { - @JvmField - @PathParam - val subscriber_hash: String = DigestUtils.md5Hex(email_address.toLowerCase()) - } - - /** - * [Add or update a list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#edit-put_lists_list_id_members_subscriber_hash) - */ - @Method(httpMethod = HttpMethod.PUT, version = APIVersion.v3_0, path = "/lists/{list_id}/members/{subscriber_hash}") - class CreateOrUpdate( - @JvmField - @PathParam - val list_id: String, - - @JvmField - @Field - val email_address: String - ) : EditMemberMethod() { - @JvmField - @PathParam - val subscriber_hash: String = DigestUtils.md5Hex(email_address.toLowerCase()) - - @JvmField - @Field - var status_if_new: String? = null - } - - @JvmField - @Field - var email_type: String? = null - - @JvmField - @Field - var status: String? = null - - @JvmField - @Field - var merge_fields: MailchimpObject? = null - - @JvmField - @Field - var interests: MailchimpObject? = null - - @JvmField - @Field - var language: String? = null - - @JvmField - @Field - var vip: Boolean? = null - - @JvmField - @Field - var location: MailchimpObject? = null - - @JvmField - @Field - var ip_signup: String? = null - - @JvmField - @Field - var timestamp_signup: Date? = null - - @JvmField - @Field - var ip_opt: String? = null - - @JvmField - @Field - var timestamp_opt: Date? = null -} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt index b0901a2..f52b009 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.lists.members +package com.ecwid.maleorang.method.v3_0.campaign import com.ecwid.maleorang.MailchimpMethod @@ -8,17 +8,12 @@ import org.apache.commons.codec.digest.DigestUtils /** * [Get information about a specific list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#read-get_lists_list_id_members_subscriber_hash) */ -@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/lists/{list_id}/members/{subscriber_hash}") +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}") class GetMemberMethod( @JvmField @PathParam - val list_id: String, - - email: String -) : MailchimpMethod() { - @JvmField - @PathParam - val subscriber_hash: String = DigestUtils.md5Hex(email.toLowerCase()) + val campaign_id: String +) : MailchimpMethod() { @JvmField @QueryStringParam diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt index 12fe6a2..07ac149 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.lists.members +package com.ecwid.maleorang.method.v3_0.campaign import com.ecwid.maleorang.MailchimpMethod @@ -6,15 +6,8 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.* import java.util.* -/** - * [Get information about members in a list](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#read-get_lists_list_id_members) - */ -@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/lists/{list_id}/members") -class GetMembersMethod( - @JvmField - @PathParam - val list_id: String -) : MailchimpMethod() { +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/campaigns") +class GetCampaignsMethod : MailchimpMethod() { @JvmField @QueryStringParam @@ -34,7 +27,7 @@ class GetMembersMethod( @JvmField @QueryStringParam - var email_type: String? = null + var type: String? = null @JvmField @QueryStringParam @@ -42,24 +35,32 @@ class GetMembersMethod( @JvmField @QueryStringParam - var since_timestamp_opt: Date? = null + var before_send_time: String? = null + + @JvmField + @QueryStringParam + var since_send_opt: String? = null + + @JvmField + @QueryStringParam + var before_create_time: String? = null @JvmField @QueryStringParam - var before_timestamp_opt: Date? = null + var since_create_time: String? = null @JvmField @QueryStringParam - var since_last_changed: Date? = null + var list_id: String? = null @JvmField @QueryStringParam - var before_last_changed: Date? = null + var folder_id: String? = null class Response : MailchimpObject() { @JvmField @Field - var members: List? = null + var campaings: List? = null @JvmField @Field From a24d259a1c72081e141a9f3821c09d8ae2619e7d Mon Sep 17 00:00:00 2001 From: lararojasmr Date: Wed, 5 Oct 2016 20:03:41 -0430 Subject: [PATCH 03/27] =?UTF-8?q?Se=20impelemtan=20los=20metodos=20de=20co?= =?UTF-8?q?nsulta=20para=20reportes=20de=20las=20campa=C3=B1as=20y=20repor?= =?UTF-8?q?tes=20de=20los=20correos=20electronicos.=20Se=20suben=20los=20m?= =?UTF-8?q?odelos,=20se=20corrigen=20detalles=20en=20campa=C3=B1as.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../method/v3_0/campaign/CampaignInfo.kt | 2 +- .../method/v3_0/campaign/GetCampaignMethod.kt | 2 +- .../v3_0/campaign/RecipientsCampaignInfo.kt | 16 +++ .../campaign/report/CampaignBounceReport.kt | 19 +++ .../campaign/report/CampaignClicksReport.kt | 28 +++++ .../report/CampaignDeliveryStatusReport.kt | 28 +++++ .../report/CampaignEcommerceReport.kt | 20 ++++ .../report/CampaignFacebookLikesReport.kt | 20 ++++ .../campaign/report/CampaignForwardsReport.kt | 16 +++ .../report/CampaignIndustryStatsReport.kt | 37 ++++++ .../report/CampaignListStatsReport.kt | 24 ++++ .../campaign/report/CampaignOpensReport.kt | 24 ++++ .../campaign/report/CampaignReportInfo.kt | 108 ++++++++++++++++++ .../campaign/report/CampaignShareVIPReport.kt | 16 +++ .../report/CampaignTimeseriesReport.kt | 24 ++++ .../campaign/report/CampaignTimewarpReport.kt | 44 +++++++ .../report/GetCampaignReportMethod.kt | 53 +++++++++ .../report/GetCampaignsReportsMethod.kt | 50 ++++++++ .../report/email/CampaignEmailActivityInfo.kt | 32 ++++++ .../email/EmailReportActivityDetails.kt | 28 +++++ ...CampaignEmailActivityForSuscriberMethod.kt | 52 +++++++++ .../email/GetCampaignsEmailActivityMethod.kt | 46 ++++++++ 22 files changed, 687 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignBounceReport.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignClicksReport.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignDeliveryStatusReport.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignEcommerceReport.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignFacebookLikesReport.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignForwardsReport.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignIndustryStatsReport.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignListStatsReport.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignOpensReport.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignReportInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignShareVIPReport.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimeseriesReport.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimewarpReport.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignReportMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignsReportsMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/CampaignEmailActivityInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/EmailReportActivityDetails.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignEmailActivityForSuscriberMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignsEmailActivityMethod.kt diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt index f9d9f64..baa99bb 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt @@ -39,6 +39,6 @@ class CampaignInfo : MailchimpObject() { @JvmField @Field - var recipients: MailchimpObject? = null + var recipients: RecipientsCampaignInfo? = null } diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt index f52b009..33e72ac 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt @@ -9,7 +9,7 @@ import org.apache.commons.codec.digest.DigestUtils * [Get information about a specific list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#read-get_lists_list_id_members_subscriber_hash) */ @Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}") -class GetMemberMethod( +class GetCampaignMethod( @JvmField @PathParam val campaign_id: String diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt new file mode 100644 index 0000000..ef23bf0 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt @@ -0,0 +1,16 @@ +package com.ecwid.maleorang.method.v3_0.campaign + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class RecipientsCampaignInfo : MailchimpObject() { + @JvmField + @Field + var list_id: String? = null + + @JvmField + @Field + var segment_opts: MailchimpObject? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignBounceReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignBounceReport.kt new file mode 100644 index 0000000..9ec9174 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignBounceReport.kt @@ -0,0 +1,19 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignBounceReport : MailchimpObject() { + @JvmField + @Field + var hard_bounces: Int? = null + + @JvmField + @Field + var soft_bounces: Int? = null + + @JvmField + @Field + var syntax_errors: Int? = null +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignClicksReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignClicksReport.kt new file mode 100644 index 0000000..0be7d81 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignClicksReport.kt @@ -0,0 +1,28 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignClicksReport : MailchimpObject() { + @JvmField + @Field + var clicks_total: Int? = null + + @JvmField + @Field + var unique_clicks: Int? = null + + @JvmField + @Field + var unique_subscriber_clicks: Int? = null + + @JvmField + @Field + var click_rate: Double? = null + + @JvmField + @Field + var last_click: Date? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignDeliveryStatusReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignDeliveryStatusReport.kt new file mode 100644 index 0000000..3fb4861 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignDeliveryStatusReport.kt @@ -0,0 +1,28 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignDeliveryStatusReport : MailchimpObject() { + @JvmField + @Field + var enabled: Boolean? = null + + @JvmField + @Field + var can_cancel: Boolean? = null + + @JvmField + @Field + var status: String? = null + + @JvmField + @Field + var emails_sent: Int? = null + + @JvmField + @Field + var emails_canceled: Int? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignEcommerceReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignEcommerceReport.kt new file mode 100644 index 0000000..926a9aa --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignEcommerceReport.kt @@ -0,0 +1,20 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignEcommerceReport : MailchimpObject() { + @JvmField + @Field + var total_orders: Int? = null + + @JvmField + @Field + var total_spent: Double? = null + + @JvmField + @Field + var total_revenue: Double? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignFacebookLikesReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignFacebookLikesReport.kt new file mode 100644 index 0000000..dbd5159 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignFacebookLikesReport.kt @@ -0,0 +1,20 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignFacebookLikesReport : MailchimpObject() { + @JvmField + @Field + var recipient_likes: Int? = null + + @JvmField + @Field + var unique_likes: Int? = null + + @JvmField + @Field + var facebook_likes: Int? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignForwardsReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignForwardsReport.kt new file mode 100644 index 0000000..d7d5092 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignForwardsReport.kt @@ -0,0 +1,16 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignForwardsReport : MailchimpObject() { + @JvmField + @Field + var forwards_count: Int? = null + + @JvmField + @Field + var forwards_opens: Int? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignIndustryStatsReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignIndustryStatsReport.kt new file mode 100644 index 0000000..e8a7ef4 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignIndustryStatsReport.kt @@ -0,0 +1,37 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignIndustryStatsReport : MailchimpObject() { + + @JvmField + @Field + var type: String? = null + + @JvmField + @Field + var open_rate: Double? = null + + @JvmField + @Field + var click_rate: Double? = null + + @JvmField + @Field + var bounce_rate: Double? = null + + @JvmField + @Field + var unopen_rate: Double? = null + + @JvmField + @Field + var unsub_rate: Double? = null + + @JvmField + @Field + var abuse_rate: Double? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignListStatsReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignListStatsReport.kt new file mode 100644 index 0000000..62eba99 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignListStatsReport.kt @@ -0,0 +1,24 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignListStatsReport : MailchimpObject() { + @JvmField + @Field + var sub_rate: Double? = null + + @JvmField + @Field + var unsub_rate: Double? = null + + @JvmField + @Field + var open_rate: Double? = null + + @JvmField + @Field + var click_rate: Double? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignOpensReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignOpensReport.kt new file mode 100644 index 0000000..9149b02 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignOpensReport.kt @@ -0,0 +1,24 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignOpensReport : MailchimpObject() { + @JvmField + @Field + var opens_total: Int? = null + + @JvmField + @Field + var unique_opens: Int? = null + + @JvmField + @Field + var open_rate: Double? = null + + @JvmField + @Field + var last_open: Date? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignReportInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignReportInfo.kt new file mode 100644 index 0000000..5b3ebfc --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignReportInfo.kt @@ -0,0 +1,108 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignReportInfo : MailchimpObject() { + @JvmField + @Field + var id: String? = null + + @JvmField + @Field + var campaign_title: String? = null + + @JvmField + @Field + var type: String? = null + + @JvmField + @Field + var list_id: String? = null + + @JvmField + @Field + var list_name: String? = null + + @JvmField + @Field + var subject_line: String? = null + + @JvmField + @Field + var emails_sent: Int? = null + + @JvmField + @Field + var emails_sent: Int? = null + + @JvmField + @Field + var abuse_reports: Int? = null + + @JvmField + @Field + var unsubscribed: Int? = null + + @JvmField + @Field + var send_time: String? = null + + @JvmField + @Field + var rss_last_send: String? = null + + @JvmField + @Field + var bounces: CampaignBounceReport? = null + + @JvmField + @Field + var forwards: CampaignForwardsReport? = null + + @JvmField + @Field + var opens: CampaignOpensReport? = null + + @JvmField + @Field + var clicks: CampaignClicksReport? = null + + @JvmField + @Field + var facebook_likes: CampaignFacebookLikesReport? = null + + @JvmField + @Field + var industry_stats: CampaignIndustryStatsReport? = null + + @JvmField + @Field + var list_stats: CampaignListStatsReport? = null + + @JvmField + @Field + var ab_split: MailchimpObject? = null + + @JvmField + @Field + var timewarp: CampaignTimewarpReport? = null + + @JvmField + @Field + var timeseries: CampaignTimeseriesReport? = null + + @JvmField + @Field + var share_report: CampaignShareVIPReport? = null + + @JvmField + @Field + var ecommerce: CampaignEcommerceReport? = null + + @JvmField + @Field + var delivery_status: CampaignDeliveryStatusReport? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignShareVIPReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignShareVIPReport.kt new file mode 100644 index 0000000..0ab45cf --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignShareVIPReport.kt @@ -0,0 +1,16 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignShareVIPReport : MailchimpObject() { + @JvmField + @Field + var share_url: String? = null + + @JvmField + @Field + var share_password: String? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimeseriesReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimeseriesReport.kt new file mode 100644 index 0000000..1350455 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimeseriesReport.kt @@ -0,0 +1,24 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignTimeseriesReport : MailchimpObject() { + @JvmField + @Field + var timestamp: Date? = null + + @JvmField + @Field + var emails_sent: Int? = null + + @JvmField + @Field + var unique_opens: Int? = null + + @JvmField + @Field + var recipients_clicks: Int? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimewarpReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimewarpReport.kt new file mode 100644 index 0000000..f419b06 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimewarpReport.kt @@ -0,0 +1,44 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignTimewarpReport : MailchimpObject() { + @JvmField + @Field + var gmt_offset: Int? = null + + @JvmField + @Field + var opens: Int? = null + + @JvmField + @Field + var last_open: Date? = null + + @JvmField + @Field + var unique_opens: Int? = null + + @JvmField + @Field + var clicks: Int? = null + + @JvmField + @Field + var subject_line: String? = null + + @JvmField + @Field + var last_click: Date? = null + + @JvmField + @Field + var unique_clicks: Int? = null + + @JvmField + @Field + var bounces: Int? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignReportMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignReportMethod.kt new file mode 100644 index 0000000..b2bc01b --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignReportMethod.kt @@ -0,0 +1,53 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import java.util.* + +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = " /reports/{campaign_id}") +class GetCampaignsReportsMethod( + @JvmField + @PathParam + val campaign_id: String +) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + @JvmField + @QueryStringParam + var count: Int? = null + + @JvmField + @QueryStringParam + var offset: Int? = null + + @JvmField + @QueryStringParam + var type: String? = null + + @JvmField + @QueryStringParam + var before_send_time: String? = null + + @JvmField + @QueryStringParam + var since_send_time: String? = null + + class Response : MailchimpObject() { + @JvmField + @Field + var reports: List? = null + + @JvmField + @Field + var total_items: Int? = null + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignsReportsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignsReportsMethod.kt new file mode 100644 index 0000000..d9dc353 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignsReportsMethod.kt @@ -0,0 +1,50 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import java.util.* + +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/reports") +class GetCampaignsReportsMethod : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + @JvmField + @QueryStringParam + var count: Int? = null + + @JvmField + @QueryStringParam + var offset: Int? = null + + @JvmField + @QueryStringParam + var type: String? = null + + @JvmField + @QueryStringParam + var before_send_time: String? = null + + @JvmField + @QueryStringParam + var since_send_time: String? = null + + + class Response : MailchimpObject() { + @JvmField + @Field + var reports: List? = null + + @JvmField + @Field + var total_items: Int? = null + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/CampaignEmailActivityInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/CampaignEmailActivityInfo.kt new file mode 100644 index 0000000..7b1d5c4 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/CampaignEmailActivityInfo.kt @@ -0,0 +1,32 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report.email + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class CampaignEmailActivityInfo : MailchimpObject() { + @JvmField + @Field + var campaign_id: String? = null + + @JvmField + @Field + var list_id: String? = null + + @JvmField + @Field + var type: String? = null + + @JvmField + @Field + var email_id: String? = null + + @JvmField + @Field + var email_address: String? = null + + @JvmField + @Field + var activity: EmailReportActivityDetails? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/EmailReportActivityDetails.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/EmailReportActivityDetails.kt new file mode 100644 index 0000000..63541e5 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/EmailReportActivityDetails.kt @@ -0,0 +1,28 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report.email + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class EmailReportActivityDetails : MailchimpObject() { + @JvmField + @Field + var action: String? = null + + @JvmField + @Field + var type: String? = null + + @JvmField + @Field + var timestamp: String? = null + + @JvmField + @Field + var url: String? = null + + @JvmField + @Field + var ip: String? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignEmailActivityForSuscriberMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignEmailActivityForSuscriberMethod.kt new file mode 100644 index 0000000..d0b9e6e --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignEmailActivityForSuscriberMethod.kt @@ -0,0 +1,52 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report.email + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import java.util.* + +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = " /reports/{campaign_id}/email-activity/{subscriber_hash}") +class GetCampaignEmailActivityForSuscriberMethod( + @JvmField + @PathParam + val campaign_id: String + + email: String +) : MailchimpMethod() { + + @JvmField + @PathParam + val subscriber_hash: String = DigestUtils.md5Hex(email.toLowerCase()) + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + @JvmField + @QueryStringParam + var count: Int? = null + + @JvmField + @QueryStringParam + var offset: Int? = null + + + class Response : MailchimpObject() { + @JvmField + @Field + var emails: CampaignEmailActivityInfo? = null + + @JvmField + @Field + var campaign_id: String? = null + + @JvmField + @Field + var total_items: Int? = null + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignsEmailActivityMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignsEmailActivityMethod.kt new file mode 100644 index 0000000..df63141 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignsEmailActivityMethod.kt @@ -0,0 +1,46 @@ +package com.ecwid.maleorang.method.v3_0.campaign.report.email + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import java.util.* + +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/reports/{campaign_id}/email-activity") +class GetCampaignsEmailActivityMethod( + @JvmField + @PathParam + val campaign_id: String +) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + @JvmField + @QueryStringParam + var count: Int? = null + + @JvmField + @QueryStringParam + var offset: Int? = null + + + class Response : MailchimpObject() { + @JvmField + @Field + var emails: List? = null + + @JvmField + @Field + var campaign_id: String? = null + + @JvmField + @Field + var total_items: Int? = null + } +} From a50ce331857fde40ee95fcb425e7c9d687972f2c Mon Sep 17 00:00:00 2001 From: lararojasmr Date: Wed, 5 Oct 2016 23:49:01 -0430 Subject: [PATCH 04/27] =?UTF-8?q?Se=20impelemtan=20los=20metodos=20de=20co?= =?UTF-8?q?nsulta=20para=20reportes=20de=20las=20campa=C3=B1as=20y=20repor?= =?UTF-8?q?tes=20de=20los=20correos=20electronicos.=20Se=20suben=20los=20m?= =?UTF-8?q?odelos,=20se=20corrigen=20detalles=20en=20campa=C3=B1as.=20Se?= =?UTF-8?q?=20lava=20el=20codigo=20y=20de=20somentan=20las=20clases=20y=20?= =?UTF-8?q?metodos.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt | 4 ++++ .../maleorang/method/v3_0/campaign/GetCampaignMethod.kt | 3 ++- .../maleorang/method/v3_0/campaign/GetCampaignsMethod.kt | 4 ++++ .../method/v3_0/campaign/RecipientsCampaignInfo.kt | 4 ++++ .../method/v3_0/campaign/report/CampaignBounceReport.kt | 4 ++++ .../method/v3_0/campaign/report/CampaignClicksReport.kt | 4 ++++ .../v3_0/campaign/report/CampaignDeliveryStatusReport.kt | 4 ++++ .../v3_0/campaign/report/CampaignEcommerceReport.kt | 4 ++++ .../v3_0/campaign/report/CampaignFacebookLikesReport.kt | 4 ++++ .../method/v3_0/campaign/report/CampaignForwardsReport.kt | 4 ++++ .../v3_0/campaign/report/CampaignIndustryStatsReport.kt | 4 ++++ .../v3_0/campaign/report/CampaignListStatsReport.kt | 4 ++++ .../method/v3_0/campaign/report/CampaignOpensReport.kt | 4 ++++ .../method/v3_0/campaign/report/CampaignReportInfo.kt | 8 ++++---- .../method/v3_0/campaign/report/CampaignShareVIPReport.kt | 4 ++++ .../v3_0/campaign/report/CampaignTimeseriesReport.kt | 4 ++++ .../method/v3_0/campaign/report/CampaignTimewarpReport.kt | 4 ++++ .../v3_0/campaign/report/GetCampaignReportMethod.kt | 6 +++++- .../v3_0/campaign/report/GetCampaignsReportsMethod.kt | 4 ++++ .../campaign/report/email/CampaignEmailActivityInfo.kt | 4 ++++ .../campaign/report/email/EmailReportActivityDetails.kt | 4 ++++ .../email/GetCampaignEmailActivityForSuscriberMethod.kt | 8 ++++++-- .../report/email/GetCampaignsEmailActivityMethod.kt | 4 ++++ 23 files changed, 93 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt index baa99bb..cc85309 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignInfo : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt index 33e72ac..6b2202e 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignMethod.kt @@ -6,8 +6,9 @@ import com.ecwid.maleorang.annotation.* import org.apache.commons.codec.digest.DigestUtils /** - * [Get information about a specific list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#read-get_lists_list_id_members_subscriber_hash) + * Created by: Manuel Lara */ + @Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}") class GetCampaignMethod( @JvmField diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt index 07ac149..4e0e232 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt @@ -6,6 +6,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.* import java.util.* +/** + * Created by: Manuel Lara + */ + @Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/campaigns") class GetCampaignsMethod : MailchimpMethod() { diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt index ef23bf0..25ac16d 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class RecipientsCampaignInfo : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignBounceReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignBounceReport.kt index 9ec9174..fd8d79d 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignBounceReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignBounceReport.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignBounceReport : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignClicksReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignClicksReport.kt index 0be7d81..517e616 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignClicksReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignClicksReport.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignClicksReport : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignDeliveryStatusReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignDeliveryStatusReport.kt index 3fb4861..794e4c1 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignDeliveryStatusReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignDeliveryStatusReport.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignDeliveryStatusReport : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignEcommerceReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignEcommerceReport.kt index 926a9aa..319f4dd 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignEcommerceReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignEcommerceReport.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignEcommerceReport : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignFacebookLikesReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignFacebookLikesReport.kt index dbd5159..d204443 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignFacebookLikesReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignFacebookLikesReport.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignFacebookLikesReport : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignForwardsReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignForwardsReport.kt index d7d5092..f443312 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignForwardsReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignForwardsReport.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignForwardsReport : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignIndustryStatsReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignIndustryStatsReport.kt index e8a7ef4..0b8e459 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignIndustryStatsReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignIndustryStatsReport.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignIndustryStatsReport : MailchimpObject() { @JvmField diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignListStatsReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignListStatsReport.kt index 62eba99..7ff7b90 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignListStatsReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignListStatsReport.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignListStatsReport : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignOpensReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignOpensReport.kt index 9149b02..9429d07 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignOpensReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignOpensReport.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignOpensReport : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignReportInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignReportInfo.kt index 5b3ebfc..83750e9 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignReportInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignReportInfo.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignReportInfo : MailchimpObject() { @JvmField @Field @@ -33,10 +37,6 @@ class CampaignReportInfo : MailchimpObject() { @Field var emails_sent: Int? = null - @JvmField - @Field - var emails_sent: Int? = null - @JvmField @Field var abuse_reports: Int? = null diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignShareVIPReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignShareVIPReport.kt index 0ab45cf..f66904e 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignShareVIPReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignShareVIPReport.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignShareVIPReport : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimeseriesReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimeseriesReport.kt index 1350455..11d42ed 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimeseriesReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimeseriesReport.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignTimeseriesReport : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimewarpReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimewarpReport.kt index f419b06..45562b7 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimewarpReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimewarpReport.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignTimewarpReport : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignReportMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignReportMethod.kt index b2bc01b..bb9ad6b 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignReportMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignReportMethod.kt @@ -6,8 +6,12 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.* import java.util.* +/** + * Created by: Manuel Lara + */ + @Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = " /reports/{campaign_id}") -class GetCampaignsReportsMethod( +class GetCampaignReportMethod( @JvmField @PathParam val campaign_id: String diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignsReportsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignsReportsMethod.kt index d9dc353..ab5f653 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignsReportsMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignsReportsMethod.kt @@ -6,6 +6,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.* import java.util.* +/** + * Created by: Manuel Lara + */ + @Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/reports") class GetCampaignsReportsMethod : MailchimpMethod() { diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/CampaignEmailActivityInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/CampaignEmailActivityInfo.kt index 7b1d5c4..be4492e 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/CampaignEmailActivityInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/CampaignEmailActivityInfo.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class CampaignEmailActivityInfo : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/EmailReportActivityDetails.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/EmailReportActivityDetails.kt index 63541e5..f1b2564 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/EmailReportActivityDetails.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/EmailReportActivityDetails.kt @@ -4,6 +4,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field import java.util.* +/** + * Created by: Manuel Lara + */ + class EmailReportActivityDetails : MailchimpObject() { @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignEmailActivityForSuscriberMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignEmailActivityForSuscriberMethod.kt index d0b9e6e..e74a5c0 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignEmailActivityForSuscriberMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignEmailActivityForSuscriberMethod.kt @@ -5,13 +5,17 @@ import com.ecwid.maleorang.MailchimpMethod import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.* import java.util.* +import org.apache.commons.codec.digest.DigestUtils + +/** + * Created by: Manuel Lara + */ @Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = " /reports/{campaign_id}/email-activity/{subscriber_hash}") class GetCampaignEmailActivityForSuscriberMethod( @JvmField @PathParam - val campaign_id: String - + val campaign_id: String, email: String ) : MailchimpMethod() { diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignsEmailActivityMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignsEmailActivityMethod.kt index df63141..59e6bb9 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignsEmailActivityMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignsEmailActivityMethod.kt @@ -6,6 +6,10 @@ import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.* import java.util.* +/** + * Created by: Manuel Lara + */ + @Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/reports/{campaign_id}/email-activity") class GetCampaignsEmailActivityMethod( @JvmField From 91ce006948870769864d3297ea29417b28153b03 Mon Sep 17 00:00:00 2001 From: lararojasmr Date: Sat, 15 Oct 2016 12:09:14 -0400 Subject: [PATCH 05/27] I moved report folder out of campaign folder, I created a enum for type in emails report and other fixes. --- .../report => reports}/CampaignBounceReport.kt | 2 +- .../report => reports}/CampaignClicksReport.kt | 2 +- .../CampaignDeliveryStatusReport.kt | 2 +- .../report => reports}/CampaignEcommerceReport.kt | 2 +- .../report => reports}/CampaignFacebookLikesReport.kt | 2 +- .../report => reports}/CampaignForwardsReport.kt | 2 +- .../report => reports}/CampaignIndustryStatsReport.kt | 2 +- .../report => reports}/CampaignListStatsReport.kt | 2 +- .../report => reports}/CampaignOpensReport.kt | 2 +- .../report => reports}/CampaignReportInfo.kt | 2 +- .../report => reports}/CampaignShareVIPReport.kt | 2 +- .../report => reports}/CampaignTimeseriesReport.kt | 2 +- .../report => reports}/CampaignTimewarpReport.kt | 4 ++-- .../report => reports}/GetCampaignReportMethod.kt | 4 ++-- .../report => reports}/GetCampaignsReportsMethod.kt | 2 +- .../email/CampaignEmailActivityInfo.kt | 8 ++------ .../email/EmailReportActivityDetails.kt | 6 +++--- .../GetCampaignEmailActivityForSuscriberMethod.kt | 2 +- .../email/GetCampaignsEmailActivityMethod.kt | 2 +- .../method/v3_0/reports/email/TypeEmailActivity.kt | 11 +++++++++++ 20 files changed, 35 insertions(+), 28 deletions(-) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignBounceReport.kt (87%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignClicksReport.kt (90%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignDeliveryStatusReport.kt (90%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignEcommerceReport.kt (88%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignFacebookLikesReport.kt (88%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignForwardsReport.kt (86%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignIndustryStatsReport.kt (92%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignListStatsReport.kt (89%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignOpensReport.kt (89%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignReportInfo.kt (97%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignShareVIPReport.kt (86%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignTimeseriesReport.kt (89%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/CampaignTimewarpReport.kt (89%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/GetCampaignReportMethod.kt (91%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/GetCampaignsReportsMethod.kt (95%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/email/CampaignEmailActivityInfo.kt (81%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/email/EmailReportActivityDetails.kt (78%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/email/GetCampaignEmailActivityForSuscriberMethod.kt (95%) rename src/main/java/com/ecwid/maleorang/method/v3_0/{campaign/report => reports}/email/GetCampaignsEmailActivityMethod.kt (94%) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/TypeEmailActivity.kt diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignBounceReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignBounceReport.kt similarity index 87% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignBounceReport.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignBounceReport.kt index fd8d79d..51b0a75 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignBounceReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignBounceReport.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignClicksReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignClicksReport.kt similarity index 90% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignClicksReport.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignClicksReport.kt index 517e616..ff279e4 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignClicksReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignClicksReport.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignDeliveryStatusReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignDeliveryStatusReport.kt similarity index 90% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignDeliveryStatusReport.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignDeliveryStatusReport.kt index 794e4c1..e22046d 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignDeliveryStatusReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignDeliveryStatusReport.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignEcommerceReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignEcommerceReport.kt similarity index 88% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignEcommerceReport.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignEcommerceReport.kt index 319f4dd..a29f868 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignEcommerceReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignEcommerceReport.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignFacebookLikesReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignFacebookLikesReport.kt similarity index 88% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignFacebookLikesReport.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignFacebookLikesReport.kt index d204443..079775d 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignFacebookLikesReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignFacebookLikesReport.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignForwardsReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignForwardsReport.kt similarity index 86% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignForwardsReport.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignForwardsReport.kt index f443312..5d1de41 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignForwardsReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignForwardsReport.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignIndustryStatsReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignIndustryStatsReport.kt similarity index 92% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignIndustryStatsReport.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignIndustryStatsReport.kt index 0b8e459..5c3f899 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignIndustryStatsReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignIndustryStatsReport.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignListStatsReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignListStatsReport.kt similarity index 89% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignListStatsReport.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignListStatsReport.kt index 7ff7b90..4eadc85 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignListStatsReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignListStatsReport.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignOpensReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignOpensReport.kt similarity index 89% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignOpensReport.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignOpensReport.kt index 9429d07..ea639a1 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignOpensReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignOpensReport.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignReportInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt similarity index 97% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignReportInfo.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt index 83750e9..e2fab32 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignReportInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignShareVIPReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignShareVIPReport.kt similarity index 86% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignShareVIPReport.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignShareVIPReport.kt index f66904e..9de4a9a 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignShareVIPReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignShareVIPReport.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimeseriesReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignTimeseriesReport.kt similarity index 89% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimeseriesReport.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignTimeseriesReport.kt index 11d42ed..a43e6bd 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimeseriesReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignTimeseriesReport.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimewarpReport.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignTimewarpReport.kt similarity index 89% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimewarpReport.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignTimewarpReport.kt index 45562b7..29f60b3 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/CampaignTimewarpReport.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignTimewarpReport.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field @@ -19,7 +19,7 @@ class CampaignTimewarpReport : MailchimpObject() { @JvmField @Field - var last_open: Date? = null + var last_open: Date? = null @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignReportMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignReportMethod.kt similarity index 91% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignReportMethod.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignReportMethod.kt index bb9ad6b..85d33dc 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignReportMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignReportMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpMethod @@ -48,7 +48,7 @@ class GetCampaignReportMethod( class Response : MailchimpObject() { @JvmField @Field - var reports: List? = null + var report: CampaignReportInfo? = null @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignsReportsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignsReportsMethod.kt similarity index 95% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignsReportsMethod.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignsReportsMethod.kt index ab5f653..eb4b2d1 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/GetCampaignsReportsMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignsReportsMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report +package com.ecwid.maleorang.method.v3_0.reports import com.ecwid.maleorang.MailchimpMethod diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/CampaignEmailActivityInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/CampaignEmailActivityInfo.kt similarity index 81% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/CampaignEmailActivityInfo.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/CampaignEmailActivityInfo.kt index be4492e..ee5e388 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/CampaignEmailActivityInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/CampaignEmailActivityInfo.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report.email +package com.ecwid.maleorang.method.v3_0.reports.email import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field @@ -16,11 +16,7 @@ class CampaignEmailActivityInfo : MailchimpObject() { @JvmField @Field var list_id: String? = null - - @JvmField - @Field - var type: String? = null - + @JvmField @Field var email_id: String? = null diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/EmailReportActivityDetails.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/EmailReportActivityDetails.kt similarity index 78% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/EmailReportActivityDetails.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/EmailReportActivityDetails.kt index f1b2564..4335091 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/EmailReportActivityDetails.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/EmailReportActivityDetails.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report.email +package com.ecwid.maleorang.method.v3_0.reports.email import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field @@ -15,11 +15,11 @@ class EmailReportActivityDetails : MailchimpObject() { @JvmField @Field - var type: String? = null + var type: TypeEmailActivity? = null @JvmField @Field - var timestamp: String? = null + var timestamp: Date? = null @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignEmailActivityForSuscriberMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignEmailActivityForSuscriberMethod.kt similarity index 95% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignEmailActivityForSuscriberMethod.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignEmailActivityForSuscriberMethod.kt index e74a5c0..0fc4b31 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignEmailActivityForSuscriberMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignEmailActivityForSuscriberMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report.email +package com.ecwid.maleorang.method.v3_0.reports.email import com.ecwid.maleorang.MailchimpMethod diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignsEmailActivityMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignsEmailActivityMethod.kt similarity index 94% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignsEmailActivityMethod.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignsEmailActivityMethod.kt index 59e6bb9..058124c 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/report/email/GetCampaignsEmailActivityMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignsEmailActivityMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.campaign.report.email +package com.ecwid.maleorang.method.v3_0.reports.email import com.ecwid.maleorang.MailchimpMethod diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/TypeEmailActivity.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/TypeEmailActivity.kt new file mode 100644 index 0000000..84d6a17 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/TypeEmailActivity.kt @@ -0,0 +1,11 @@ +package com.ecwid.maleorang.method.v3_0.reports.email + +/** + * Created by larar on 15/10/2016. + */ + +enum class TypeEmailActivity(val type: String) { + BOUNCE("bounce"), + CLICK("click"), + OPEN("open") +} \ No newline at end of file From 9d6e97c1b8d0b155fc171133e42f475e0abb11bc Mon Sep 17 00:00:00 2001 From: Grigory Osin Date: Thu, 1 Dec 2016 16:32:45 +0400 Subject: [PATCH 06/27] Added processing response isn't JSON --- publish.gradle | 5 +++++ src/main/java/com/ecwid/maleorang/MailchimpClient.kt | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/publish.gradle b/publish.gradle index edb7d28..7ff2baf 100644 --- a/publish.gradle +++ b/publish.gradle @@ -64,6 +64,11 @@ if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePass name 'Vasily Karyaev' email 'v.karyaev@gmail.com' } + developer { + id 'aqman' + name 'Grigory Osin' + email 'aqman@gmail.com' + } } } } diff --git a/src/main/java/com/ecwid/maleorang/MailchimpClient.kt b/src/main/java/com/ecwid/maleorang/MailchimpClient.kt index 146185c..1e5338d 100644 --- a/src/main/java/com/ecwid/maleorang/MailchimpClient.kt +++ b/src/main/java/com/ecwid/maleorang/MailchimpClient.kt @@ -60,9 +60,11 @@ open class MailchimpClient protected constructor ( var description = response.reasonPhrase if (response.responseBody != null) { - val error = JsonParser().parse(response.responseBody).asJsonObject - code = error.get("status").asInt - description = error.get("detail").asString + try { + val error = JsonParser().parse(response.responseBody).asJsonObject + code = error.get("status").asInt + description = error.get("detail").asString + } catch (e: Exception){} } throw MailchimpException(code, description) From c159b1cdda1fa13b5e5c21520af3f8bee350e7b2 Mon Sep 17 00:00:00 2001 From: Grigory Date: Thu, 1 Dec 2016 17:40:28 +0400 Subject: [PATCH 07/27] Update publish.gradle --- publish.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/publish.gradle b/publish.gradle index 7ff2baf..11e738b 100644 --- a/publish.gradle +++ b/publish.gradle @@ -65,9 +65,9 @@ if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePass email 'v.karyaev@gmail.com' } developer { - id 'aqman' + id 'aqman1' name 'Grigory Osin' - email 'aqman@gmail.com' + email 'aqman@ecwid.com' } } } From 5dfe3dd8cc83ab337e98f01eeb415c5e2080a9e7 Mon Sep 17 00:00:00 2001 From: Vasily Karyaev Date: Fri, 2 Dec 2016 14:53:40 +0400 Subject: [PATCH 08/27] version updated --- publish.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish.gradle b/publish.gradle index 11e738b..4cf3886 100644 --- a/publish.gradle +++ b/publish.gradle @@ -3,7 +3,7 @@ apply plugin: 'signing' group = 'com.ecwid' archivesBaseName = "maleorang" -version = '3.0-0.9.4' +version = '3.0-0.9.5' task javadocJar(type: Jar) { classifier = 'javadoc' From e7bbf491ff08e8ce6e5a12f14683d1b9823e5eee Mon Sep 17 00:00:00 2001 From: lararojasmr Date: Mon, 5 Dec 2016 20:39:31 -0400 Subject: [PATCH 09/27] Some bugs were solved. --- .../maleorang/method/v3_0/campaign/GetCampaignsMethod.kt | 3 +-- .../ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt | 2 +- .../method/v3_0/reports/email/CampaignEmailActivityInfo.kt | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt index 4e0e232..d944a7b 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt @@ -4,7 +4,6 @@ package com.ecwid.maleorang.method.v3_0.campaign import com.ecwid.maleorang.MailchimpMethod import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.* -import java.util.* /** * Created by: Manuel Lara @@ -64,7 +63,7 @@ class GetCampaignsMethod : MailchimpMethod() { class Response : MailchimpObject() { @JvmField @Field - var campaings: List? = null + var campaigns: List? = null @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt index e2fab32..0d3e0d3 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt @@ -91,7 +91,7 @@ class CampaignReportInfo : MailchimpObject() { @JvmField @Field - var timeseries: CampaignTimeseriesReport? = null + var timeseries: List? = null @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/CampaignEmailActivityInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/CampaignEmailActivityInfo.kt index ee5e388..72de4db 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/CampaignEmailActivityInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/CampaignEmailActivityInfo.kt @@ -2,7 +2,6 @@ package com.ecwid.maleorang.method.v3_0.reports.email import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field -import java.util.* /** * Created by: Manuel Lara @@ -27,6 +26,5 @@ class CampaignEmailActivityInfo : MailchimpObject() { @JvmField @Field - var activity: EmailReportActivityDetails? = null - + var activity: List? = null } From 7911d6ebd4a8483382f1af36aec902e4c5caf741 Mon Sep 17 00:00:00 2001 From: lararojasmr Date: Sun, 18 Dec 2016 05:26:42 -0400 Subject: [PATCH 10/27] Some bugs were solved. --- publish.gradle | 2 +- .../method/v3_0/campaign/CampaignInfo.kt | 8 ++- .../v3_0/campaign/CampaignSettingsInfo.kt | 66 +++++++++++++++++++ .../v3_0/campaign/GetCampaignsMethod.kt | 7 +- .../method/v3_0/reports/CampaignReportInfo.kt | 2 +- .../v3_0/reports/GetCampaignReportMethod.kt | 4 +- .../v3_0/reports/GetCampaignsReportsMethod.kt | 4 +- 7 files changed, 83 insertions(+), 10 deletions(-) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignSettingsInfo.kt diff --git a/publish.gradle b/publish.gradle index ad139e2..0f7903b 100644 --- a/publish.gradle +++ b/publish.gradle @@ -3,7 +3,7 @@ apply plugin: 'signing' group = 'com.ecwid' archivesBaseName = "maleorang" -version = '3.0-0.9.5' +version = '3.0-0.9.4' task javadocJar(type: Jar) { classifier = 'javadoc' diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt index cc85309..d47bb19 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt @@ -19,7 +19,7 @@ class CampaignInfo : MailchimpObject() { @JvmField @Field - var create_time: String? = null + var create_time: Date? = null @JvmField @Field @@ -44,5 +44,11 @@ class CampaignInfo : MailchimpObject() { @JvmField @Field var recipients: RecipientsCampaignInfo? = null + + @JvmField + @Field + var settings: CampaignSettingsInfo? = null + + } diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignSettingsInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignSettingsInfo.kt new file mode 100644 index 0000000..4c4592f --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignSettingsInfo.kt @@ -0,0 +1,66 @@ +package com.ecwid.maleorang.method.v3_0.campaign + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field + +/** + * Created by: Manuel Lara + */ + +class CampaignSettingsInfo : MailchimpObject() { + @JvmField + @Field + var subject_line: String? = null + + @JvmField + @Field + var title: String? = null + + @JvmField + @Field + var from_name: String? = null + + @JvmField + @Field + var reply_to: String? = null + + @JvmField + @Field + var use_conversation: String? = null + + @JvmField + @Field + var to_name: String? = null + + @JvmField + @Field + var folder_id: String? = null + + @JvmField + @Field + var authenticate: Boolean? = null + + @JvmField + @Field + var auto_footer: Boolean? = null + + @JvmField + @Field + var inline_css: Boolean? = null + + @JvmField + @Field + var auto_tweet: Boolean? = null + + @JvmField + @Field + var fb_comments: Boolean? = null + + @JvmField + @Field + var timewrap: Boolean? = null + + @JvmField + @Field + var drag_and_drop: Boolean? = null +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt index d944a7b..27bde55 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/GetCampaignsMethod.kt @@ -4,6 +4,7 @@ package com.ecwid.maleorang.method.v3_0.campaign import com.ecwid.maleorang.MailchimpMethod import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.* +import java.util.* /** * Created by: Manuel Lara @@ -38,7 +39,7 @@ class GetCampaignsMethod : MailchimpMethod() { @JvmField @QueryStringParam - var before_send_time: String? = null + var before_send_time: Date? = null @JvmField @QueryStringParam @@ -46,11 +47,11 @@ class GetCampaignsMethod : MailchimpMethod() { @JvmField @QueryStringParam - var before_create_time: String? = null + var before_create_time: Date? = null @JvmField @QueryStringParam - var since_create_time: String? = null + var since_create_time: Date? = null @JvmField @QueryStringParam diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt index 0d3e0d3..9ae0802 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt @@ -47,7 +47,7 @@ class CampaignReportInfo : MailchimpObject() { @JvmField @Field - var send_time: String? = null + var send_time: Date? = null @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignReportMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignReportMethod.kt index 85d33dc..f986ffb 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignReportMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignReportMethod.kt @@ -39,11 +39,11 @@ class GetCampaignReportMethod( @JvmField @QueryStringParam - var before_send_time: String? = null + var before_send_time: Date? = null @JvmField @QueryStringParam - var since_send_time: String? = null + var since_send_time: Date? = null class Response : MailchimpObject() { @JvmField diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignsReportsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignsReportsMethod.kt index eb4b2d1..5d244d8 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignsReportsMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignsReportsMethod.kt @@ -35,11 +35,11 @@ class GetCampaignsReportsMethod : MailchimpMethod Date: Sun, 18 Dec 2016 05:42:16 -0400 Subject: [PATCH 11/27] I added _link attribute in the parent class for all classes. And added TODO tags. --- src/main/java/com/ecwid/maleorang/MailchimpObject.kt | 5 +++++ .../maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt | 3 +-- .../maleorang/method/v3_0/reports/CampaignReportInfo.kt | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ecwid/maleorang/MailchimpObject.kt b/src/main/java/com/ecwid/maleorang/MailchimpObject.kt index c75a621..b673419 100644 --- a/src/main/java/com/ecwid/maleorang/MailchimpObject.kt +++ b/src/main/java/com/ecwid/maleorang/MailchimpObject.kt @@ -1,5 +1,6 @@ package com.ecwid.maleorang +import com.ecwid.maleorang.annotation.Field import com.google.gson.JsonParseException @@ -19,6 +20,10 @@ open class MailchimpObject { @JvmField val mapping: MutableMap = MailchimpObjectMapping(this) + @JvmField + @Field + var _links: String? = null + /** * Serializes this object to JSON. */ diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt index 25ac16d..4705ae4 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/RecipientsCampaignInfo.kt @@ -2,7 +2,6 @@ package com.ecwid.maleorang.method.v3_0.campaign import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field -import java.util.* /** * Created by: Manuel Lara @@ -15,6 +14,6 @@ class RecipientsCampaignInfo : MailchimpObject() { @JvmField @Field - var segment_opts: MailchimpObject? = null + var segment_opts: MailchimpObject? = null //TODO create SegmentOpts Object } diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt index 9ae0802..1965767 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignReportInfo.kt @@ -83,7 +83,7 @@ class CampaignReportInfo : MailchimpObject() { @JvmField @Field - var ab_split: MailchimpObject? = null + var ab_split: MailchimpObject? = null //TODO create abSplit Object @JvmField @Field From b7de3bcb251994fc1856d82ae0adf5b8f2857f8d Mon Sep 17 00:00:00 2001 From: lararojasmr Date: Sun, 18 Dec 2016 05:46:47 -0400 Subject: [PATCH 12/27] I added a new enum class for the campings type --- .../maleorang/method/v3_0/campaign/CampaignInfo.kt | 3 ++- .../maleorang/method/v3_0/campaign/TypeCampaing.kt | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaign/TypeCampaing.kt diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt index d47bb19..73004ce 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt @@ -2,6 +2,7 @@ package com.ecwid.maleorang.method.v3_0.campaign import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field +import com.ecwid.maleorang.method.v3_0.reports.email.TypeCampign import java.util.* /** @@ -15,7 +16,7 @@ class CampaignInfo : MailchimpObject() { @JvmField @Field - var type: String? = null + var type: TypeCampign? = null @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/TypeCampaing.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/TypeCampaing.kt new file mode 100644 index 0000000..8dac574 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/TypeCampaing.kt @@ -0,0 +1,13 @@ +package com.ecwid.maleorang.method.v3_0.reports.email + +/** + * Created by larar on 15/10/2016. + */ + +enum class TypeCampign(val type: String) { + REGULAR("regular"), + PLAINTEXT("plaintext"), + ABSPLIT("absplit"), + RSS("rss"), + VARIATE("variate") +} \ No newline at end of file From be94f3805bf8c0668428e57649a6c59661df04c9 Mon Sep 17 00:00:00 2001 From: lararojasmr Date: Mon, 19 Dec 2016 05:48:54 -0400 Subject: [PATCH 13/27] Segment modules was Implemented. --- .../com/ecwid/maleorang/MailchimpObject.kt | 2 +- .../method/v3_0/campaign/CampaignInfo.kt | 4 +- .../{TypeCampaing.kt => TypeCampaign.kt} | 2 +- .../lists/segments/DeleteSegmentMethod.kt | 22 ++++++ .../v3_0/lists/segments/EditSegmentMethod.kt | 52 ++++++++++++++ .../v3_0/lists/segments/GetSegmentMethod.kt | 28 ++++++++ .../v3_0/lists/segments/GetSegmentsMethod.kt | 70 +++++++++++++++++++ .../method/v3_0/lists/segments/SegmentInfo.kt | 45 ++++++++++++ .../method/v3_0/lists/segments/TypeSegment.kt | 10 +++ 9 files changed, 231 insertions(+), 4 deletions(-) rename src/main/java/com/ecwid/maleorang/method/v3_0/campaign/{TypeCampaing.kt => TypeCampaign.kt} (83%) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt diff --git a/src/main/java/com/ecwid/maleorang/MailchimpObject.kt b/src/main/java/com/ecwid/maleorang/MailchimpObject.kt index b673419..964bf14 100644 --- a/src/main/java/com/ecwid/maleorang/MailchimpObject.kt +++ b/src/main/java/com/ecwid/maleorang/MailchimpObject.kt @@ -22,7 +22,7 @@ open class MailchimpObject { @JvmField @Field - var _links: String? = null + var _links: List? = null /** * Serializes this object to JSON. diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt index 73004ce..e7e6b1a 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/CampaignInfo.kt @@ -2,7 +2,7 @@ package com.ecwid.maleorang.method.v3_0.campaign import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field -import com.ecwid.maleorang.method.v3_0.reports.email.TypeCampign +import com.ecwid.maleorang.method.v3_0.reports.email.TypeCampaign import java.util.* /** @@ -16,7 +16,7 @@ class CampaignInfo : MailchimpObject() { @JvmField @Field - var type: TypeCampign? = null + var type: TypeCampaign? = null @JvmField @Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/TypeCampaing.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/TypeCampaign.kt similarity index 83% rename from src/main/java/com/ecwid/maleorang/method/v3_0/campaign/TypeCampaing.kt rename to src/main/java/com/ecwid/maleorang/method/v3_0/campaign/TypeCampaign.kt index 8dac574..184206d 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/TypeCampaing.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaign/TypeCampaign.kt @@ -4,7 +4,7 @@ package com.ecwid.maleorang.method.v3_0.reports.email * Created by larar on 15/10/2016. */ -enum class TypeCampign(val type: String) { +enum class TypeCampaign(val type: String) { REGULAR("regular"), PLAINTEXT("plaintext"), ABSPLIT("absplit"), diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt new file mode 100644 index 0000000..5e69632 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt @@ -0,0 +1,22 @@ +package com.ecwid.maleorang.method.v3_0.lists.members + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.APIVersion +import com.ecwid.maleorang.annotation.HttpMethod +import com.ecwid.maleorang.annotation.Method +import com.ecwid.maleorang.annotation.PathParam + +/** + * Created by: Manuel Lara + */ +@Method(httpMethod = HttpMethod.DELETE, version = APIVersion.v3_0, path = "/lists/{list_id}/segments/{segment_id}") +class DeleteSegmentMethod( + @JvmField + @PathParam + val list_id: String, + + @JvmField + @PathParam + val segment_id: String +) : MailchimpMethod() diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt new file mode 100644 index 0000000..32f59fb --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt @@ -0,0 +1,52 @@ +package com.ecwid.maleorang.method.v3_0.lists.members + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.method.v3_0.lists.SegmentInfo + +/** + * Created by: Manuel Lara + */ +sealed class EditSegmentMethod : MailchimpMethod() { + /** + * + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/lists/{list_id}/segments") + class Create( + @JvmField + @PathParam + val list_id: String + + ) : EditSegmentMethod() + + /** + * + */ + @Method(httpMethod = HttpMethod.PATCH, version = APIVersion.v3_0, path = "/lists/{list_id}/segments/{segment_id}") + class Update( + @JvmField + @PathParam + val list_id: String, + + @JvmField + @PathParam + val segment_id: String + + ) : EditSegmentMethod() + + + @JvmField + @Field + var name: String? = null + + @JvmField + @Field + var static_segment: List? = null + + @JvmField + @Field + var options: MailchimpObject? = null //TODO create a options object for Segments + + +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt new file mode 100644 index 0000000..ac97c48 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt @@ -0,0 +1,28 @@ +package com.ecwid.maleorang.method.v3_0.lists + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.annotation.* + +/** + * Created by: Manuel Lara + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/lists/{list_id}/segments/{segment_id}") +class GetSegmentMethod( + @JvmField + @PathParam + val list_id: String, + + @JvmField + @PathParam + val segment_id: String +) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt new file mode 100644 index 0000000..b851f08 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt @@ -0,0 +1,70 @@ +package com.ecwid.maleorang.method.v3_0.lists + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.method.v3_0.reports.email.TypeSegment +import java.util.* + +/** + * Created by: Manuel Lara + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path ="/lists/{list_id}/segments") +class GetSegmentsMethod( + @JvmField + @PathParam + val list_id: String +) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + @JvmField + @QueryStringParam + var count: Int? = null + + @JvmField + @QueryStringParam + var offset: Int? = null + + @JvmField + @QueryStringParam + var type: TypeSegment? = null + + @JvmField + @QueryStringParam + var since_create_at: Date? = null + + @JvmField + @QueryStringParam + var before_created_at: Date? = null + + @JvmField + @QueryStringParam + var since_updated_at: Date? = null + + @JvmField + @QueryStringParam + var before_updated_at: Date? = null + + class Response : MailchimpObject() { + @JvmField + @Field + var segments: List? = null + + @JvmField + @Field + var list_id: String? = null + + @JvmField + @Field + var total_items: Int? = null + + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt new file mode 100644 index 0000000..e021872 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt @@ -0,0 +1,45 @@ +package com.ecwid.maleorang.method.v3_0.lists + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import com.ecwid.maleorang.method.v3_0.reports.email.TypeSegment +import java.util.* + +/** + * Created by: Manuel Lara + */ +class SegmentInfo : MailchimpObject() { + + @JvmField + @Field + var id: String? = null + + @JvmField + @Field + var name: String? = null + + @JvmField + @Field + var member_count: Int? = null + + @JvmField + @Field + var type: TypeSegment? = null + + @JvmField + @Field + var create_at: Date? = null + + @JvmField + @Field + var updated_at: Date? = null + + @JvmField + @Field + var options: MailchimpObject? = null //TODO: must create a options object + + @JvmField + @Field + var list_id: String? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt new file mode 100644 index 0000000..dfb665b --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt @@ -0,0 +1,10 @@ +package com.ecwid.maleorang.method.v3_0.reports.email + +/** + * Created by: Manuel Lara + */ +enum class TypeSegment(val type: String) { + SAVED("saved"), + STATIC("static"), + FUZZY("fuzzy") +} \ No newline at end of file From 4bfb690df245a99a847ee212d773c9edc7745767 Mon Sep 17 00:00:00 2001 From: lararojasmr Date: Mon, 19 Dec 2016 06:04:03 -0400 Subject: [PATCH 14/27] Segment modules was Implemented #2 --- .../method/v3_0/lists/segments/DeleteSegmentMethod.kt | 2 +- .../maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt | 3 +-- .../maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt | 2 +- .../maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt | 3 +-- .../ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt | 3 +-- .../ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt index 5e69632..c8d6120 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.lists.members +package com.ecwid.maleorang.method.v3_0.segments import com.ecwid.maleorang.MailchimpMethod import com.ecwid.maleorang.MailchimpObject diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt index 32f59fb..a9c28aa 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt @@ -1,9 +1,8 @@ -package com.ecwid.maleorang.method.v3_0.lists.members +package com.ecwid.maleorang.method.v3_0.segments import com.ecwid.maleorang.MailchimpMethod import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.* -import com.ecwid.maleorang.method.v3_0.lists.SegmentInfo /** * Created by: Manuel Lara diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt index ac97c48..3bcf141 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.lists +package com.ecwid.maleorang.method.v3_0.segments import com.ecwid.maleorang.MailchimpMethod diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt index b851f08..a678e3c 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt @@ -1,10 +1,9 @@ -package com.ecwid.maleorang.method.v3_0.lists +package com.ecwid.maleorang.method.v3_0.segments import com.ecwid.maleorang.MailchimpMethod import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.* -import com.ecwid.maleorang.method.v3_0.reports.email.TypeSegment import java.util.* /** diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt index e021872..cda51a4 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt @@ -1,8 +1,7 @@ -package com.ecwid.maleorang.method.v3_0.lists +package com.ecwid.maleorang.method.v3_0.segments import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field -import com.ecwid.maleorang.method.v3_0.reports.email.TypeSegment import java.util.* /** diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt index dfb665b..5073558 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.reports.email +package com.ecwid.maleorang.method.v3_0.segments /** * Created by: Manuel Lara From 9a412f033e2f8cb596a4afb8fdcd3e969900edec Mon Sep 17 00:00:00 2001 From: lararojasmr Date: Wed, 11 Jan 2017 18:52:48 -0300 Subject: [PATCH 15/27] location of segments were changed --- .../maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt | 2 +- .../maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt | 2 +- .../maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt | 2 +- .../maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt | 2 +- .../ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt | 2 +- .../ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt index c8d6120..91f3d3e 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.segments +package com.ecwid.maleorang.method.v3_0.list.segments import com.ecwid.maleorang.MailchimpMethod import com.ecwid.maleorang.MailchimpObject diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt index a9c28aa..7c5f840 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.segments +package com.ecwid.maleorang.method.v3_0.list.segments import com.ecwid.maleorang.MailchimpMethod import com.ecwid.maleorang.MailchimpObject diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt index 3bcf141..351a0f4 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.segments +package com.ecwid.maleorang.method.v3_0.list.segments import com.ecwid.maleorang.MailchimpMethod diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt index a678e3c..dcac007 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.segments +package com.ecwid.maleorang.method.v3_0.list.segments import com.ecwid.maleorang.MailchimpMethod diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt index cda51a4..1ccba23 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.segments +package com.ecwid.maleorang.method.v3_0.list.segments import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt index 5073558..abaec43 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.segments +package com.ecwid.maleorang.method.v3_0.list.segments /** * Created by: Manuel Lara From 2fe9b4ba12ba892734f13d7c511ec90c848391c3 Mon Sep 17 00:00:00 2001 From: Gavin Lussi Date: Fri, 20 Jan 2017 10:55:09 +0000 Subject: [PATCH 16/27] Campaign operations (list, create, edit, delete, actions) added --- .../v3_0/campaigns/CampaignActionMethod.kt | 63 ++ .../method/v3_0/campaigns/CampaignInfo.kt | 629 ++++++++++++++++++ .../method/v3_0/campaigns/DayOfWeek.kt | 20 + .../v3_0/campaigns/DeleteCampaignMethod.kt | 18 + .../v3_0/campaigns/EditCampaignMethod.kt | 56 ++ .../v3_0/campaigns/GetCampaignMethod.kt | 20 + .../v3_0/campaigns/GetCampaignsMethod.kt | 86 +++ 7 files changed, 892 insertions(+) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/CampaignActionMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/CampaignInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/DayOfWeek.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/DeleteCampaignMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/EditCampaignMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/GetCampaignMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/GetCampaignsMethod.kt diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/CampaignActionMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/CampaignActionMethod.kt new file mode 100644 index 0000000..09b6929 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/CampaignActionMethod.kt @@ -0,0 +1,63 @@ +package com.ecwid.maleorang.method.v3_0.campaigns + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.APIVersion +import com.ecwid.maleorang.annotation.HttpMethod +import com.ecwid.maleorang.annotation.Method +import com.ecwid.maleorang.annotation.PathParam + +/** + * Base class for campaign action operations. + */ +sealed class CampaignActionMethod : MailchimpMethod() { + + /** + * [Cancel a Regular or Plain-Text Campaign after you send](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#action-post_campaigns_campaign_id_actions_cancel_send) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}/actions/cancel-send") + class CancelSend(@JvmField @PathParam val campaign_id: String) : CampaignActionMethod() + + /** + * [Pause an RSS-Driven campaign](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#action-post_campaigns_campaign_id_actions_pause) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}/actions/pause") + class Pause(@JvmField @PathParam val campaign_id: String) : CampaignActionMethod() + + /** + * [Replicate a campaign in saved or send status](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#action-post_campaigns_campaign_id_actions_replicate) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}/actions/replicate") + class Replicate(@JvmField @PathParam val campaign_id: String) : CampaignActionMethod() + + /** + * [Resume an RSS-Driven campaign](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#action-post_campaigns_campaign_id_actions_resume) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}/actions/resume") + class Resume(@JvmField @PathParam val campaign_id: String) : CampaignActionMethod() + + /** + * [Schedule a campaign for delivery](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#action-post_campaigns_campaign_id_actions_schedule) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}/actions/schedule") + class Schedule(@JvmField @PathParam val campaign_id: String) : CampaignActionMethod() + + /** + * [Send a MailChimp campaign](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#action-post_campaigns_campaign_id_actions_send) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}/actions/send") + class Send(@JvmField @PathParam val campaign_id: String) : CampaignActionMethod() + + /** + * [Send a Test email](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#action-post_campaigns_campaign_id_actions_test) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}/actions/test") + class Test(@JvmField @PathParam val campaign_id: String) : CampaignActionMethod() + + /** + * [Unschedule a scheduled campaign that hasn’t started sending](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#action-post_campaigns_campaign_id_actions_unschedule) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}/actions/unschedule") + class Unschedule(@JvmField @PathParam val campaign_id: String) : CampaignActionMethod() + +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/CampaignInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/CampaignInfo.kt new file mode 100644 index 0000000..ede6247 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/CampaignInfo.kt @@ -0,0 +1,629 @@ +package com.ecwid.maleorang.method.v3_0.campaigns + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import com.google.gson.annotations.SerializedName +import java.util.* + +class CampaignInfo : MailchimpObject() { + + @JvmField + @Field + var id: String? = null + + @JvmField + @Field + var type: Type? = null + + enum class Type { + @SerializedName("regular") + REGULAR, + @SerializedName("plaintext") + PLAINTEXT, + @SerializedName("absplit") + ABSPLIT, + @SerializedName("rss") + RSS, + @SerializedName("variate") + VARIATE + } + + @JvmField + @Field + var create_time: Date? = null + + @JvmField + @Field + var archive_url: String? = null + + @JvmField + @Field + var long_archive_url: String? = null + + @JvmField + @Field + var status: Status? = null + + enum class Status { + @SerializedName("save") + SAVE, + @SerializedName("paused") + PAUSED, + @SerializedName("schedule") + SCHEDULE, + @SerializedName("sending") + SENDING, + @SerializedName("sent") + SENT + } + + @JvmField + @Field + var emails_sent: Int? = null + + @JvmField + @Field + var send_time: Date? = null + + @JvmField + @Field + var content_type: String? = null + + @JvmField + @Field + var recipients: RecipientsInfo? = null + + class RecipientsInfo : MailchimpObject() { + + @JvmField + @Field + var list_id: String? = null + + @JvmField + @Field + var list_name: String? = null + + @JvmField + @Field + var segment_text: String? = null + + @JvmField + @Field + var recipient_count: Int? = null + + @JvmField + @Field + var segment_opts: SegmentOptsInfo? = null + + class SegmentOptsInfo : MailchimpObject() { + + @JvmField + @Field + var saved_segment_id: Int? = null + + @JvmField + @Field + var match: String? = null + + @JvmField + @Field + var conditions: Array? = null + } + } + + @JvmField + @Field + var settings: SettingsInfo? = null + + class SettingsInfo : MailchimpObject() { + + @JvmField + @Field + var subject_line: String? = null + + @JvmField + @Field + var title: String? = null + + @JvmField + @Field + var from_name: String? = null + + @JvmField + @Field + var reply_to: String? = null + + @JvmField + @Field + var use_conversation: Boolean? = null + + @JvmField + @Field + var to_name: String? = null + + @JvmField + @Field + var folder_id: String? = null + + @JvmField + @Field + var authenticate: Boolean? = null + + @JvmField + @Field + var auto_footer: Boolean? = null + + @JvmField + @Field + var inline_css: Boolean? = null + + @JvmField + @Field + var auto_tweet: Boolean? = null + + @JvmField + @Field + var auto_fb_post: Array? = null + + @JvmField + @Field + var fb_comments: Boolean? = null + + @JvmField + @Field + var timewarp: Boolean? = null + + @JvmField + @Field + var template_id: Int? = null + + @JvmField + @Field + var drag_and_drop: Boolean? = null + + } + + @JvmField + @Field + var variate_settings: VariateSettingsInfo? = null + + class VariateSettingsInfo : MailchimpObject() { + + @JvmField + @Field + var winning_combination_id: String? = null + + @JvmField + @Field + var winning_campaign_id: String? = null + + @JvmField + @Field + var winner_criteria: WinnerCriteria? = null + + enum class WinnerCriteria { + @SerializedName("opens") + OPENS, + @SerializedName("clicks") + CLICKS, + @SerializedName("manual") + MANUAL, + @SerializedName("total_revenue") + TOTAL_REVENUE + } + + @JvmField + @Field + var wait_time: Int? = null + + @JvmField + @Field + var test_size: Int? = null + + @JvmField + @Field + var subject_lines: Array? = null + + @JvmField + @Field + var send_times: Array? = null + + @JvmField + @Field + var from_names: Array? = null + + @JvmField + @Field + var reply_to_addresses: Array? = null + + @JvmField + @Field + var contents: Array? = null + + @JvmField + @Field + var combinations: Array? = null + + class CombinationInfo : MailchimpObject() { + + @JvmField + @Field + var id: String? = null + + @JvmField + @Field + var subject_line: String? = null + + @JvmField + @Field + var send_time: Int? = null + + @JvmField + @Field + var from_name: Int? = null + + @JvmField + @Field + var reply_to: Int? = null + + @JvmField + @Field + var content_description: Int? = null + + @JvmField + @Field + var recipients: Int? = null + } + } + + @JvmField + @Field + var tracking: TrackingInfo? = null + + class TrackingInfo : MailchimpObject() { + + @JvmField + @Field + var opens: Boolean? = null + + @JvmField + @Field + var html_clicks: Boolean? = null + + @JvmField + @Field + var text_clicks: Boolean? = null + + @JvmField + @Field + var goal_tracking: Boolean? = null + + @JvmField + @Field + var ecomm360: Boolean? = null + + @JvmField + @Field + var google_analytics: String? = null + + @JvmField + @Field + var clicktale: String? = null + + @JvmField + @Field + var salesforce: SalesforceInfo? = null + + class SalesforceInfo : MailchimpObject() { + + @JvmField + @Field + var campaign: Boolean? = null + + @JvmField + @Field + var notes: Boolean? = null + } + + @JvmField + @Field + var highrise: HighriseInfo? = null + + class HighriseInfo : MailchimpObject() { + + @JvmField + @Field + var campaign: Boolean? = null + + @JvmField + @Field + var notes: Boolean? = null + } + + @JvmField + @Field + var capsule: CapsuleInfo? = null + + class CapsuleInfo : MailchimpObject() { + + @JvmField + @Field + var notes: Boolean? = null + } + } + + @JvmField + @Field + var rss_opts: RSSOptsInfo? = null + + class RSSOptsInfo : MailchimpObject() { + + @JvmField + @Field + var feed_url: String? = null + + @JvmField + @Field + var frequency: Frequency? = null + + enum class Frequency { + @SerializedName("daily") + DAILY, + @SerializedName("weekly") + WEEKLY, + @SerializedName("monthly") + MONTHLY + } + + @JvmField + @Field + var schedule: ScheduleInfo? = null + + class ScheduleInfo : MailchimpObject() { + + @JvmField + @Field + var hour: Int? = null + + @JvmField + @Field + var daily_send: DailySendInfo? = null + + class DailySendInfo : MailchimpObject() { + + @JvmField + @Field + var sunday: Boolean? = null + + @JvmField + @Field + var monday: Boolean? = null + + @JvmField + @Field + var tuesday: Boolean? = null + + @JvmField + @Field + var wednesday: Boolean? = null + + @JvmField + @Field + var thursday: Boolean? = null + + @JvmField + @Field + var friday: Boolean? = null + + @JvmField + @Field + var saturday: Boolean? = null + + } + + @JvmField + @Field + var weekly_send_day: DayOfWeek? = null + + @JvmField + @Field + var monthly_send_date: Int? = null + + } + + @JvmField + @Field + var last_sent: String? = null + + @JvmField + @Field + var constrain_rss_img: Boolean? = null + } + + @JvmField + @Field + var ab_split_opts: ABSplitOptsInfo? = null + + class ABSplitOptsInfo : MailchimpObject() { + + @JvmField + @Field + var split_test: Type? = null + + enum class Type { + @SerializedName("subject") + SUBJECT, + @SerializedName("from_name") + FROM_NAME, + @SerializedName("schedule") + SCHEDULE + } + + @JvmField + @Field + var pick_winner: PickWinner? = null + + enum class PickWinner { + @SerializedName("opens") + SUBJECT, + @SerializedName("clicks") + FROM_NAME, + @SerializedName("manual") + SCHEDULE + } + + @JvmField + @Field + var wait_units: WaitUnits? = null + + enum class WaitUnits { + @SerializedName("hours") + HOURS, + @SerializedName("days") + DAYS + } + + @JvmField + @Field + var wait_time: Int? = null + + @JvmField + @Field + var split_size: Int? = null + + @JvmField + @Field + var from_name_a: String? = null + + @JvmField + @Field + var from_name_b: String? = null + + @JvmField + @Field + var reply_email_a: String? = null + + @JvmField + @Field + var reply_email_b: String? = null + + @JvmField + @Field + var subject_a: String? = null + + @JvmField + @Field + var subject_b: String? = null + + @JvmField + @Field + var send_time_a: Date? = null + + @JvmField + @Field + var send_time_b: Date? = null + + @JvmField + @Field + var send_time_winner: Date? = null + + } + + @JvmField + @Field + var social_card: SocialCardInfo? = null + + class SocialCardInfo : MailchimpObject() { + + @JvmField + @Field + var image_url: String? = null + + @JvmField + @Field + var description: String? = null + + @JvmField + @Field + var title: String? = null + + } + + @JvmField + @Field + var report_summary: ReportSummaryInfo? = null + + class ReportSummaryInfo : MailchimpObject() { + + @JvmField + @Field + var opens: Int? = null + + @JvmField + @Field + var unique_opens: Int? = null + + @JvmField + @Field + var open_rate: Double? = null + + @JvmField + @Field + var clicks: Int? = null + + @JvmField + @Field + var subscriber_clicks: Int? = null + + @JvmField + @Field + var click_rate: Double? = null + + @JvmField + @Field + var ecommerce: EcommerceInfo? = null + + class EcommerceInfo : MailchimpObject() { + + @JvmField + @Field + var total_orders: Int? = null + + @JvmField + @Field + var total_spent: Double? = null + + @JvmField + @Field + var total_revenue: Double? = null + } + } + + @JvmField + @Field + var delivery_status: DeliveryStatusInfo? = null + + class DeliveryStatusInfo : MailchimpObject() { + + @JvmField + @Field + var enabled: Boolean? = null + + @JvmField + @Field + var can_cancel: Boolean? = null + + @JvmField + @Field + var status: String? = null + + @JvmField + @Field + var emails_sent: Int? = null + + @JvmField + @Field + var emails_canceled: Int? = null + + } +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/DayOfWeek.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/DayOfWeek.kt new file mode 100644 index 0000000..a9e2417 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/DayOfWeek.kt @@ -0,0 +1,20 @@ +package com.ecwid.maleorang.method.v3_0.campaigns + +import com.google.gson.annotations.SerializedName + +enum class DayOfWeek { + @SerializedName("sunday") + SUNDAY, + @SerializedName("monday") + MONDAY, + @SerializedName("tuesday") + TUESDAY, + @SerializedName("wednesday") + WEDNESDAY, + @SerializedName("thursday") + THURSDAY, + @SerializedName("friday") + FRIDAY, + @SerializedName("saturday") + SATURDAY, +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/DeleteCampaignMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/DeleteCampaignMethod.kt new file mode 100644 index 0000000..571075c --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/DeleteCampaignMethod.kt @@ -0,0 +1,18 @@ +package com.ecwid.maleorang.method.v3_0.campaigns + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.APIVersion +import com.ecwid.maleorang.annotation.HttpMethod +import com.ecwid.maleorang.annotation.Method +import com.ecwid.maleorang.annotation.PathParam + +/** + * [Remove a campaign from your MailChimp account](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#delete-delete_campaigns_campaign_id) + */ +@Method(httpMethod = HttpMethod.DELETE, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}") +class DeleteCampaignMethod( + @JvmField + @PathParam + val campaign_id: String +) : MailchimpMethod() diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/EditCampaignMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/EditCampaignMethod.kt new file mode 100644 index 0000000..6197940 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/EditCampaignMethod.kt @@ -0,0 +1,56 @@ +package com.ecwid.maleorang.method.v3_0.campaigns + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.method.v3_0.campaigns.CampaignInfo.* + +/** + * Base class for campaign create or update operations. + */ +sealed class EditCampaignMethod : MailchimpMethod() { + + /** + * [Create a new MailChimp campaign](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#create-post_campaigns) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/campaigns") + class Create() : EditCampaignMethod() + + /** + * [Update some or all of the settings for a specific campaign](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#edit-patch_campaigns_campaign_id) + */ + @Method(httpMethod = HttpMethod.PATCH, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}") + class Update( + @JvmField + @PathParam + val campaign_id: String + ) : EditCampaignMethod() + + @JvmField + @Field + var type: CampaignInfo.Type? = null + + @JvmField + @Field + var recipients: RecipientsInfo? = null + + @JvmField + @Field + var settings: SettingsInfo? = null + + @JvmField + @Field + var variate_settings: VariateSettingsInfo? = null + + @JvmField + @Field + var tracking: TrackingInfo? = null + + @JvmField + @Field + var rss_opts: RSSOptsInfo? = null + + @JvmField + @Field + var social_card: SocialCardInfo? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/GetCampaignMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/GetCampaignMethod.kt new file mode 100644 index 0000000..efd9401 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/GetCampaignMethod.kt @@ -0,0 +1,20 @@ +package com.ecwid.maleorang.method.v3_0.campaigns + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.annotation.* + +/** + * [Get information about a specific campaign](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#read-get_campaigns_campaign_id) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}") +class GetCampaignMethod(@JvmField @PathParam val campaign_id: String) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/GetCampaignsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/GetCampaignsMethod.kt new file mode 100644 index 0000000..e61c113 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/GetCampaignsMethod.kt @@ -0,0 +1,86 @@ +package com.ecwid.maleorang.method.v3_0.campaigns + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.method.v3_0.campaigns.CampaignInfo.Status +import com.ecwid.maleorang.method.v3_0.campaigns.CampaignInfo.Type +import java.util.* + +/** + * [Get all campaigns in an account.](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#read-get_campaigns) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/campaigns") +class GetCampaignsMethod : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + @JvmField + @QueryStringParam + var count: Int? = null + + @JvmField + @QueryStringParam + var offset: Int? = null + + @JvmField + @QueryStringParam + var type: Type? = null + + @JvmField + @QueryStringParam + var status: Status? = null + + @JvmField + @QueryStringParam + var before_send_time: Date? = null + + @JvmField + @QueryStringParam + var since_send_time: Date? = null + + @JvmField + @QueryStringParam + var before_create_time: Date? = null + + @JvmField + @QueryStringParam + var since_create_time: Date? = null + + @JvmField + @QueryStringParam + var list_id: String? = null + + @JvmField + @QueryStringParam + var folder_id: String? = null + + @JvmField + @QueryStringParam + var sort_field: String? = null + + @JvmField + @QueryStringParam + var sort_dir: SortDir? = null + + enum class SortDir { + ASC, + DESC + } + + class Response : MailchimpObject() { + @JvmField + @Field + var campaigns: List? = null + + @JvmField + @Field + var total_items: Int? = null + } +} \ No newline at end of file From b5d637f84fd8f381654998d7071078930c13aacb Mon Sep 17 00:00:00 2001 From: Gavin Lussi Date: Fri, 20 Jan 2017 10:56:48 +0000 Subject: [PATCH 17/27] Campaign content operations (get, set) added --- .../v3_0/campaigns/content/ContentInfo.kt | 36 ++++++ .../content/GetCampaignContentMethod.kt | 20 ++++ .../content/SetCampaignContentMethod.kt | 105 ++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/content/ContentInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/content/GetCampaignContentMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/content/SetCampaignContentMethod.kt diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/content/ContentInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/content/ContentInfo.kt new file mode 100644 index 0000000..47e0bf3 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/content/ContentInfo.kt @@ -0,0 +1,36 @@ +package com.ecwid.maleorang.method.v3_0.campaigns.content + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field + +class ContentInfo : MailchimpObject() { + + @JvmField + @Field + var variate_contents: VariateContents? = null + + class VariateContents : MailchimpObject() { + + @JvmField + @Field + var content_label: String? = null + + @JvmField + @Field + var plain_text: String? = null + + @JvmField + @Field + var html: String? = null + + } + + @JvmField + @Field + var plain_text: String? = null + + @JvmField + @Field + var html: String? = null + +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/content/GetCampaignContentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/content/GetCampaignContentMethod.kt new file mode 100644 index 0000000..4fba140 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/content/GetCampaignContentMethod.kt @@ -0,0 +1,20 @@ +package com.ecwid.maleorang.method.v3_0.campaigns.content + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.annotation.* + +/** + * [Get the the HTML and plain-text content for a campaign](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/content/#read-get_campaigns_campaign_id_content) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}/content") +class GetCampaignContentMethod(@JvmField @PathParam val campaign_id: String) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/content/SetCampaignContentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/content/SetCampaignContentMethod.kt new file mode 100644 index 0000000..e790e36 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/content/SetCampaignContentMethod.kt @@ -0,0 +1,105 @@ +package com.ecwid.maleorang.method.v3_0.campaigns.content + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import com.google.gson.annotations.SerializedName + +/** + * [Set the content for a campaign](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/content/#edit-put_campaigns_campaign_id_content) + */ +@Method(httpMethod = HttpMethod.PUT, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}/content") +class SetCampaignContentMethod(@JvmField @PathParam val campaign_id: String) : MailchimpMethod() { + + @JvmField + @Field + var plain_text: String? = null + + @JvmField + @Field + var html: String? = null + + @JvmField + @Field + var url: String? = null + + @JvmField + @Field + var template: Template? = null + + class Template : MailchimpObject() { + + @JvmField + @Field + var id: Int? = null + + @JvmField + @Field + var sections: Map? = null + + } + + @JvmField + @Field + var archive: Archive? = null + + class Archive : MailchimpObject() { + + @JvmField + @Field + var archive_content: String? = null + + @JvmField + @Field + var archive_type: ArchiveType? = null + + enum class ArchiveType { + @SerializedName("zip") + ZIP, + @SerializedName("tar.gz") + TAR_GZ, + @SerializedName("tar.bz2") + TAR_BZ2, + @SerializedName("tar") + TAR, + @SerializedName("tgz") + TGZ, + @SerializedName("tbz") + TBZ, + } + } + + @JvmField + @Field + var variate_contents: Array? = null + + class VariateContents : MailchimpObject() { + + @JvmField + @Field + var content_label: String? = null + + @JvmField + @Field + var plain_text: String? = null + + @JvmField + @Field + var html: String? = null + + @JvmField + @Field + var url: String? = null + + @JvmField + @Field + var template: Template? = null + + @JvmField + @Field + var archive: Archive? = null + + } + + +} From 7a189421e61d63497e7f004a7ac11ace629b9dbc Mon Sep 17 00:00:00 2001 From: Gavin Lussi Date: Fri, 20 Jan 2017 10:57:28 +0000 Subject: [PATCH 18/27] Create new list method added --- .../method/v3_0/lists/EditListMethod.kt | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/lists/EditListMethod.kt diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/EditListMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/EditListMethod.kt new file mode 100644 index 0000000..24e85a2 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/EditListMethod.kt @@ -0,0 +1,50 @@ +package com.ecwid.maleorang.method.v3_0.lists + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.annotation.* + +sealed class EditListMethod : MailchimpMethod() { + + /** + * [Create a new list in your MailChimp account](https://developer.mailchimp.com/documentation/mailchimp/reference/lists/#create-post_lists) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/lists") + class Create() : EditListMethod() + + @JvmField + @Field + var name: String? = null + + @JvmField + @Field + var contact: ContactInfo? = null + + @JvmField + @Field + var permission_reminder: String? = null + + @JvmField + @Field + var use_archive_bar: String? = null + + @JvmField + @Field + var campaign_defaults: CampaignDefaultsInfo? = null + + @JvmField + @Field + var notify_on_subscribe: String? = null + + @JvmField + @Field + var notify_on_unsubscribe: String? = null + + @JvmField + @Field + var email_type_option: Boolean? = null + + @JvmField + @Field + var visibility: String? = null + +} \ No newline at end of file From f8fab256ab346512bcec2c4ec004e0bf4ccfa0d4 Mon Sep 17 00:00:00 2001 From: Gavin Lussi Date: Fri, 20 Jan 2017 15:46:54 +0000 Subject: [PATCH 19/27] MergeField operations (get all, create, update) added --- .../merge_fields/EditMergeFieldMethod.kt | 97 +++++++++++++++++ .../merge_fields/GetMergeFieldsMethod.kt | 51 +++++++++ .../v3_0/lists/merge_fields/MergeFieldInfo.kt | 102 ++++++++++++++++++ 3 files changed, 250 insertions(+) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/lists/merge_fields/EditMergeFieldMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/lists/merge_fields/GetMergeFieldsMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/lists/merge_fields/MergeFieldInfo.kt diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/merge_fields/EditMergeFieldMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/merge_fields/EditMergeFieldMethod.kt new file mode 100644 index 0000000..695dd83 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/merge_fields/EditMergeFieldMethod.kt @@ -0,0 +1,97 @@ +package com.ecwid.maleorang.method.v3_0.lists.merge_fields + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.method.v3_0.lists.members.MemberInfo + +/** + * Base class for editing merge fields (formerly merge vars) for a specific list + */ +sealed class EditMergeFieldMethod : MailchimpMethod() { + + /** + * [Add a new merge field for a specific list](https://developer.mailchimp.com/documentation/mailchimp/reference/lists/merge-fields/#create-post_lists_list_id_merge_fields) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/lists/{list_id}/merge-fields") + class Create( + @JvmField + @PathParam + val list_id: String, + + @JvmField + @Field + val type: MergeFieldInfo.Type? = null + ) : EditMergeFieldMethod() + + /** + * [Update a specific merge field in a list](https://developer.mailchimp.com/documentation/mailchimp/reference/lists/merge-fields/#edit-patch_lists_list_id_merge_fields_merge_id) + */ + @Method(httpMethod = HttpMethod.PATCH, version = APIVersion.v3_0, path = "/lists/{list_id}/merge-fields/{merge_id}") + class Update( + @JvmField + @PathParam + val list_id: String, + + @JvmField + @PathParam + val merge_id: String + ) : EditMergeFieldMethod() + + @JvmField + @Field + var tag: String? = null + + @JvmField + @Field + var name: String? = null + + @JvmField + @Field + var required: Boolean? = null + + @JvmField + @Field + var default_value: String? = null + + @JvmField + @Field + var public: Boolean? = null + + @JvmField + @Field + var display_order: Int? = null + + @JvmField + @Field + var options: OptionsInfo? = null + + class OptionsInfo : MailchimpObject() { + + @JvmField + @Field + var default_country: Int? = null + + @JvmField + @Field + var phone_format: String? = null + + @JvmField + @Field + var date_format: String? = null + + @JvmField + @Field + var choices: Array? = null + + @JvmField + @Field + var size: Int? = null + + } + + @JvmField + @Field + var help_text: String? = null + +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/merge_fields/GetMergeFieldsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/merge_fields/GetMergeFieldsMethod.kt new file mode 100644 index 0000000..1d87182 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/merge_fields/GetMergeFieldsMethod.kt @@ -0,0 +1,51 @@ +package com.ecwid.maleorang.method.v3_0.lists.merge_fields + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* + +/** + * [Get a list of all merge fields (formerly merge vars) for a list](https://developer.mailchimp.com/documentation/mailchimp/reference/lists/merge-fields/#read-get_lists_list_id_merge_fields) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/lists/{list_id}/merge-fields") +class GetMergeFieldsMethod(@JvmField @PathParam val list_id: String) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + @JvmField + @QueryStringParam + var count: Int? = null + + @JvmField + @QueryStringParam + var offset: Int? = null + + @JvmField + @QueryStringParam + var type: MergeFieldInfo.Type? = null + + @JvmField + @QueryStringParam + var required: Boolean? = null + + class Response : MailchimpObject() { + @JvmField + @Field + var merge_fields: List? = null + + @JvmField + @Field + var list_id: String? = null + + @JvmField + @Field + var total_items: Int? = null + } + +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/merge_fields/MergeFieldInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/merge_fields/MergeFieldInfo.kt new file mode 100644 index 0000000..475bf4b --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/merge_fields/MergeFieldInfo.kt @@ -0,0 +1,102 @@ +package com.ecwid.maleorang.method.v3_0.lists.merge_fields + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import com.google.gson.annotations.SerializedName + +class MergeFieldInfo : MailchimpObject() { + + @JvmField + @Field + var merge_id: Int? = null + + @JvmField + @Field + var tag: String? = null + + @JvmField + @Field + var name: String? = null + + @JvmField + @Field + var type: Type? = null + + enum class Type { + @SerializedName("text") + TEXT, + @SerializedName("number") + NUMBER, + @SerializedName("address") + ADDRESS, + @SerializedName("phone") + PHONE, + @SerializedName("date") + DATE, + @SerializedName("url") + URL, + @SerializedName("imageurl") + IMAGEURL, + @SerializedName("radio") + RADIO, + @SerializedName("dropdown") + DROPDOWN, + @SerializedName("birthday") + BIRTHDAY, + @SerializedName("zip") + ZIP + } + + @JvmField + @Field + var required: Boolean? = null + + @JvmField + @Field + var default_value: String? = null + + @JvmField + @Field + var public: Boolean? = null + + @JvmField + @Field + var display_order: Int? = null + + @JvmField + @Field + var options: OptionsInfo? = null + + class OptionsInfo : MailchimpObject() { + + @JvmField + @Field + var default_country: Int? = null + + @JvmField + @Field + var phone_format: String? = null + + @JvmField + @Field + var date_format: String? = null + + @JvmField + @Field + var choices: Array? = null + + @JvmField + @Field + var size: Int? = null + + } + + @JvmField + @Field + var help_text: String? = null + + @JvmField + @Field + var list_id: String? = null + +} From 28af9a1e9dd9dfc5fb2675bef88a486f7a51c432 Mon Sep 17 00:00:00 2001 From: Gavin Lussi Date: Mon, 23 Jan 2017 16:44:28 +0000 Subject: [PATCH 20/27] GetEmailActivitysMethod added --- .../email_activity/EmailActivityInfo.kt | 70 +++++++++++++++++++ .../email_activity/GetEmailActivitysMethod.kt | 43 ++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/reports/email_activity/EmailActivityInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/reports/email_activity/GetEmailActivitysMethod.kt diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email_activity/EmailActivityInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email_activity/EmailActivityInfo.kt new file mode 100644 index 0000000..27cf986 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email_activity/EmailActivityInfo.kt @@ -0,0 +1,70 @@ +package com.ecwid.maleorang.method.v3_0.reports.email_activity + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import com.google.gson.annotations.SerializedName +import java.util.* + +class EmailActivityInfo : MailchimpObject() { + + @JvmField + @Field + var campaign_id: String? = null + + @JvmField + @Field + var list_id: String? = null + + @JvmField + @Field + var email_id: String? = null + + @JvmField + @Field + var email_address: String? = null + + @JvmField + @Field + var activity: Array? = null + + class ActivityInfo : MailchimpObject() { + + @JvmField + @Field + var action: Action? = null + + enum class Action { + @SerializedName("open") + OPEN, + @SerializedName("click") + CLICK, + @SerializedName("bounce") + BOUNCE + } + + @JvmField + @Field + var type: Type? = null + + enum class Type { + @SerializedName("hard") + HARD, + @SerializedName("soft") + SOFT + } + + @JvmField + @Field + var timestamp: Date? = null + + @JvmField + @Field + var url: String? = null + + @JvmField + @Field + var ip: String? = null + + } + +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email_activity/GetEmailActivitysMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email_activity/GetEmailActivitysMethod.kt new file mode 100644 index 0000000..b6aa8aa --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email_activity/GetEmailActivitysMethod.kt @@ -0,0 +1,43 @@ +package com.ecwid.maleorang.method.v3_0.reports.email_activity + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* + +/** + * [Get a list of member’s subscriber activity in a specific campaign](https://developer.mailchimp.com/documentation/mailchimp/reference/reports/email-activity/#read-get_reports_campaign_id_email_activity) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/reports/{campaign_id}/email-activity") +class GetEmailActivitysMethod(@JvmField @PathParam val campaign_id: String) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + @JvmField + @QueryStringParam + var count: Int? = null + + @JvmField + @QueryStringParam + var offset: Int? = null + + class Response : MailchimpObject() { + @JvmField + @Field + var emails: List? = null + + @JvmField + @Field + var campaign_id: String? = null + + @JvmField + @Field + var total_items: Int? = null + } + +} From 769ab6c723f568168cbbe1ab240e5468a1f236ec Mon Sep 17 00:00:00 2001 From: Gavin Lussi Date: Mon, 23 Jan 2017 16:46:12 +0000 Subject: [PATCH 21/27] GetUnsubscribedMethod added --- .../unsubscribed/GetUnsubscribedMethod.kt | 43 +++++++++++++++++++ .../reports/unsubscribed/UnsubscribeInfo.kt | 41 ++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/reports/unsubscribed/GetUnsubscribedMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/reports/unsubscribed/UnsubscribeInfo.kt diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/unsubscribed/GetUnsubscribedMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/unsubscribed/GetUnsubscribedMethod.kt new file mode 100644 index 0000000..beabcc8 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/unsubscribed/GetUnsubscribedMethod.kt @@ -0,0 +1,43 @@ +package com.ecwid.maleorang.method.v3_0.reports.unsubscribed + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* + +/** + * [Get information about members who have unsubscribed from a specific campaign](https://developer.mailchimp.com/documentation/mailchimp/reference/reports/unsubscribed/#read-get_reports_campaign_id_unsubscribed) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/reports/{campaign_id}/unsubscribed") +class GetUnsubscribedMethod(@JvmField @PathParam val campaign_id: String) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + @JvmField + @QueryStringParam + var count: Int? = null + + @JvmField + @QueryStringParam + var offset: Int? = null + + class Response : MailchimpObject() { + @JvmField + @Field + var unsubscribes: List? = null + + @JvmField + @Field + var campaign_id: String? = null + + @JvmField + @Field + var total_items: Int? = null + } + +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/unsubscribed/UnsubscribeInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/unsubscribed/UnsubscribeInfo.kt new file mode 100644 index 0000000..1222209 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/unsubscribed/UnsubscribeInfo.kt @@ -0,0 +1,41 @@ +package com.ecwid.maleorang.method.v3_0.reports.unsubscribed + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +class UnsubscribeInfo : MailchimpObject() { + + @JvmField + @Field + var email_id: String? = null + + @JvmField + @Field + var email_address: String? = null + + @JvmField + @Field + var merge_fields: MailchimpObject? = null + + @JvmField + @Field + var vip: Boolean? = null + + @JvmField + @Field + var timestamp: Date? = null + + @JvmField + @Field + var reason: String? = null + + @JvmField + @Field + var campaign_id: String? = null + + @JvmField + @Field + var list_id: String? = null + +} \ No newline at end of file From f393c9c81574fd43f313d19f4c4ac5d58cf85708 Mon Sep 17 00:00:00 2001 From: Gavin Lussi Date: Tue, 24 Jan 2017 17:07:00 +0000 Subject: [PATCH 22/27] DeleteListMethod added --- .../method/v3_0/lists/DeleteListMethod.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/lists/DeleteListMethod.kt diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/DeleteListMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/DeleteListMethod.kt new file mode 100644 index 0000000..5df94c2 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/DeleteListMethod.kt @@ -0,0 +1,18 @@ +package com.ecwid.maleorang.method.v3_0.lists + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.APIVersion +import com.ecwid.maleorang.annotation.HttpMethod +import com.ecwid.maleorang.annotation.Method +import com.ecwid.maleorang.annotation.PathParam + +/** + * [Delete a list from your MailChimp account](https://developer.mailchimp.com/documentation/mailchimp/reference/lists/#delete-delete_lists_list_id) + */ +@Method(httpMethod = HttpMethod.DELETE, version = APIVersion.v3_0, path = "/lists/{list_id}") +class DeleteListMethod( + @JvmField + @PathParam + val list_id: String +) : MailchimpMethod() \ No newline at end of file From 24cb92df104c1f17bf33acbbe4a27e0719a46b9a Mon Sep 17 00:00:00 2001 From: Gavin Lussi Date: Thu, 26 Jan 2017 11:09:01 +0000 Subject: [PATCH 23/27] Added missing body params to Schedule CampaignActionMethod --- .../v3_0/campaigns/CampaignActionMethod.kt | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/CampaignActionMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/CampaignActionMethod.kt index 09b6929..30378f6 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/CampaignActionMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/campaigns/CampaignActionMethod.kt @@ -2,10 +2,8 @@ package com.ecwid.maleorang.method.v3_0.campaigns import com.ecwid.maleorang.MailchimpMethod import com.ecwid.maleorang.MailchimpObject -import com.ecwid.maleorang.annotation.APIVersion -import com.ecwid.maleorang.annotation.HttpMethod -import com.ecwid.maleorang.annotation.Method -import com.ecwid.maleorang.annotation.PathParam +import com.ecwid.maleorang.annotation.* +import java.util.* /** * Base class for campaign action operations. @@ -40,7 +38,20 @@ sealed class CampaignActionMethod : MailchimpMethod() { * [Schedule a campaign for delivery](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#action-post_campaigns_campaign_id_actions_schedule) */ @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}/actions/schedule") - class Schedule(@JvmField @PathParam val campaign_id: String) : CampaignActionMethod() + class Schedule(@JvmField @PathParam val campaign_id: String) : CampaignActionMethod() { + + /** + * The date and time in UTC to schedule the campaign for delivery. Campaigns may only be scheduled to send on the quarter-hour (:00, :15, :30, :45). + */ + @JvmField + @Field + var schedule_time: Date? = null + + @JvmField + @Field + var timewarp: Boolean? = null + + } /** * [Send a MailChimp campaign](https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#action-post_campaigns_campaign_id_actions_send) From 15fa34b40c62ef5e5b67cc7fa368380748a9bc96 Mon Sep 17 00:00:00 2001 From: Vasily Karyaev Date: Sun, 12 Mar 2017 08:23:11 +0400 Subject: [PATCH 24/27] version updated --- publish.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish.gradle b/publish.gradle index 4cf3886..45de254 100644 --- a/publish.gradle +++ b/publish.gradle @@ -3,7 +3,7 @@ apply plugin: 'signing' group = 'com.ecwid' archivesBaseName = "maleorang" -version = '3.0-0.9.5' +version = '3.0-0.9.6' task javadocJar(type: Jar) { classifier = 'javadoc' From 2cd7161e4eebe1edbd29246ae914f5d6b192b736 Mon Sep 17 00:00:00 2001 From: Vasily Karyaev Date: Mon, 3 Apr 2017 23:54:09 +0400 Subject: [PATCH 25/27] Fix link in documentation (#14) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index de43e19..0da5bd7 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ However, it is easy to extend the API and add support for any method you need (s ### Code samples * [Using an existing method implementation (Java)](src/test/java/com/ecwid/maleorang/examples/ExistingMethodExample.java) -* [Using an existing method implementation (Kotlin)](src/test/java/com/ecwid/maleorang/method/v3_0/members/MembersTest.kt) +* [Using an existing method implementation (Kotlin)](src/test/java/com/ecwid/maleorang/method/v3_0/lists/members/MembersTest.kt) * [Using a custom method implementation (Java)](src/test/java/com/ecwid/maleorang/examples/CustomMethodExample.java) ### Build tools integration From 9f7e202c391e312926bb64b557d95cd843cea410 Mon Sep 17 00:00:00 2001 From: lararojasm Date: Sat, 6 May 2017 22:16:19 -0300 Subject: [PATCH 26/27] a several changes --- build.gradle | 4 ++ .../com/ecwid/maleorang/MailchimpClient.kt | 3 +- .../ecwid/maleorang/MailchimpMethodInfo.kt | 11 ++--- .../com/ecwid/maleorang/MailchimpObject.kt | 5 -- .../maleorang/MailchimpObjectGsonFactory.kt | 3 +- .../lists/segments/DeleteSegmentMethod.kt | 2 +- .../v3_0/lists/segments/EditSegmentMethod.kt | 2 +- .../v3_0/lists/segments/GetSegmentMethod.kt | 2 +- .../v3_0/lists/segments/GetSegmentsMethod.kt | 4 +- .../method/v3_0/lists/segments/SegmentInfo.kt | 2 +- .../method/v3_0/lists/segments/TypeSegment.kt | 2 +- .../v3_0/reports/CampaignLocationInfo.kt | 22 +++++++++ .../reports/GetCampaignsLocationMethod.kt | 49 +++++++++++++++++++ .../reports/email/CampaignEmailAbuseInfo.kt | 44 +++++++++++++++++ .../email/EmailReportActivityDetails.kt | 15 ++++-- .../GetCampaignsAbuseEmailActivityMethod.kt | 40 +++++++++++++++ .../email/GetCampaignsEmailActivityMethod.kt | 2 +- .../v3_0/reports/email/TypeBounceActivity.kt | 16 ++++++ .../v3_0/reports/email/TypeEmailActivity.kt | 5 ++ 19 files changed, 207 insertions(+), 26 deletions(-) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignLocationInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignsLocationMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/CampaignEmailAbuseInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignsAbuseEmailActivityMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/TypeBounceActivity.kt diff --git a/build.gradle b/build.gradle index 624da62..0172222 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,5 @@ buildscript { + ext.kotlin_version = '1.1.2-2' repositories { mavenCentral() jcenter() @@ -6,10 +7,12 @@ buildscript { dependencies { classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.9" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.3" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } apply from: 'wrapper.gradle' +apply plugin: 'kotlin' apply from: 'compile.gradle' apply from: 'test.gradle' apply from: 'publish.gradle' @@ -27,4 +30,5 @@ dependencies { compile 'joda-time:joda-time:2.9.4' testCompile 'org.testng:testng:6.8.21' + compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version" } diff --git a/src/main/java/com/ecwid/maleorang/MailchimpClient.kt b/src/main/java/com/ecwid/maleorang/MailchimpClient.kt index 146185c..3ca15b7 100644 --- a/src/main/java/com/ecwid/maleorang/MailchimpClient.kt +++ b/src/main/java/com/ecwid/maleorang/MailchimpClient.kt @@ -64,8 +64,9 @@ open class MailchimpClient protected constructor ( code = error.get("status").asInt description = error.get("detail").asString } + throw MailchimpException(code, response.responseBody.toString()) + //throw MailchimpException(code, description) - throw MailchimpException(code, description) } return MailchimpObject.fromJson(response.responseBody ?: "{}", method.resultType) diff --git a/src/main/java/com/ecwid/maleorang/MailchimpMethodInfo.kt b/src/main/java/com/ecwid/maleorang/MailchimpMethodInfo.kt index 8d17315..783f9b9 100644 --- a/src/main/java/com/ecwid/maleorang/MailchimpMethodInfo.kt +++ b/src/main/java/com/ecwid/maleorang/MailchimpMethodInfo.kt @@ -1,14 +1,10 @@ package com.ecwid.maleorang import com.ecwid.maleorang.annotation.* -import com.ecwid.maleorang.annotation.Method -import com.ecwid.maleorang.util.DateUtil.formatDate import com.ecwid.maleorang.util.ClassUtil.getAnnotatedFields - +import com.ecwid.maleorang.util.DateUtil.formatDate import java.net.URLEncoder -import java.util.Collections -import java.util.Date -import java.util.TreeMap +import java.util.* import java.util.regex.Matcher import java.util.regex.Pattern @@ -34,7 +30,8 @@ internal class MailchimpMethodInfo(private val method: MailchimpMethod<*>) { val requestBody: String? = when (httpMethod) { HttpMethod.POST, HttpMethod.PATCH, HttpMethod.PUT -> method.toJson() - else -> null.apply { require(method.mapping.isEmpty(), { "$httpMethod method is not supposed to have request body: $method" }) } + else -> null.apply { require(method.mapping.isEmpty(), { "$httpMethod method is not supposed to have request " + + "body: $method mapping: "+ method.mapping }) } } fun buildUrl(apiKey: String): String { diff --git a/src/main/java/com/ecwid/maleorang/MailchimpObject.kt b/src/main/java/com/ecwid/maleorang/MailchimpObject.kt index 964bf14..c75a621 100644 --- a/src/main/java/com/ecwid/maleorang/MailchimpObject.kt +++ b/src/main/java/com/ecwid/maleorang/MailchimpObject.kt @@ -1,6 +1,5 @@ package com.ecwid.maleorang -import com.ecwid.maleorang.annotation.Field import com.google.gson.JsonParseException @@ -20,10 +19,6 @@ open class MailchimpObject { @JvmField val mapping: MutableMap = MailchimpObjectMapping(this) - @JvmField - @Field - var _links: List? = null - /** * Serializes this object to JSON. */ diff --git a/src/main/java/com/ecwid/maleorang/MailchimpObjectGsonFactory.kt b/src/main/java/com/ecwid/maleorang/MailchimpObjectGsonFactory.kt index b0fb8d0..1e6b7cd 100644 --- a/src/main/java/com/ecwid/maleorang/MailchimpObjectGsonFactory.kt +++ b/src/main/java/com/ecwid/maleorang/MailchimpObjectGsonFactory.kt @@ -4,9 +4,8 @@ import com.ecwid.maleorang.util.DateUtil.formatDate import com.ecwid.maleorang.util.DateUtil.parseDate import com.google.gson.* import com.google.gson.reflect.TypeToken - import java.lang.reflect.Type -import java.util.Date +import java.util.* /** * Factory creating [Gson] objects to be used for MailChimp API calls wrapping. diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt index 91f3d3e..7198b6e 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/DeleteSegmentMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.list.segments +package com.ecwid.maleorang.method.v3_0.lists.segments import com.ecwid.maleorang.MailchimpMethod import com.ecwid.maleorang.MailchimpObject diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt index 7c5f840..d1917f1 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/EditSegmentMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.list.segments +package com.ecwid.maleorang.method.v3_0.lists.segments import com.ecwid.maleorang.MailchimpMethod import com.ecwid.maleorang.MailchimpObject diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt index 351a0f4..79e5e34 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.list.segments +package com.ecwid.maleorang.method.v3_0.lists.segments import com.ecwid.maleorang.MailchimpMethod diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt index dcac007..add5a32 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/GetSegmentsMethod.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.list.segments +package com.ecwid.maleorang.method.v3_0.lists.segments import com.ecwid.maleorang.MailchimpMethod @@ -38,7 +38,7 @@ class GetSegmentsMethod( @JvmField @QueryStringParam - var since_create_at: Date? = null + var since_created_at: Date? = null @JvmField @QueryStringParam diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt index 1ccba23..b375337 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/SegmentInfo.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.list.segments +package com.ecwid.maleorang.method.v3_0.lists.segments import com.ecwid.maleorang.MailchimpObject import com.ecwid.maleorang.annotation.Field diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt index abaec43..b3e830a 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/lists/segments/TypeSegment.kt @@ -1,4 +1,4 @@ -package com.ecwid.maleorang.method.v3_0.list.segments +package com.ecwid.maleorang.method.v3_0.lists.segments /** * Created by: Manuel Lara diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignLocationInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignLocationInfo.kt new file mode 100644 index 0000000..1c97920 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/CampaignLocationInfo.kt @@ -0,0 +1,22 @@ +package com.ecwid.maleorang.method.v3_0.reports + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field + +/** + * Created by: Manuel Lara + */ + +class CampaignLocationInfo : MailchimpObject() { + @JvmField + @Field + var country_code: String? = null + + @JvmField + @Field + var region: String? = null + + @JvmField + @Field + var opens: Int? = null +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignsLocationMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignsLocationMethod.kt new file mode 100644 index 0000000..d016c6f --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/GetCampaignsLocationMethod.kt @@ -0,0 +1,49 @@ +package com.ecwid.maleorang.method.v3_0.reports + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* + +/** + * Created by: Manuel Lara + */ + +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/reports/{campaign_id}/locations") +class GetCampaignLocationMethod( + @JvmField + @PathParam + val campaign_id: String +) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + @JvmField + @QueryStringParam + var count: Int? = null + + @JvmField + @QueryStringParam + var offset: Int? = null + + + class Response : MailchimpObject() { + @JvmField + @Field + var locations: List? = null + + @JvmField + @Field + var campaign_id: String? = null + + @JvmField + @Field + var total_items: Int? = null + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/CampaignEmailAbuseInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/CampaignEmailAbuseInfo.kt new file mode 100644 index 0000000..ccaf536 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/CampaignEmailAbuseInfo.kt @@ -0,0 +1,44 @@ +package com.ecwid.maleorang.method.v3_0.reports.email + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import java.util.* + +/** + * Created by: Manuel Lara + */ + +class CampaignEmailAbuseInfo : MailchimpObject() { + @JvmField + @Field + var id: Int? = null + + @JvmField + @Field + var campaign_id: String? = null + + @JvmField + @Field + var list_id: String? = null + + @JvmField + @Field + var email_id: String? = null + + @JvmField + @Field + var email_address: String? = null + + @JvmField + @Field + var merge_fields: MailchimpObject? = null + + @JvmField + @Field + var vip: Boolean? = null + + @JvmField + @Field + var date: Date? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/EmailReportActivityDetails.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/EmailReportActivityDetails.kt index 4335091..a86ce8f 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/EmailReportActivityDetails.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/EmailReportActivityDetails.kt @@ -11,11 +11,11 @@ import java.util.* class EmailReportActivityDetails : MailchimpObject() { @JvmField @Field - var action: String? = null + var action: TypeEmailActivity? = null @JvmField @Field - var type: TypeEmailActivity? = null + var type: TypeBounceActivity? = null @JvmField @Field @@ -28,5 +28,14 @@ class EmailReportActivityDetails : MailchimpObject() { @JvmField @Field var ip: String? = null - + + + fun setAction(action: String) { + this.action = TypeEmailActivity.valueOf(action) + } + + fun setType(type: String) { + this.type = TypeBounceActivity.valueOf(type) + } + } diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignsAbuseEmailActivityMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignsAbuseEmailActivityMethod.kt new file mode 100644 index 0000000..54ab5f8 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignsAbuseEmailActivityMethod.kt @@ -0,0 +1,40 @@ +package com.ecwid.maleorang.method.v3_0.reports.email + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* + +/** + * Created by: Manuel Lara + */ + +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/reports/{campaign_id}/abuse-reports") +class GetCampaignsAbuseEmailActivityMethod( + @JvmField + @PathParam + val campaign_id: String +) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + class Response : MailchimpObject() { + @JvmField + @Field + var abuse_report: List? = null + + @JvmField + @Field + var campaign_id: String? = null + + @JvmField + @Field + var total_items: Int? = null + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignsEmailActivityMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignsEmailActivityMethod.kt index 058124c..777b96d 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignsEmailActivityMethod.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/GetCampaignsEmailActivityMethod.kt @@ -27,7 +27,7 @@ class GetCampaignsEmailActivityMethod( @JvmField @QueryStringParam - var count: Int? = null + var count: Int? = 0 @JvmField @QueryStringParam diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/TypeBounceActivity.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/TypeBounceActivity.kt new file mode 100644 index 0000000..a0a91a5 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/TypeBounceActivity.kt @@ -0,0 +1,16 @@ +package com.ecwid.maleorang.method.v3_0.reports.email + +import com.google.gson.annotations.SerializedName + +/** + * Created by larar on 15/10/2016. + */ + +enum class TypeBounceActivity(val type: String) { + @SerializedName("hard") + HARD("hard"), + @SerializedName("soft") + SOFT("soft"), + @SerializedName("null") + NONE("null") +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/TypeEmailActivity.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/TypeEmailActivity.kt index 84d6a17..773e38d 100644 --- a/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/TypeEmailActivity.kt +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/reports/email/TypeEmailActivity.kt @@ -1,11 +1,16 @@ package com.ecwid.maleorang.method.v3_0.reports.email +import com.google.gson.annotations.SerializedName + /** * Created by larar on 15/10/2016. */ enum class TypeEmailActivity(val type: String) { + @SerializedName("bounce") BOUNCE("bounce"), + @SerializedName("click") CLICK("click"), + @SerializedName("open") OPEN("open") } \ No newline at end of file From 87faafc0e09f9e3524715ac849ff6e31ded1619a Mon Sep 17 00:00:00 2001 From: lararojasm Date: Wed, 17 May 2017 03:23:30 -0300 Subject: [PATCH 27/27] automation --- .../automation/GetAutomationEmailMethod.kt | 31 +++++++ .../automation/GetAutomationEmailsMethod.kt | 34 ++++++++ .../v3_0/automation/GetAutomationMethod.kt | 25 ++++++ .../v3_0/automation/GetAutomationsMethod.kt | 56 ++++++++++++ .../automation/GetQueueAutomationMethod.kt | 45 ++++++++++ .../GetQueueEmailAutomationMethod.kt | 28 ++++++ .../automation/QueueEmailAutomationMethod.kt | 28 ++++++ .../automation/ToggleAutomationMethods.kt | 35 ++++++++ .../ToggleEmailAutomationMethods.kt | 43 ++++++++++ .../info/AutomationCampaignSetting.kt | 44 ++++++++++ .../automation/info/QueueEmailListInfo.kt | 85 +++++++++++++++++++ .../automation/info/RecipientsWorkflowInfo.kt | 23 +++++ .../automation/info/ReportSummaryWorkflow.kt | 37 ++++++++ .../automation/info/TrackingWorkflowInfo.kt | 48 +++++++++++ .../v3_0/automation/info/WorkflowEmailInfo.kt | 85 +++++++++++++++++++ .../automation/info/WorkflowEmailQueue.kt | 41 +++++++++ .../v3_0/automation/info/WorkflowInfo.kt | 57 +++++++++++++ .../java/com/ecwid/maleorang/util/DateUtil.kt | 1 - 18 files changed, 745 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationEmailMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationEmailsMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationsMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetQueueAutomationMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetQueueEmailAutomationMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/QueueEmailAutomationMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/ToggleAutomationMethods.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/ToggleEmailAutomationMethods.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/AutomationCampaignSetting.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/QueueEmailListInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/RecipientsWorkflowInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/ReportSummaryWorkflow.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/TrackingWorkflowInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/WorkflowEmailInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/WorkflowEmailQueue.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/WorkflowInfo.kt diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationEmailMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationEmailMethod.kt new file mode 100644 index 0000000..9a4533d --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationEmailMethod.kt @@ -0,0 +1,31 @@ +package com.ecwid.maleorang.method.v3_0.automation + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.method.v3_0.automation.info.WorkflowEmailInfo + + +/** + * [Get information about automations](http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/#read-get_automations_workflow_id_emails_workflow_email_id) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/automations/{workflow_id}/emails/{workflow_email_id}") +class GetAutomationEmailMethod( + + @JvmField + @PathParam + val workflow_id: String, + + @JvmField + @PathParam + val workflow_email_id: String + +) : MailchimpMethod() { + + class Response : MailchimpObject() { + @JvmField + @Field + var email: WorkflowEmailInfo? = null + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationEmailsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationEmailsMethod.kt new file mode 100644 index 0000000..12b3fe1 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationEmailsMethod.kt @@ -0,0 +1,34 @@ +package com.ecwid.maleorang.method.v3_0.automation + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.method.v3_0.automation.info.WorkflowEmailInfo + +/** + * [Get information about automations](http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/#read-get_automations_workflow_id) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/automations/{workflow_id}/emails") +class GetAutomationEmailsMethod( + + @JvmField + @PathParam + val workflow_id: String + +) : MailchimpMethod() { + + class Response : MailchimpObject() { + @JvmField + @Field + var emails: List? = null + + @JvmField + @Field + var total_items: Int? = null + + @JvmField + @Field + var _links: MailchimpObject? = null + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationMethod.kt new file mode 100644 index 0000000..211ce76 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationMethod.kt @@ -0,0 +1,25 @@ +package com.ecwid.maleorang.method.v3_0.automation + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.method.v3_0.automation.info.WorkflowInfo + +/** + * [Get information about a specific automation workflow](http://developer.mailchimp.com/documentation/mailchimp/reference/automations/#read-get_automations_workflow_id) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/automations/{workflow_id}") +class GetAutomationMethod( + @JvmField + @PathParam + val workflow_id: String +) : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationsMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationsMethod.kt new file mode 100644 index 0000000..dd7c329 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetAutomationsMethod.kt @@ -0,0 +1,56 @@ +package com.ecwid.maleorang.method.v3_0.automation + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.method.v3_0.automation.info.WorkflowInfo + +/** + * [Get information about automations](http://developer.mailchimp.com/documentation/mailchimp/reference/automations/#read-get_automations) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/automations") +class GetAutomationsMethod : MailchimpMethod() { + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null + + @JvmField + @QueryStringParam + var before_create_time: String? = null + + @JvmField + @QueryStringParam + var since_create_time: String? = null + + @JvmField + @QueryStringParam + var before_send_time: String? = null + + @JvmField + @QueryStringParam + var since_send_time: String? = null + + @JvmField + @QueryStringParam + var status: String? = null + + class Response : MailchimpObject() { + @JvmField + @Field + var automations: List? = null + + @JvmField + @Field + var total_items: Int? = null + + @JvmField + @Field + var _links: MailchimpObject? = null + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetQueueAutomationMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetQueueAutomationMethod.kt new file mode 100644 index 0000000..f43b8b7 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetQueueAutomationMethod.kt @@ -0,0 +1,45 @@ +package com.ecwid.maleorang.method.v3_0.automation + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.method.v3_0.automation.info.WorkflowEmailQueue + + +/** + * [Get information about automations](http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/#read-get_automations_workflow_id_emails_workflow_email_id) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/automations/{workflow_id}/emails/{workflow_email_id}/queue") +class GetQueueAutomationMethod( + + @JvmField + @PathParam + val workflow_id: String, + + @JvmField + @PathParam + val workflow_email_id: String + +) : MailchimpMethod(){ + + class Response : MailchimpObject() { + + @JvmField + @Field + var workflow_id: String? = null + + @JvmField + @Field + var email_id: String? = null + + @JvmField + @Field + var queue: List? = null + + @JvmField + @Field + var total_items: Int? = null + + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetQueueEmailAutomationMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetQueueEmailAutomationMethod.kt new file mode 100644 index 0000000..e7fbd14 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/GetQueueEmailAutomationMethod.kt @@ -0,0 +1,28 @@ +package com.ecwid.maleorang.method.v3_0.automation + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.method.v3_0.automation.info.WorkflowEmailQueue + + +/** + * [Get information about automations](http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/#read-get_automations_workflow_id_emails_workflow_email_id) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/automations/{workflow_id}/emails/{workflow_email_id}/queue/{subscriber_hash}") +class GetQueueEmailAutomationMethod( + + @JvmField + @PathParam + val workflow_id: String, + + @JvmField + @PathParam + val workflow_email_id: String, + + @JvmField + @PathParam + val subscriber_hash: String + +) : MailchimpMethod() diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/QueueEmailAutomationMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/QueueEmailAutomationMethod.kt new file mode 100644 index 0000000..cae66c0 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/QueueEmailAutomationMethod.kt @@ -0,0 +1,28 @@ +package com.ecwid.maleorang.method.v3_0.automation + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.method.v3_0.automation.info.WorkflowEmailQueue + + +/** + * [Get information about automations](http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/#read-get_automations_workflow_id_emails_workflow_email_id) + */ +@Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/automations/{workflow_id}/emails/{workflow_email_id}/queue") +class QueueEmailAutomationMethod( + + @JvmField + @PathParam + val workflow_id: String, + + @JvmField + @PathParam + val workflow_email_id: String + +) : MailchimpMethod(){ + + @JvmField + @PathParam + val email_address: String? = null +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/ToggleAutomationMethods.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/ToggleAutomationMethods.kt new file mode 100644 index 0000000..145808d --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/ToggleAutomationMethods.kt @@ -0,0 +1,35 @@ +package com.ecwid.maleorang.method.v3_0.automation + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* + +/** + * Base class for automations activate/deactivate operations + */ +sealed class ToggleAutomationMethods : MailchimpMethod() { + /** + * [Pause Automation](http://developer.mailchimp.com/documentation/mailchimp/reference/automations/#) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/automations/{workflow_id}/actions/pause-all-emails") + class Deactivate( + + @JvmField + @PathParam + val workflow_id: String + + ) : ToggleAutomationMethods() + + /** + * [Activate Automation](http://developer.mailchimp.com/documentation/mailchimp/reference/automations/#) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/automations/{workflow_id}/actions/start-all-emails") + class Activate( + + @JvmField + @PathParam + val workflow_id: String + + ) : ToggleAutomationMethods() + +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/ToggleEmailAutomationMethods.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/ToggleEmailAutomationMethods.kt new file mode 100644 index 0000000..cef777d --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/ToggleEmailAutomationMethods.kt @@ -0,0 +1,43 @@ +package com.ecwid.maleorang.method.v3_0.automation + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* + +/** + * Base class for automations activate/deactivate operations + */ +sealed class ToggleEmailAutomationMethods : MailchimpMethod() { + /** + * [Pause Automation](http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/#action-post_automations_workflow_id_emails_workflow_email_id_actions_pause) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/automations/{workflow_id}/emails/{workflow_email_id}/actions/pause") + class Deactivate( + + @JvmField + @PathParam + val workflow_id: String, + + @JvmField + @PathParam + val workflow_email_id: String + + ) : ToggleEmailAutomationMethods() + + /** + * [Activate Automation](http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/#action-post_automations_workflow_id_emails_workflow_email_id_actions_start) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/automations/{workflow_id}/emails/{workflow_email_id}/actions/start") + class Activate( + + @JvmField + @PathParam + val workflow_id: String, + + @JvmField + @PathParam + val workflow_email_id: String + + ) : ToggleEmailAutomationMethods() + +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/AutomationCampaignSetting.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/AutomationCampaignSetting.kt new file mode 100644 index 0000000..7580dc8 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/AutomationCampaignSetting.kt @@ -0,0 +1,44 @@ +package com.ecwid.maleorang.method.v3_0.automation.info + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field + +/** + * Created by: Manuel Lara + */ + +class AutomationCampaignSetting : MailchimpObject() { + + @JvmField + @Field + var title: String? = null + + @JvmField + @Field + var from_name: String? = null + + @JvmField + @Field + var reply_to: String? = null + + @JvmField + @Field + var use_conversation: Boolean? = null + + @JvmField + @Field + var to_name: String? = null + + @JvmField + @Field + var authenticate: Boolean? = null + + @JvmField + @Field + var auto_footer: Boolean? = null + + @JvmField + @Field + var inline_css: Boolean? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/QueueEmailListInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/QueueEmailListInfo.kt new file mode 100644 index 0000000..157da94 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/QueueEmailListInfo.kt @@ -0,0 +1,85 @@ +package com.ecwid.maleorang.method.v3_0.automation.info + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import com.ecwid.maleorang.method.v3_0.campaign.* +import java.util.* + +/** + * Created by Ing. Manuel Lara on 07/05/17. + */ +class QueueEmailListInfo : MailchimpObject() { + + @JvmField + @Field + var id: String? = null + + @JvmField + @Field + var workflow_id: String? = null + + @JvmField + @Field + var position: String? = null + + @JvmField + @Field + var delay: MailchimpObject? = null + + @JvmField + @Field + var create_time: String? = null + + @JvmField + @Field + var start_time: String? = null + + @JvmField + @Field + var status: String? = null + + @JvmField + @Field + var archive_url: String? = null + + @JvmField + @Field + var emails_sent: String? = null + + @JvmField + @Field + var send_time: String? = null + + @JvmField + @Field + var content_type: String? = null + + @JvmField + @Field + var social_card: MailchimpObject? = null + + @JvmField + @Field + var recipients: RecipientsWorkflowInfo? = null + + @JvmField + @Field + var settings: AutomationCampaignSetting? = null + + @JvmField + @Field + var tracking: TrackingWorkflowInfo? = null + + @JvmField + @Field + var trigger_settings: MailchimpObject? = null + + @JvmField + @Field + var report_summary: ReportSummaryWorkflow? = null + + @JvmField + @Field + var _links: MailchimpObject? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/RecipientsWorkflowInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/RecipientsWorkflowInfo.kt new file mode 100644 index 0000000..7f0a6fd --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/RecipientsWorkflowInfo.kt @@ -0,0 +1,23 @@ +package com.ecwid.maleorang.method.v3_0.automation.info + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field + +/** + * Created by: Manuel Lara + */ + +class RecipientsWorkflowInfo : MailchimpObject() { + @JvmField + @Field + var list_id: String? = null + + @JvmField + @Field + var list_name: String? = null + + @JvmField + @Field + var segment_opts: MailchimpObject? = null //TODO create SegmentOpts Object + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/ReportSummaryWorkflow.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/ReportSummaryWorkflow.kt new file mode 100644 index 0000000..b6921f4 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/ReportSummaryWorkflow.kt @@ -0,0 +1,37 @@ +package com.ecwid.maleorang.method.v3_0.automation.info + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field + +/** + * Created by: Manuel Lara + */ + +class ReportSummaryWorkflow : MailchimpObject() { + + @JvmField + @Field + var opens: Int? = null + + @JvmField + @Field + var unique_opens: Int? = null + + @JvmField + @Field + var open_rate: Double? = null + + @JvmField + @Field + var clicks: Int? = null + + @JvmField + @Field + var subscriber_clicks: Int? = null + + @JvmField + @Field + var click_rate: Int? = null + + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/TrackingWorkflowInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/TrackingWorkflowInfo.kt new file mode 100644 index 0000000..8d95185 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/TrackingWorkflowInfo.kt @@ -0,0 +1,48 @@ +package com.ecwid.maleorang.method.v3_0.automation.info + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field + +/** + * Created by: Manuel Lara + */ + +class TrackingWorkflowInfo : MailchimpObject() { + + @JvmField + @Field + var opens: Boolean? = null + + @JvmField + @Field + var html_clicks: Boolean? = null + + @JvmField + @Field + var text_clicks: Boolean? = null + + @JvmField + @Field + var goal_tracking: Boolean? = null + + @JvmField + @Field + var ecomm360: Boolean? = null + + @JvmField + @Field + var google_analytics: Boolean? = null + + @JvmField + @Field + var clicktale: Boolean? = null + + @JvmField + @Field + var salesforce: MailchimpObject? = null + + @JvmField + @Field + var capsule: MailchimpObject? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/WorkflowEmailInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/WorkflowEmailInfo.kt new file mode 100644 index 0000000..35d0f80 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/WorkflowEmailInfo.kt @@ -0,0 +1,85 @@ +package com.ecwid.maleorang.method.v3_0.automation.info + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import com.ecwid.maleorang.method.v3_0.campaign.* +import java.util.* + +/** + * Created by Ing. Manuel Lara on 07/05/17. + */ +class WorkflowEmailInfo : MailchimpObject() { + + @JvmField + @Field + var id: String? = null + + @JvmField + @Field + var workflow_id: String? = null + + @JvmField + @Field + var position: String? = null + + @JvmField + @Field + var delay: MailchimpObject? = null + + @JvmField + @Field + var create_time: String? = null + + @JvmField + @Field + var start_time: String? = null + + @JvmField + @Field + var status: String? = null + + @JvmField + @Field + var archive_url: String? = null + + @JvmField + @Field + var emails_sent: String? = null + + @JvmField + @Field + var send_time: String? = null + + @JvmField + @Field + var content_type: String? = null + + @JvmField + @Field + var social_card: MailchimpObject? = null + + @JvmField + @Field + var recipients: RecipientsWorkflowInfo? = null + + @JvmField + @Field + var settings: AutomationCampaignSetting? = null + + @JvmField + @Field + var tracking: TrackingWorkflowInfo? = null + + @JvmField + @Field + var trigger_settings: MailchimpObject? = null + + @JvmField + @Field + var report_summary: ReportSummaryWorkflow? = null + + @JvmField + @Field + var _links: MailchimpObject? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/WorkflowEmailQueue.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/WorkflowEmailQueue.kt new file mode 100644 index 0000000..de8dee5 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/WorkflowEmailQueue.kt @@ -0,0 +1,41 @@ +package com.ecwid.maleorang.method.v3_0.automation.info + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import com.ecwid.maleorang.method.v3_0.campaign.* +import java.util.* + +/** + * Created by Ing. Manuel Lara on 07/05/17. + */ +class WorkflowEmailQueue : MailchimpObject() { + + @JvmField + @Field + var id: String? = null + + @JvmField + @Field + var workflow_id: String? = null + + @JvmField + @Field + var email_id: String? = null + + @JvmField + @Field + var list_id: MailchimpObject? = null + + @JvmField + @Field + var email_address: String? = null + + @JvmField + @Field + var next_send: String? = null + + @JvmField + @Field + var _links: MailchimpObject? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/WorkflowInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/WorkflowInfo.kt new file mode 100644 index 0000000..5cda3a8 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/automation/info/WorkflowInfo.kt @@ -0,0 +1,57 @@ +package com.ecwid.maleorang.method.v3_0.automation.info + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import com.ecwid.maleorang.method.v3_0.campaign.* +import java.util.* + +/** + * Created by Ing. Manuel Lara on 07/05/17. + */ +class WorkflowInfo : MailchimpObject() { + + @JvmField + @Field + var id: String? = null + + @JvmField + @Field + var create_time: String? = null + + @JvmField + @Field + var start_time: String? = null + + @JvmField + @Field + var status: String? = null + + @JvmField + @Field + var emails_sent: String? = null + + @JvmField + @Field + var recipients: RecipientsWorkflowInfo? = null + + @JvmField + @Field + var settings: AutomationCampaignSetting? = null + + @JvmField + @Field + var tracking: TrackingWorkflowInfo? = null + + @JvmField + @Field + var trigger_settings: MailchimpObject? = null + + @JvmField + @Field + var report_summary: ReportSummaryWorkflow? = null + + @JvmField + @Field + var _links: MailchimpObject? = null + +} diff --git a/src/main/java/com/ecwid/maleorang/util/DateUtil.kt b/src/main/java/com/ecwid/maleorang/util/DateUtil.kt index 12414e5..265393f 100644 --- a/src/main/java/com/ecwid/maleorang/util/DateUtil.kt +++ b/src/main/java/com/ecwid/maleorang/util/DateUtil.kt @@ -6,7 +6,6 @@ import java.util.* internal object DateUtil { private val format = ISODateTimeFormat.dateTimeNoMillis().withZone(DateTimeZone.UTC) - fun formatDate(date: Date) = format.print(date.time) fun parseDate(string: String) = Date(format.parseMillis(string)) }