Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Add reports/opened #28

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
target
target/

#IntelliJ IDEA
.idea/
*.iml

80 changes: 78 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,78 @@ limitations under the License.
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>

<groupId>com.ecwid</groupId>
<artifactId>ecwid-mailchimp</artifactId>
<version>2.0.1.1-SNAPSHOT</version>

<!-- Deploy to S3 with "mvn deploy -DskipTests" -->
<version>2.0.1.1.fmaylinch-SNAPSHOT</version>

<packaging>jar</packaging>


<!-- Added to deploy on AWS -->
<repositories>
<repository>
<id>g4l-maven-s3-release-repo</id>
<name>S3 Release Repository</name>
<url>s3://g4l-repository/release</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>g4l-maven-s3-snapshot-repo</id>
<name>S3 Snapshot Repository</name>
<url>s3://g4l-repository/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>g4l-maven-s3-release-repo</id>
<name>S3 Release Repository</name>
<url>s3://g4l-repository/release</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>g4l-maven-s3-snapshot-repo</id>
<name>S3 Snapshot Repository</name>
<url>s3://g4l-repository/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>g4l-maven-s3-release-repo</id>
<name>S3 Release Repository</name>
<url>s3://g4l-repository/release</url>
</repository>
<snapshotRepository>
<id>g4l-maven-s3-snapshot-repo</id>
<name>S3 Snapshot Repository</name>
<url>s3://g4l-repository/snapshot</url>
</snapshotRepository>
</distributionManagement>

<name>MailChimp API Wrapper</name>
<description>MailChimp API Wrapper for Java</description>
<url>https://github.com/Ecwid/ecwid-mailchimp</url>
Expand Down Expand Up @@ -106,6 +172,16 @@ limitations under the License.
</properties>

<build>

<!-- Added to deploy on AWS -->
<extensions>
<extension>
<groupId>org.springframework.build.aws</groupId>
<artifactId>org.springframework.build.aws.maven</artifactId>
<version>3.0.0.RELEASE</version>
</extension>
</extensions>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package com.ecwid.mailchimp.method.v2_0.campaigns;

import com.ecwid.mailchimp.MailChimpAPIVersion;
import com.ecwid.mailchimp.MailChimpMethod;
import com.ecwid.mailchimp.MailChimpObject;

import java.util.Date;

@MailChimpMethod.Method(name = "campaigns/list", version = MailChimpAPIVersion.v2_0)
public class ListMethod extends MailChimpMethod<ListMethodResult> {

@Field
public Filters filters;

@Field
public Integer start;

@Field
public Integer limit;

@Field
public String sort_field;

@Field
public String sort_dir;

public static class Filters extends MailChimpObject {

@Field
public String campaign_id;

@Field
public String parent_id;

@Field
public String list_id;

@Field
public Integer folder_id;

@Field
public Integer template_id;

@Field
public String status;

@Field
public String type;

@Field
public String from_name;

@Field
public String from_email;

@Field
public String title;

@Field
public String subject;

@Field
public Date sendtime_start; //24 hour format in GMT, eg "2013-12-30 20:30:00"

@Field
public Date sendtime_end; //24 hour format in GMT, eg "2013-12-30 20:30:00"

@Field
public Boolean uses_segment;

@Field
public Boolean exact;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package com.ecwid.mailchimp.method.v2_0.campaigns;

import com.ecwid.mailchimp.MailChimpObject;

import java.util.Date;
import java.util.List;

/**
* Result of the campaigns/list operation including valid data and any errors
*/
public class ListMethodResult extends MailChimpObject {

@Field
public Integer total;

@Field
public List<Data> data;

@Field
public List<Error> errors;

public static class Data extends MailChimpObject {

@Field
public String id;

@Field
public Integer web_id;

@Field
public String list_id;

@Field
public Integer folder_id;

@Field
public Integer template_id;

@Field
public String content_type;

@Field
public String title;

@Field
public String type;

@Field
public Date create_time;

@Field
public Date send_time;

@Field
public Integer emails_sent;

@Field
public String status;

@Field
public String from_name;

@Field
public String from_email;

@Field
public String subject;

// TODO: there are more fields
}

public static class Error extends MailChimpObject {

@Field
public String filter;

@Field
public String value;

@Field
public Integer code;

@Field
public String error;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.ecwid.mailchimp.method.v2_0.reports;

import com.ecwid.mailchimp.MailChimpAPIVersion;
import com.ecwid.mailchimp.MailChimpMethod;
import com.ecwid.mailchimp.MailChimpObject;

@MailChimpMethod.Method(name = "reports/opened", version = MailChimpAPIVersion.v2_0)
public class OpenedMethod extends MailChimpMethod<OpenedMethodResult> {

@Field
public String cid;

@Field
public Opts opts;

/**
* Options to apply to this query - all are optional:
*/
public static class Opts extends MailChimpObject {

@Field
public Integer start;

@Field
public Integer limit;

@Field
public String sort_field;

@Field
public String sort_dir;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.ecwid.mailchimp.method.v2_0.reports;

import com.ecwid.mailchimp.MailChimpObject;
import com.ecwid.mailchimp.method.v2_0.lists.MemberInfoData;

import java.util.List;

/**
* Result of the reports/opened operation
*/
public class OpenedMethodResult extends MailChimpObject {

@Field
public Integer total;

@Field
public List<Data> data;

public static class Data extends MailChimpObject {

@Field
public Integer opens;

@Field
public MemberInfoData member;
}
}