Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

New Methods for Integration Tools#7

Open
lararojasmr wants to merge 30 commits intoEcwid:masterfrom
lararojasmr:master
Open

New Methods for Integration Tools#7
lararojasmr wants to merge 30 commits intoEcwid:masterfrom
lararojasmr:master

Conversation

@lararojasmr
Copy link

@lararojasmr lararojasmr commented Oct 6, 2016

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?

lararojasmr added 4 commits October 5, 2016 04:05
… 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.
Copy link
Contributor

@apocheau apocheau left a 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
Copy link
Contributor

@apocheau apocheau Oct 6, 2016

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

Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added my friend

Copy link
Author

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

Copy link
Contributor

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

Copy link
Contributor

@apocheau apocheau Oct 6, 2016

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
Copy link
Contributor

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() {
Copy link
Contributor

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 <lararojas.mr@gmail.com>
*/

class EmailReportActivityDetails : MailchimpObject() {
Copy link
Contributor

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 <lararojas.mr@gmail.com>
*/

class CampaignEmailActivityInfo : MailchimpObject() {
Copy link
Contributor

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
Copy link
Contributor

@apocheau apocheau Oct 6, 2016

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO _links

@lararojasmr
Copy link
Author

lararojasmr commented Oct 6, 2016

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.

publish.gradle Outdated
group = 'com.ecwid'
archivesBaseName = "maleorang"
version = '3.0-0.9.4'
version = '3.0-0.9.5'

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

Copy link
Author

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

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

Copy link
Author

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

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

Copy link
Author

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

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

Copy link
Author

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

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

Copy link
Author

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

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

Copy link
Author

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

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

Copy link
Author

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

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

Copy link
Author

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

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

Copy link
Author

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

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solved

@lararojasmr
Copy link
Author

Ready all changes that you request my friend, sorry for the delay

@lararojasmr
Copy link
Author

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?


@JvmField
@Field
var _links: List<String>? = null

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

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

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

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

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

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?

Vasily Karyaev and others added 6 commits March 12, 2017 08:19
compile 'joda-time:joda-time:2.9.4'

testCompile 'org.testng:testng:6.8.21'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"

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.

description = error.get("detail").asString
}
throw MailchimpException(code, response.responseBody.toString())
//throw MailchimpException(code, description)

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) {

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.

@JvmField
@QueryStringParam
var count: Int? = null
var count: Int? = 0

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")

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’.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants