-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Methods for Integration Tools #7
base: master
Are you sure you want to change the base?
Changes from 1 commit
181e629
f0c7045
a24d259
a50ce33
91ce006
9d6e97c
c159b1c
f5747a8
5dfe3dd
e7bbf49
7911d6e
c5be5b9
b7de3bc
be94f38
4bfb690
9a412f0
2fe9b4b
b5d637f
7a18942
f8fab25
28af9a1
769ab6c
f393c9c
24cb92d
9bd83e2
15fa34b
2cd7161
9f7e202
87faafc
5b22bdc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was just a test change, right? |
||
|
||
throw MailchimpException(code, description) | ||
} | ||
|
||
return MailchimpObject.fromJson(response.responseBody ?: "{}", method.resultType) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
*/ | ||
|
||
class CampaignLocationInfo : MailchimpObject() { | ||
@JvmField | ||
@Field | ||
var country_code: String? = null | ||
|
||
@JvmField | ||
@Field | ||
var region: String? = null | ||
|
||
@JvmField | ||
@Field | ||
var opens: Int? = null | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
*/ | ||
|
||
@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/reports/{campaign_id}/locations") | ||
class GetCampaignLocationMethod( | ||
@JvmField | ||
@PathParam | ||
val campaign_id: String | ||
) : MailchimpMethod<GetCampaignLocationMethod.Response>() { | ||
|
||
@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<CampaignLocationInfo>? = null | ||
|
||
@JvmField | ||
@Field | ||
var campaign_id: String? = null | ||
|
||
@JvmField | ||
@Field | ||
var total_items: Int? = null | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
*/ | ||
|
||
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 | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it is a good idea to have such methods, and they are not used as I see. |
||
this.action = TypeEmailActivity.valueOf(action) | ||
} | ||
|
||
fun setType(type: String) { | ||
this.type = TypeBounceActivity.valueOf(type) | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
*/ | ||
|
||
@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/reports/{campaign_id}/abuse-reports") | ||
class GetCampaignsAbuseEmailActivityMethod( | ||
@JvmField | ||
@PathParam | ||
val campaign_id: String | ||
) : MailchimpMethod<GetCampaignsAbuseEmailActivityMethod.Response>() { | ||
|
||
@JvmField | ||
@QueryStringParam | ||
var fields: String? = null | ||
|
||
@JvmField | ||
@QueryStringParam | ||
var exclude_fields: String? = null | ||
|
||
class Response : MailchimpObject() { | ||
@JvmField | ||
@Field | ||
var abuse_report: List<CampaignEmailAbuseInfo>? = null | ||
|
||
@JvmField | ||
@Field | ||
var campaign_id: String? = null | ||
|
||
@JvmField | ||
@Field | ||
var total_items: Int? = null | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ class GetCampaignsEmailActivityMethod( | |
|
||
@JvmField | ||
@QueryStringParam | ||
var count: Int? = null | ||
var count: Int? = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need the default 0 here? |
||
|
||
@JvmField | ||
@QueryStringParam | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find it strange having the "NONE" value here. According to the documentation:
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean that the library won't be usable with java 6 & 7 projects? I'd prefer to keep the compatibility.