-
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?
Conversation
… reportes de los correos electronicos. Se suben los modelos, se corrigen detalles en campañas.
… reportes de los correos electronicos. Se suben los modelos, se corrigen detalles en campañas. Se lava el codigo y de somentan las clases y metodos.
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.
Thank you for your contribution !
See my comments for specific points.
For general aspects:
-Prefer english for your commits
-keep same hierarchy as resources / sub-resources and packages / sub-packages (reports should not be under campaigns but aside)
-Don't forget to write tests for your methods
|
||
@JvmField | ||
@Field | ||
var type: String? = null |
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.
Maybe we can use an Enum for field "type":
From the doc: Possible Values: regular, plaintext, absplit, rss, variate
@JvmField | ||
@Field | ||
var emails_sent: Int? = null | ||
|
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.
We should add TODOs for fields that are not yet included. It will be easier to track them and add them afterwords.
For example: //TODO: Add send_time field
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.
added my friend
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.
ready
@JvmField | ||
@Field | ||
var recipients: RecipientsCampaignInfo? = null | ||
|
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.
TODO settings
TODO variate_settings
TODO tracking
TODO rss_opts
TODO ab_split_opts
TODO social_card
TODO report_summary
TODO delivery_status
@JvmField | ||
@Field | ||
var recipients: RecipientsCampaignInfo? = null | ||
|
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.
_links field has already been created in my last pull request.
We will need to move it to src/main/java/com/ecwid/maleorang/method/v3_0/
and then use it globally.
You can add a TODO also for this field.
|
||
@JvmField | ||
@QueryStringParam | ||
var since_send_opt: String? = null |
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.
Field name is since_send_time
not since_send_opt
var offset: Int? = null | ||
|
||
|
||
class Response : MailchimpObject() { |
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.
Response does not match this Method !
Should use CampaignEmailActivityInfo
* Created by: Manuel Lara <[email protected]> | ||
*/ | ||
|
||
class EmailReportActivityDetails : MailchimpObject() { |
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.
in package reports/email_activity/
with name Activity.kt
* Created by: Manuel Lara <[email protected]> | ||
*/ | ||
|
||
class CampaignEmailActivityInfo : MailchimpObject() { |
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.
in package reports/email_activity/
with name EmailActivity.kt
|
||
@JvmField | ||
@Field | ||
var activity: EmailReportActivityDetails? = null |
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.
Type should be List<EmailReportActivityDetails>
as it is an Array
@JvmField | ||
@Field | ||
var activity: EmailReportActivityDetails? = null | ||
|
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.
TODO _links
I agree, I will review all what you suggest to change. Ok, in English now and then. Some things really do not notice them, but I'll be careful. When you turn up the commit, I let you know. Thanks for your time. |
…pe in emails report and other fixes.
publish.gradle
Outdated
@@ -3,7 +3,7 @@ apply plugin: 'signing' | |||
|
|||
group = 'com.ecwid' | |||
archivesBaseName = "maleorang" | |||
version = '3.0-0.9.4' | |||
version = '3.0-0.9.5' |
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.
Please remove the version change. I will update the version number myself when release a new version
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.
Ready!
|
||
@JvmField | ||
@Field | ||
var create_time: String? = null |
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.
This field should be of type Date
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.
Ready my friend!
|
||
@JvmField | ||
@QueryStringParam | ||
var before_send_time: String? = null |
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.
This field should be of type Date
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.
yes, you got right! i changed that.
|
||
@JvmField | ||
@QueryStringParam | ||
var since_send_opt: String? = null |
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.
This field should be of type Date
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.
ready
|
||
@JvmField | ||
@QueryStringParam | ||
var before_create_time: String? = null |
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.
This field should be of type Date
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.
ready
|
||
@JvmField | ||
@QueryStringParam | ||
var since_create_time: String? = null |
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.
This field should be of type Date
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.
ready
|
||
@JvmField | ||
@Field | ||
var send_time: String? = null |
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.
This field should be of type Date
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.
ready.
|
||
@JvmField | ||
@QueryStringParam | ||
var since_send_time: String? = null |
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.
This field should be of type Date
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.
solved
|
||
@JvmField | ||
@QueryStringParam | ||
var before_send_time: String? = null |
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.
This field should be of type Date
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.
solved
|
||
@JvmField | ||
@QueryStringParam | ||
var since_send_time: String? = null |
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.
This field should be of type Date
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.
solved
Added processing response isn't JSON
Ready all changes that you request my friend, sorry for the delay |
I just have to create a test classes, but i using this code in a private project and its works fine, just I don't have time right now, but if you can help me implementing that classes, i will be grateful. What do you say? |
@@ -19,6 +20,10 @@ open class MailchimpObject { | |||
@JvmField | |||
val mapping: MutableMap<String, Any?> = MailchimpObjectMapping(this) | |||
|
|||
@JvmField | |||
@Field | |||
var _links: List<String>? = null |
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.
No, I don't think this is a good idea to add this field to the base class, since the class is used also for requests, where there is no such fields.
I personally think that _links fields are useless, don't they? I'd prefer them not be added at all. But if you want to add them, please add them to specific response classes.
|
||
@JvmField | ||
@Field | ||
var use_conversation: String? = null |
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.
Shouldn't this be a boolean field?
|
||
@JvmField | ||
@QueryStringParam | ||
var since_send_opt: String? = null |
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.
This should be a Date field
|
||
@JvmField | ||
@QueryStringParam | ||
var type: String? = null |
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.
Since we added a enum for types, shouldn't this be a TypeCampaign?
|
||
@JvmField | ||
@Field | ||
var rss_last_send: String? = null |
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.
This should be a date
|
||
@JvmField | ||
@QueryStringParam | ||
var type: String? = null |
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.
Shouldn't this be the enum class you added for types?
Campaigns (+content & actions), create lists, merge-fields, email-activity & unsubscribed
# Conflicts: # 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" |
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.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
This was just a test change, right?
|
||
|
||
|
||
fun setAction(action: String) { |
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.
I don't think it is a good idea to have such methods, and they are not used as I see.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the default 0 here?
@SerializedName("soft") | ||
SOFT("soft"), | ||
@SerializedName("null") | ||
NONE("null") |
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.
I find it strange having the "NONE" value here. According to the documentation:
If the action is a ‘bounce’, the type of bounce received: ‘hard’, ‘soft’.
I created a new methods and model for campaigns and report. If you can see that, it will be great. I wanna begin to write a comment of this code. What is your opinion about that?