-
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 13 commits
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,6 +64,11 @@ if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePass | |
name 'Vasily Karyaev' | ||
email '[email protected]' | ||
} | ||
developer { | ||
id 'lararojasmr' | ||
name 'Manuel Lara' | ||
email '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
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.TypeCampaign | ||
import java.util.* | ||
|
||
/** | ||
* Created by: Manuel Lara <[email protected]> | ||
*/ | ||
|
||
class CampaignInfo : MailchimpObject() { | ||
@JvmField | ||
@Field | ||
var id: String? = null | ||
|
||
@JvmField | ||
@Field | ||
var type: TypeCampaign? = null | ||
|
||
@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: String? = null | ||
|
||
@JvmField | ||
@Field | ||
var emails_sent: Int? = 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. We should add TODOs for fields that are not yet included. It will be easier to track them and add them afterwords. 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. added my friend 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. ready |
||
@JvmField | ||
@Field | ||
var content_type: String? = null | ||
|
||
@JvmField | ||
@Field | ||
var recipients: RecipientsCampaignInfo? = null | ||
|
||
@JvmField | ||
@Field | ||
var settings: CampaignSettingsInfo? = 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. TODO settings 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. _links field has already been created in my last pull request. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
*/ | ||
|
||
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 | ||
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. Shouldn't this be a boolean field? |
||
|
||
@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 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.ecwid.maleorang.method.v3_0.campaign | ||
|
||
|
||
import com.ecwid.maleorang.MailchimpMethod | ||
import com.ecwid.maleorang.annotation.* | ||
import org.apache.commons.codec.digest.DigestUtils | ||
|
||
/** | ||
* Created by: Manuel Lara <[email protected]> | ||
*/ | ||
|
||
@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/campaigns/{campaign_id}") | ||
class GetCampaignMethod( | ||
@JvmField | ||
@PathParam | ||
val campaign_id: String | ||
) : MailchimpMethod<CampaignInfo>() { | ||
|
||
@JvmField | ||
@QueryStringParam | ||
var fields: String? = null | ||
|
||
@JvmField | ||
@QueryStringParam | ||
var exclude_fields: String? = null | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
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 <[email protected]> | ||
*/ | ||
|
||
@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/campaigns") | ||
class GetCampaignsMethod : MailchimpMethod<GetCampaignsMethod.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 | ||
|
||
@JvmField | ||
@QueryStringParam | ||
var type: String? = 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. Since we added a enum for types, shouldn't this be a TypeCampaign? |
||
|
||
@JvmField | ||
@QueryStringParam | ||
var status: String? = null | ||
|
||
@JvmField | ||
@QueryStringParam | ||
var before_send_time: Date? = null | ||
|
||
@JvmField | ||
@QueryStringParam | ||
var since_send_opt: String? = 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. Field name is 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 field should be of type Date 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. ready 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 should be a Date field |
||
|
||
@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 | ||
|
||
class Response : MailchimpObject() { | ||
@JvmField | ||
@Field | ||
var campaigns: List<CampaignInfo>? = null | ||
|
||
@JvmField | ||
@Field | ||
var total_items: Int? = 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. TODO _links 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 will add this in the super class. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.ecwid.maleorang.method.v3_0.campaign | ||
|
||
import com.ecwid.maleorang.MailchimpObject | ||
import com.ecwid.maleorang.annotation.Field | ||
|
||
/** | ||
* Created by: Manuel Lara <[email protected]> | ||
*/ | ||
|
||
class RecipientsCampaignInfo : MailchimpObject() { | ||
@JvmField | ||
@Field | ||
var list_id: String? = 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. TODO list_name |
||
@JvmField | ||
@Field | ||
var segment_opts: MailchimpObject? = null //TODO create SegmentOpts Object | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.ecwid.maleorang.method.v3_0.reports.email | ||
|
||
/** | ||
* Created by larar on 15/10/2016. | ||
*/ | ||
|
||
enum class TypeCampaign(val type: String) { | ||
REGULAR("regular"), | ||
PLAINTEXT("plaintext"), | ||
ABSPLIT("absplit"), | ||
RSS("rss"), | ||
VARIATE("variate") | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.ecwid.maleorang.method.v3_0.lists.segments | ||
|
||
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 <[email protected]> | ||
*/ | ||
@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<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.
Does it mean that the library won't be usable with java 6 & 7 projects? I'd prefer to keep the compatibility.