From 7d273d2e80c31c5606b222d1c839ca76b9c2d5bb Mon Sep 17 00:00:00 2001 From: Vasily Karyaev Date: Thu, 4 Aug 2016 16:13:49 +0400 Subject: [PATCH] Initial commit --- .gitignore | 4 + LICENSE.txt | 202 ++++++++++++++ README.txt | 4 + build.gradle | 30 +++ compile.gradle | 10 + gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 53324 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 164 ++++++++++++ gradlew.bat | 90 +++++++ publish.gradle | 72 +++++ settings.gradle | 0 .../com/ecwid/maleorang/MailchimpClient.kt | 81 ++++++ .../com/ecwid/maleorang/MailchimpException.kt | 18 ++ .../com/ecwid/maleorang/MailchimpMethod.kt | 24 ++ .../ecwid/maleorang/MailchimpMethodInfo.kt | 103 ++++++++ .../com/ecwid/maleorang/MailchimpObject.kt | 46 ++++ .../maleorang/MailchimpObjectGsonFactory.kt | 44 ++++ .../ecwid/maleorang/MailchimpObjectMapping.kt | 77 ++++++ .../maleorang/MailchimpObjectTypeAdapter.kt | 78 ++++++ .../ecwid/maleorang/annotation/APIVersion.kt | 14 + .../com/ecwid/maleorang/annotation/Field.kt | 15 ++ .../ecwid/maleorang/annotation/HttpMethod.kt | 9 + .../com/ecwid/maleorang/annotation/Method.kt | 10 + .../ecwid/maleorang/annotation/PathParam.kt | 15 ++ .../maleorang/annotation/QueryStringParam.kt | 15 ++ .../ecwid/maleorang/connector/Connector.kt | 15 ++ .../connector/HttpClientConnector.kt | 73 ++++++ .../method/v3_0/batches/BatchStatus.kt | 40 +++ .../method/v3_0/batches/DeleteBatchMethod.kt | 19 ++ .../v3_0/batches/GetBatchStatusMethod.kt | 23 ++ .../v3_0/batches/GetBatchesStatusMethod.kt | 42 +++ .../method/v3_0/batches/StartBatchMethod.kt | 43 +++ .../method/v3_0/members/DeleteMemberMethod.kt | 25 ++ .../method/v3_0/members/EditMemberMethod.kt | 108 ++++++++ .../method/v3_0/members/GetMemberMethod.kt | 30 +++ .../method/v3_0/members/GetMembersMethod.kt | 70 +++++ .../method/v3_0/members/MemberInfo.kt | 85 ++++++ .../com/ecwid/maleorang/util/ClassUtil.kt | 47 ++++ .../java/com/ecwid/maleorang/util/DateUtil.kt | 12 + .../java/com/ecwid/maleorang/DateUtilTest.kt | 24 ++ .../ecwid/maleorang/MailchimpMethodTest.java | 23 ++ .../MailchimpObjectGsonFactoryTest.java | 147 +++++++++++ .../ecwid/maleorang/MailchimpObjectTest.java | 247 ++++++++++++++++++ .../examples/MembersMethodsExample.java | 42 +++ .../method/v3_0/batches/BatchTest.kt | 49 ++++ .../method/v3_0/members/MembersTest.kt | 156 +++++++++++ test.gradle | 19 ++ wrapper.gradle | 8 + 48 files changed, 2478 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE.txt create mode 100644 README.txt create mode 100644 build.gradle create mode 100644 compile.gradle create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat create mode 100644 publish.gradle create mode 100644 settings.gradle create mode 100644 src/main/java/com/ecwid/maleorang/MailchimpClient.kt create mode 100644 src/main/java/com/ecwid/maleorang/MailchimpException.kt create mode 100644 src/main/java/com/ecwid/maleorang/MailchimpMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/MailchimpMethodInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/MailchimpObject.kt create mode 100644 src/main/java/com/ecwid/maleorang/MailchimpObjectGsonFactory.kt create mode 100644 src/main/java/com/ecwid/maleorang/MailchimpObjectMapping.kt create mode 100644 src/main/java/com/ecwid/maleorang/MailchimpObjectTypeAdapter.kt create mode 100644 src/main/java/com/ecwid/maleorang/annotation/APIVersion.kt create mode 100644 src/main/java/com/ecwid/maleorang/annotation/Field.kt create mode 100644 src/main/java/com/ecwid/maleorang/annotation/HttpMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/annotation/Method.kt create mode 100644 src/main/java/com/ecwid/maleorang/annotation/PathParam.kt create mode 100644 src/main/java/com/ecwid/maleorang/annotation/QueryStringParam.kt create mode 100644 src/main/java/com/ecwid/maleorang/connector/Connector.kt create mode 100644 src/main/java/com/ecwid/maleorang/connector/HttpClientConnector.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/batches/BatchStatus.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/batches/DeleteBatchMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/batches/GetBatchStatusMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/batches/GetBatchesStatusMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/batches/StartBatchMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/members/DeleteMemberMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/members/EditMemberMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/members/GetMemberMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/members/GetMembersMethod.kt create mode 100644 src/main/java/com/ecwid/maleorang/method/v3_0/members/MemberInfo.kt create mode 100644 src/main/java/com/ecwid/maleorang/util/ClassUtil.kt create mode 100644 src/main/java/com/ecwid/maleorang/util/DateUtil.kt create mode 100644 src/test/java/com/ecwid/maleorang/DateUtilTest.kt create mode 100644 src/test/java/com/ecwid/maleorang/MailchimpMethodTest.java create mode 100644 src/test/java/com/ecwid/maleorang/MailchimpObjectGsonFactoryTest.java create mode 100644 src/test/java/com/ecwid/maleorang/MailchimpObjectTest.java create mode 100644 src/test/java/com/ecwid/maleorang/examples/MembersMethodsExample.java create mode 100644 src/test/java/com/ecwid/maleorang/method/v3_0/batches/BatchTest.kt create mode 100644 src/test/java/com/ecwid/maleorang/method/v3_0/members/MembersTest.kt create mode 100644 test.gradle create mode 100644 wrapper.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9ef8199 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build +.gradle +.idea +gradle.properties diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..a2cc61f --- /dev/null +++ b/README.txt @@ -0,0 +1,4 @@ +MailChimp API Wrapper for Java + +Refer to https://github.com/Ecwid/maleorang/wiki for more information. +JavaDocs: https://ecwid.github.io/maleorang/site/javadoc/index.html diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..624da62 --- /dev/null +++ b/build.gradle @@ -0,0 +1,30 @@ +buildscript { + repositories { + mavenCentral() + jcenter() + } + dependencies { + classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.9" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.3" + } +} + +apply from: 'wrapper.gradle' +apply from: 'compile.gradle' +apply from: 'test.gradle' +apply from: 'publish.gradle' + +repositories { + mavenCentral() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:1.0.3" + compile "org.jetbrains.kotlin:kotlin-reflect:1.0.3" + compile "com.google.guava:guava:19.0" + compile 'com.google.code.gson:gson:2.7' + compile 'org.apache.httpcomponents:httpclient:4.5.2' + compile 'joda-time:joda-time:2.9.4' + + testCompile 'org.testng:testng:6.8.21' +} diff --git a/compile.gradle b/compile.gradle new file mode 100644 index 0000000..d704a40 --- /dev/null +++ b/compile.gradle @@ -0,0 +1,10 @@ +apply plugin: 'kotlin' + +sourceCompatibility = 1.6 +targetCompatibility = 1.6 + +apply plugin: 'org.jetbrains.dokka' + +dokka { + outputFormat = 'javadoc' +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..3baa851b28c65f87dd36a6748e1a85cf360c1301 GIT binary patch literal 53324 zcmagFW0a=N(k5EAZQHhO+qUhlE<9!1wrzCTwrzJ=eR|IR&NuV!vu7sP%KOeAkt?wx zBCm+NQb`sR3D=FE`hl$X@}? zzZLC&6_giNkd_cvRb!Bs_$@y*DJM(MFb^+FPct($+oZy@#JYF?D@_Ls za{(|*Ju23rZpS1qJt{UC8)(5f$Id*%esH;W0sddcd=dNSF8qlk9qyO4D5f& zSh^US*_rgi(aD`#2h^x>>Q2F$e0;S?TlSr z{iEe!2AGgScdgiUXgwH%U{?XTzX+X(8Tf?lMD3uZr7L@~U=jBUhR~cZ`A+x=ru^z& z4xx!e2l}y0MEqJg(B4VpbF?zV{wG~Eg0{Hjl}O)Mi??j0w*GY1wj}V zGYIcakMI9)yF9!Tx`Oss2b}(HvDp7*jjG53|TiD&r%G|-t z+SJ(1(dA#8P@-z@h$4&>fI$^DI)6}MRFkr?;-hvP={RqM1053q%`9IjFDGbk3~E{H zY37*lQ1=*R&vp;_S`^(RltKiIdOJ9C#rJ!PkGJdP@O1SSXu`{eBqj(N797-;dW)kW zHU^DDRcqx2A62*AmIPt6zxAgt+&HGeUWGoOU6s#FYH6ULA1mV#niS0GeERD<*R_;Ug)z!n64rvWhne$!)XYb!975^6DNpGIS?iD z@>iJb34luVvZ~5<6hfl%ZW~igNt-bt4%FI(YvvLto`BF;Q)94b72~*?G1IlCTqN_n zkKK|G!}HZE1<88eLALMNn2idp4~X(D;1l3_4b*@97&IUI(%=TJp2-Fh^$>dWo^uKF z$69#L1#G{==_>fsiAytDsYm_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n#I18V$0h1UNU zsQ(aN<7xh%1}^x)1Z(s!n0|Kq0hG@A=P(9Osh;Y_|Dd`t`6sIXq9Xqk{;2@^5BNy4 ze}ezs68|KJ{*>yelIjnt3cG(n^;f0+uj+a#M)`we!tq~_{IfLW(-J+^?)yQ8==x7& zKkqF+#eAw9^#gOq>z^>cH^^VmfBpDrtL`bwQ;DJ#qOwxINtv|AFjT_8anltD`?}k3TKM(~Za}xKVZkJ{t5Q` zfbkEzaZd~I)Jp$@39bG&rl;=@Kh@p;D9}^O@ei84hTmv@g8g2gzi$69_B}Nr{=nyJ v{ulWF-JtlizMfh|eh^K!{r|%7zu8D$N`V31fxg9xVFW__CM4JX?brVS=I{&) literal 0 HcmV?d00001 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..a7b817f --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Aug 04 16:09:12 SAMT 2016 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=http\://services.gradle.org/distributions/gradle-2.14.1-all.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..27309d9 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..f6d5974 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/publish.gradle b/publish.gradle new file mode 100644 index 0000000..664989c --- /dev/null +++ b/publish.gradle @@ -0,0 +1,72 @@ +apply plugin: 'maven' +apply plugin: 'signing' + +group = 'com.ecwid' +archivesBaseName = "maleorang" +version = '3.0-0.9.2' + +task javadocJar(type: Jar) { + classifier = 'javadoc' + from dokka +} + +task sourcesJar(type: Jar) { + classifier = 'sources' + from sourceSets.main.allSource +} + +artifacts { + archives jar, javadocJar, sourcesJar +} + +signing { + required { project.gradle.getTaskGraph().hasTask(uploadArchives) } + sign configurations.archives +} + +if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) { + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: sonatypeUsername, password: sonatypePassword) + } + + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { + authentication(userName: sonatypeUsername, password: sonatypePassword) + } + + pom.project { + name 'MailChimp API wrapper for Java' + description 'MailChimp API Wrapper for Java' + packaging 'jar' + + url 'https://github.com/Ecwid/maleorang' + + scm { + connection 'scm:git:git@github.com:Ecwid/maleorang.git' + developerConnection 'scm:git:git@github.com:Ecwid/maleorang.git' + url 'https://github.com/Ecwid/maleorang.git' + } + + licenses { + license { + name 'The Apache License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + + developers { + developer { + id 'basil' + name 'Vasily Karyaev' + email 'v.karyaev@gmail.com' + } + } + } + } + } + } +} diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..e69de29 diff --git a/src/main/java/com/ecwid/maleorang/MailchimpClient.kt b/src/main/java/com/ecwid/maleorang/MailchimpClient.kt new file mode 100644 index 0000000..146185c --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/MailchimpClient.kt @@ -0,0 +1,81 @@ +package com.ecwid.maleorang + +import com.ecwid.maleorang.connector.Connector +import com.ecwid.maleorang.connector.HttpClientConnector +import com.google.gson.JsonParser +import java.io.Closeable +import java.io.IOException +import java.util.logging.Level +import java.util.logging.Logger + +/** + * MailChimp API wrapper. + * + * @constructor Thread safety of the created instances depends on the supplied [connector]. + */ +open class MailchimpClient protected constructor ( + private val apiKey: String, private val connector: Connector +) : Closeable { + private val log = Logger.getLogger(javaClass.getName()) + + /** + * Instances created via this constructor are thread safe since they share a thread safe pool of http connections. + * However in terms of performance it doesn't matter whether you reuse the same instance for the whole application or re-create it on every operation. + */ + constructor(apiKey: String) : this(apiKey, HttpClientConnector()) + + /** + * Execute a MailChimp API method. + * + * @param[method] MailChimp API method to be executed + * @return execution result + */ + @Throws(IOException::class, MailchimpException::class) + fun execute(method: MailchimpMethod): R { + val methodInfo = MailchimpMethodInfo(method) + val request = Connector.Request(methodInfo.httpMethod.name, methodInfo.buildUrl(apiKey), "ignorable", apiKey, methodInfo.requestBody) + + if (log.isLoggable(Level.INFO)) { + val sb = StringBuilder("Request: ") + sb.append(request.method).append(' ').append(request.url) + if (request.requestBody != null) { + sb.append('\n').append("Body: ").append(request.requestBody) + } + log.info(sb.toString()) + } + + val response = connector.call(request) + + if (log.isLoggable(Level.INFO)) { + val sb = StringBuilder("Response: ") + sb.append(response.statusCode).append(' ').append(response.reasonPhrase) + if (response.responseBody != null) { + sb.append('\n').append("Body: ").append(response.responseBody) + } + log.info(sb.toString()) + } + + if (response.statusCode !in 200..299) { + var code = response.statusCode + var description = response.reasonPhrase + + if (response.responseBody != null) { + val error = JsonParser().parse(response.responseBody).asJsonObject + code = error.get("status").asInt + description = error.get("detail").asString + } + + throw MailchimpException(code, description) + } + + return MailchimpObject.fromJson(response.responseBody ?: "{}", method.resultType) + } + + /** + * Terminate the wrapper usage and release associated resources. + */ + @Throws(IOException::class) + override fun close() { + connector.close() + } +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/MailchimpException.kt b/src/main/java/com/ecwid/maleorang/MailchimpException.kt new file mode 100644 index 0000000..c962074 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/MailchimpException.kt @@ -0,0 +1,18 @@ +package com.ecwid.maleorang + +/** + * Indicates a MailChimp API error. + */ +class MailchimpException( + /** + * Error code. + */ + @JvmField + val code: Int, + + /** + * Error description. + */ + @JvmField + val description: String +) : Exception("API Error ($code): $description") diff --git a/src/main/java/com/ecwid/maleorang/MailchimpMethod.kt b/src/main/java/com/ecwid/maleorang/MailchimpMethod.kt new file mode 100644 index 0000000..729e059 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/MailchimpMethod.kt @@ -0,0 +1,24 @@ +package com.ecwid.maleorang + +import com.google.common.reflect.TypeToken + +import java.lang.annotation.* +import java.lang.reflect.Type + + +/** + * Abstract class representing MailChimp API calls. + */ +abstract class MailchimpMethod() : MailchimpObject() { + /** + * Get the method result type. + */ + val resultType: Class = object : TypeToken(javaClass) { }.type.let { type -> + @Suppress("UNCHECKED_CAST") + if (type is Class<*>) { + type as Class + } else { + throw IllegalArgumentException("The result type must be a raw class without parameters: $type") + } + } +} diff --git a/src/main/java/com/ecwid/maleorang/MailchimpMethodInfo.kt b/src/main/java/com/ecwid/maleorang/MailchimpMethodInfo.kt new file mode 100644 index 0000000..8d17315 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/MailchimpMethodInfo.kt @@ -0,0 +1,103 @@ +package com.ecwid.maleorang + +import com.ecwid.maleorang.annotation.* +import com.ecwid.maleorang.annotation.Method +import com.ecwid.maleorang.util.DateUtil.formatDate +import com.ecwid.maleorang.util.ClassUtil.getAnnotatedFields + +import java.net.URLEncoder +import java.util.Collections +import java.util.Date +import java.util.TreeMap +import java.util.regex.Matcher +import java.util.regex.Pattern + + +internal class MailchimpMethodInfo(private val method: MailchimpMethod<*>) { + private val methodAnnotation: Method = method.javaClass.let { + var c: Class<*>? = it + while (c != null) { + val a = c.getAnnotation(Method::class.java) + if (a != null) { + return@let a + } else { + c = c.superclass + } + } + throw IllegalArgumentException("Neither ${method.javaClass} nor its superclasses are annotated with ${Method::class.java}") + } + + val version: APIVersion = methodAnnotation.version + val httpMethod: HttpMethod = methodAnnotation.httpMethod + val pathParams: Map = method.getParams(PathParam::class.java, { it.name }) + val queryStringParams: Map = method.getParams(QueryStringParam::class.java, { it.name }) + + val requestBody: String? = when (httpMethod) { + HttpMethod.POST, HttpMethod.PATCH, HttpMethod.PUT -> method.toJson() + else -> null.apply { require(method.mapping.isEmpty(), { "$httpMethod method is not supposed to have request body: $method" }) } + } + + fun buildUrl(apiKey: String): String { + val prefix = apiKey.lastIndexOf('-').let { dash -> + if (dash > 0) { + apiKey.substring(dash + 1) + } else { + throw IllegalArgumentException("Wrong api key: $apiKey") + } + } + + return "https://${prefix}.api.mailchimp.com/${version}${buildPath()}${buildQueryString()}" + } + + fun buildPath(): String { + val result = StringBuffer() + + val matcher = PATH_PLACEHOLDER_PATTERN.matcher(methodAnnotation.path) + while (matcher.find()) { + val name = matcher.group(1) + val value = pathParams[name] ?: throw IllegalArgumentException("Missing path parameter: $name") + matcher.appendReplacement(result, Matcher.quoteReplacement(value)) + } + matcher.appendTail(result) + + return result.toString() + } + + private fun buildQueryString(): String { + val sb = StringBuilder() + for ((key, value) in queryStringParams) { + if (value != null) { + sb.append(if (sb.length == 0) '?' else '&') + sb.append(URLEncoder.encode(key, "UTF-8")) + sb.append('=') + sb.append(URLEncoder.encode(value, "UTF-8")) + } + } + return sb.toString() + } + + private companion object { + private val PATH_PLACEHOLDER_PATTERN = Pattern.compile("\\{(\\w+)\\}") + + private fun MailchimpMethod<*>.getParams(annotationClass: Class, nameProvider: (A) -> String): Map { + return Collections.unmodifiableMap(TreeMap().apply { + for (field in this@getParams.javaClass.getAnnotatedFields(annotationClass)) { + val annotation = field.getAnnotation(annotationClass)!! + + val name = nameProvider(annotation).let { if (it.isNotEmpty()) it else field.name } + require(name.matches("\\w+".toRegex()), { "Invalid param name: $name" }) + require(!this.containsKey(name), { "Duplicate param name: $name" }) + + field.get(this@getParams).let { value -> + this@apply[name] = when (value) { + null -> null + is MailchimpObject -> value.toJson() + is Date -> formatDate(value) + else -> value.toString() + } + } + } + }) + } + } +} diff --git a/src/main/java/com/ecwid/maleorang/MailchimpObject.kt b/src/main/java/com/ecwid/maleorang/MailchimpObject.kt new file mode 100644 index 0000000..c75a621 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/MailchimpObject.kt @@ -0,0 +1,46 @@ +package com.ecwid.maleorang + +import com.google.gson.JsonParseException + + +/** + * Base class for all objects wrapping the request and response bodies of MailChimp API calls. + */ +open class MailchimpObject { + + /** + * Map representation of this object. + * + * Some entries in the map are "regular" mappings, whereas others are "reflective" ones. + * Reflective mappings are represented by fields marked with [com.ecwid.maleorang.annotation.Field]. + * Changes in such fields are reflected in the map and vice versa. + * Reflective mappings cannot be removed from this map. + */ + @JvmField + val mapping: MutableMap = MailchimpObjectMapping(this) + + /** + * Serializes this object to JSON. + */ + fun toJson(): String = MailchimpObjectGsonFactory.createGson().toJson(this) + + final override fun toString(): String = javaClass.simpleName + toJson() + final override fun equals(other: Any?): Boolean = other is MailchimpObject && mapping == other.mapping + final override fun hashCode(): Int = mapping.hashCode() + + companion object { + /** + * Deserializes an object from JSON. + * + * @throws IllegalArgumentException if `json` cannot be deserialized to an object of class `clazz`. + */ + @JvmStatic + fun fromJson(json: String, clazz: Class): T { + try { + return MailchimpObjectGsonFactory.createGson().fromJson(json, clazz) + } catch (e: JsonParseException) { + throw IllegalArgumentException(e) + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/MailchimpObjectGsonFactory.kt b/src/main/java/com/ecwid/maleorang/MailchimpObjectGsonFactory.kt new file mode 100644 index 0000000..b0fb8d0 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/MailchimpObjectGsonFactory.kt @@ -0,0 +1,44 @@ +package com.ecwid.maleorang + +import com.ecwid.maleorang.util.DateUtil.formatDate +import com.ecwid.maleorang.util.DateUtil.parseDate +import com.google.gson.* +import com.google.gson.reflect.TypeToken + +import java.lang.reflect.Type +import java.util.Date + +/** + * Factory creating [Gson] objects to be used for MailChimp API calls wrapping. + */ +internal object MailchimpObjectGsonFactory { + + /** + * Creates a new [Gson] object. + */ + fun createGson() = GsonBuilder() + .setExclusionStrategies(object : ExclusionStrategy { + override fun shouldSkipField(fa: FieldAttributes) = true + override fun shouldSkipClass(type: Class<*>) = false + }) + .registerTypeAdapter(Date::class.java, object : JsonSerializer, JsonDeserializer { + override fun serialize(date: Date, type: Type, jsc: JsonSerializationContext): JsonElement { + return JsonPrimitive(formatDate(date)) + } + + override fun deserialize(je: JsonElement, type: Type, jdc: JsonDeserializationContext): Date? { + return if (!je.asString.isEmpty()) parseDate(je.asString) else null + } + }) + .registerTypeAdapterFactory(object : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (MailchimpObject::class.java.isAssignableFrom(type.rawType)) { + @Suppress("UNCHECKED_CAST", "CAST_NEVER_SUCCEEDS") + return MailchimpObjectTypeAdapter(gson, type as TypeToken) as TypeAdapter + } else { + return null + } + } + }) + .create() +} diff --git a/src/main/java/com/ecwid/maleorang/MailchimpObjectMapping.kt b/src/main/java/com/ecwid/maleorang/MailchimpObjectMapping.kt new file mode 100644 index 0000000..6459e68 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/MailchimpObjectMapping.kt @@ -0,0 +1,77 @@ +package com.ecwid.maleorang + +import com.ecwid.maleorang.util.ClassUtil.mailchimpObjectFields +import com.google.common.base.Objects +import java.lang.reflect.Field +import java.util.* + + +internal class MailchimpObjectMapping(val owner: MailchimpObject) : AbstractMap() { + private val reflections: Map = owner.javaClass.mailchimpObjectFields + private val regular: MutableMap = LinkedHashMap() + + override val size: Int + get() = reflections.size + regular.size + + override fun containsKey(key: String) = reflections.containsKey(key) || regular.containsKey(key) + + override val entries = object : AbstractSet>() { + override val size: Int + get() = this@MailchimpObjectMapping.size + + override fun iterator() = object : MutableIterator> { + inner class ReflectiveEntry(override val key: String, val f: Field) : MutableMap.MutableEntry { + override val value: Any? + get() = f.getFieldValue() + override fun setValue(newValue: Any?) = f.setFieldValue(newValue) + + override fun equals(other: Any?) = when (other) { + is MutableMap.MutableEntry<*, *> -> key == other.key && value == other.value + else -> false + } + + override fun hashCode() = Objects.hashCode(key, value) + override fun toString() = "$key=$value" + } + + private val i1 = reflections.entries.asSequence().map { ReflectiveEntry(it.key, it.value) }.iterator() + private val i2 = regular.entries.iterator() + private var lastEntry: MutableMap.MutableEntry? = null + + override fun hasNext() = i1.hasNext() || i2.hasNext() + + override fun next() = when { + i1.hasNext() -> i1.next() + i2.hasNext() -> i2.next() + else -> throw NoSuchElementException() + }.apply { lastEntry = this } + + override fun remove() = lastEntry.let { + when (it) { + null -> throw IllegalStateException() + is ReflectiveEntry -> removeError(it.key) + else -> i2.remove() + } + } + } + } + + override fun get(key: String): Any? = reflections.get(key).let { field -> + if (field != null) { field.getFieldValue() } else { regular.get(key) } + } + + override fun put(key: String, value: Any?): Any? = reflections.get(key).let { field -> + if (field != null) { field.setFieldValue(value) } else { regular.put(key, value) } + } + + override fun putAll(from: Map) = from.forEach { put(it.key, it.value) } + + override fun remove(key: String): Any? = when { + reflections.containsKey(key) -> removeError(key) + else -> regular.remove(key) + } + + private fun Field.getFieldValue(): Any? = get(owner) + private fun Field.setFieldValue(value: Any?): Any? = get(owner).apply { set(owner, value) } + private fun removeError(key: String): Nothing = throw IllegalArgumentException("Cannot remove reflective mapping: $key") +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/MailchimpObjectTypeAdapter.kt b/src/main/java/com/ecwid/maleorang/MailchimpObjectTypeAdapter.kt new file mode 100644 index 0000000..c99fbfe --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/MailchimpObjectTypeAdapter.kt @@ -0,0 +1,78 @@ +package com.ecwid.maleorang + +import com.ecwid.maleorang.util.ClassUtil.mailchimpObjectFields +import com.google.gson.Gson +import com.google.gson.TypeAdapter +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonToken +import com.google.gson.stream.JsonWriter +import java.lang.reflect.Constructor + +internal class MailchimpObjectTypeAdapter(private val gson: Gson, private val type: TypeToken) : TypeAdapter() { + + override fun write(out: JsonWriter, value: MailchimpObject) { + gson.getAdapter(Map::class.java).write(out, value.mapping) + } + + override fun read(reader: JsonReader): MailchimpObject? { + if (reader.peek() == JsonToken.NULL) { + reader.nextNull() + return null + } + + @Suppress("UNCHECKED_CAST") + val constructor = try { + type.getRawType().getDeclaredConstructor().apply { + isAccessible = true + } as Constructor + } catch (e: NoSuchMethodException) { + throw IllegalArgumentException("No no-arg counstructor found in ${type.rawType}") + } + + val result = try { + constructor.newInstance() + } catch (e: Exception) { + throw RuntimeException("Failed to invoke $constructor with no args", e) + } + + reader.beginObject() + while (reader.hasNext()) { + val key = when(reader.peek()) { + JsonToken.NAME -> reader.nextName() + else -> reader.nextString() + } + + val value = result.javaClass.mailchimpObjectFields[key].let { field -> + if (field != null) { + gson.getAdapter(TypeToken.get(field.genericType)).read(reader) + } else when (reader.peek()) { + JsonToken.BEGIN_OBJECT -> gson.getAdapter(MailchimpObject::class.java).read(reader) + JsonToken.BEGIN_ARRAY -> readList(reader) + else -> gson.getAdapter(Any::class.java).read(reader) + } + } + + result.mapping[key] = value + } + reader.endObject() + + return result + } + + private fun readList(reader: JsonReader): List<*> { + val result = mutableListOf() + + reader.beginArray() + while (reader.peek() != JsonToken.END_ARRAY) { + result += when (reader.peek()) { + JsonToken.BEGIN_OBJECT -> gson.getAdapter(MailchimpObject::class.java).read(reader) + JsonToken.BEGIN_ARRAY -> readList(reader) + else -> gson.getAdapter(Any::class.java).read(reader) + } + } + reader.endArray() + + return result + } +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/annotation/APIVersion.kt b/src/main/java/com/ecwid/maleorang/annotation/APIVersion.kt new file mode 100644 index 0000000..77cd7ac --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/annotation/APIVersion.kt @@ -0,0 +1,14 @@ +package com.ecwid.maleorang.annotation + + +/** + * MailChimp API version. + */ +enum class APIVersion { + v3_0; + + /** + * MailChimp API version string representation. + */ + override fun toString(): String = name.substring(1).replace("_", ".") +} diff --git a/src/main/java/com/ecwid/maleorang/annotation/Field.kt b/src/main/java/com/ecwid/maleorang/annotation/Field.kt new file mode 100644 index 0000000..8a3fd90 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/annotation/Field.kt @@ -0,0 +1,15 @@ +package com.ecwid.maleorang.annotation + + +/** + * Marks fields of [com.ecwid.maleorang.MailchimpObject] to be serialized/deserialed to/from JSON. + */ +@MustBeDocumented +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.FIELD) +annotation class Field( + /** + * Property name in JSON mapping. If not specified, the field name will be used. + */ + val name: String = "" +) \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/annotation/HttpMethod.kt b/src/main/java/com/ecwid/maleorang/annotation/HttpMethod.kt new file mode 100644 index 0000000..c9d6d61 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/annotation/HttpMethod.kt @@ -0,0 +1,9 @@ +package com.ecwid.maleorang.annotation + + +/** + * HTTP method. + */ +enum class HttpMethod { + GET, POST, PATCH, PUT, DELETE +} diff --git a/src/main/java/com/ecwid/maleorang/annotation/Method.kt b/src/main/java/com/ecwid/maleorang/annotation/Method.kt new file mode 100644 index 0000000..63a7340 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/annotation/Method.kt @@ -0,0 +1,10 @@ +package com.ecwid.maleorang.annotation + + +/** + * Marks subclasses of [com.ecwid.maleorang.MailchimpMethod] to describe the corresponding MailChimp API method. + */ +@MustBeDocumented +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.CLASS) +annotation class Method(val version: APIVersion, val httpMethod: HttpMethod, val path: String) \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/annotation/PathParam.kt b/src/main/java/com/ecwid/maleorang/annotation/PathParam.kt new file mode 100644 index 0000000..99674a5 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/annotation/PathParam.kt @@ -0,0 +1,15 @@ +package com.ecwid.maleorang.annotation + + +/** + * Marks fields of [com.ecwid.maleorang.MailchimpMethod] to be used in path mapping. + */ +@MustBeDocumented +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.FIELD) +annotation class PathParam( + /** + * Property name in path mapping. If not specified, the field name will be used. + */ + val name: String = "" +) diff --git a/src/main/java/com/ecwid/maleorang/annotation/QueryStringParam.kt b/src/main/java/com/ecwid/maleorang/annotation/QueryStringParam.kt new file mode 100644 index 0000000..f6aea9b --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/annotation/QueryStringParam.kt @@ -0,0 +1,15 @@ +package com.ecwid.maleorang.annotation + + +/** + * Marks fields of [com.ecwid.maleorang.MailchimpMethod] to be used in query string mapping. + */ +@MustBeDocumented +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.FIELD) +annotation class QueryStringParam( + /** + * Property name in query string mapping. If not specified, the field name will be used. + */ + val name: String = "" +) diff --git a/src/main/java/com/ecwid/maleorang/connector/Connector.kt b/src/main/java/com/ecwid/maleorang/connector/Connector.kt new file mode 100644 index 0000000..2a9055b --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/connector/Connector.kt @@ -0,0 +1,15 @@ +package com.ecwid.maleorang.connector + +import java.io.Closeable +import java.io.IOException + +/** + * Abstract connector to access MailChimp API service point. + */ +interface Connector : Closeable { + class Request(val method: String, val url: String, val username: String, val password: String, val requestBody: String?) + class Response(val statusCode: Int, val reasonPhrase: String, val responseBody: String?) + + @Throws(IOException::class) + fun call(request: Request): Response +} diff --git a/src/main/java/com/ecwid/maleorang/connector/HttpClientConnector.kt b/src/main/java/com/ecwid/maleorang/connector/HttpClientConnector.kt new file mode 100644 index 0000000..f5b4177 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/connector/HttpClientConnector.kt @@ -0,0 +1,73 @@ +package com.ecwid.maleorang.connector + +import org.apache.commons.codec.binary.Base64 +import org.apache.http.client.config.RequestConfig +import org.apache.http.client.methods.* +import org.apache.http.entity.StringEntity +import org.apache.http.impl.client.CloseableHttpClient +import org.apache.http.impl.client.HttpClientBuilder +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager +import org.apache.http.util.EntityUtils + +import java.io.IOException +import java.net.URI +import java.nio.charset.Charset + +/** + * Implementation of [Connector] which uses Apache HttpClient library to access MailChimp API service point. + */ +open class HttpClientConnector(builder: HttpClientBuilder) : Connector { + private val client = builder.build() + + /** + * Creates instances sharing the same [PoolingHttpClientConnectionManager](http://static.javadoc.io/org.apache.httpcomponents/httpclient/4.5.2/org/apache/http/impl/conn/PoolingClientConnectionManager.html). + */ + constructor() : this(DEFAULT_HTTPCLIENT_BUILDER) + + @Throws(IOException::class) + override fun call(request: Connector.Request): Connector.Response { + val httpRequest = when (request.method) { + "GET" -> HttpGet() + "POST" -> HttpPost() + "PATCH" -> HttpPatch() + "PUT" -> HttpPut() + "DELETE" -> HttpDelete() + else -> throw IllegalArgumentException("Http method ${request.method} is not supported") + } + + httpRequest.uri = URI.create(request.url) + httpRequest.addHeader("Authorization", "Basic ${String(Base64.encodeBase64(("${request.username}:${request.password}").toByteArray(UTF8)), UTF8)}") + + if (request.requestBody != null) { + if (httpRequest is HttpEntityEnclosingRequestBase) { + httpRequest.entity = StringEntity(request.requestBody, UTF8) + } else { + throw IllegalArgumentException("Request body is not supported for method " + request.method) + } + } + + client.execute(httpRequest).use { response -> + val statusCode = response.statusLine.statusCode + val reasonPhrase = response.statusLine.reasonPhrase + val responseBody = response.entity?.let { EntityUtils.toString(response.entity, UTF8) } + return Connector.Response(statusCode, reasonPhrase, responseBody) + } + } + + @Throws(IOException::class) + override fun close() { + client.close() + } + + private companion object { + private val UTF8 = Charsets.UTF_8 + + private val DEFAULT_HTTPCLIENT_BUILDER = HttpClientBuilder.create() + .setDefaultRequestConfig(RequestConfig.custom().setConnectTimeout(15000).setSocketTimeout(15000).setConnectionRequestTimeout(15000).build()) + .setConnectionManager(PoolingHttpClientConnectionManager().apply { + defaultMaxPerRoute = 10 + maxTotal = 10 + }) + .setConnectionManagerShared(true) + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/batches/BatchStatus.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/batches/BatchStatus.kt new file mode 100644 index 0000000..f659789 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/batches/BatchStatus.kt @@ -0,0 +1,40 @@ +package com.ecwid.maleorang.method.v3_0.batches + +import com.ecwid.maleorang.annotation.Field +import com.ecwid.maleorang.MailchimpObject + +import java.util.Date + +class BatchStatus : MailchimpObject() { + @JvmField + @Field + var id: String? = null + + @JvmField + @Field + var status: String? = null + + @JvmField + @Field + var total_operations: Int? = null + + @JvmField + @Field + var finished_operations: Int? = null + + @JvmField + @Field + var errored_operations: Int? = null + + @JvmField + @Field + var submitted_at: Date? = null + + @JvmField + @Field + var completed_at: Date? = null + + @JvmField + @Field + var response_body_url: String? = null +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/batches/DeleteBatchMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/batches/DeleteBatchMethod.kt new file mode 100644 index 0000000..c8d5fe8 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/batches/DeleteBatchMethod.kt @@ -0,0 +1,19 @@ +package com.ecwid.maleorang.method.v3_0.members + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.annotation.APIVersion +import com.ecwid.maleorang.annotation.HttpMethod +import com.ecwid.maleorang.annotation.Method +import com.ecwid.maleorang.annotation.PathParam +import org.apache.commons.codec.digest.DigestUtils + +/** + * [Remove a list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#delete-delete_lists_list_id_members_subscriber_hash) + */ +@Method(httpMethod = HttpMethod.DELETE, version = APIVersion.v3_0, path = "/batches/{batch_id}") +class DeleteBatchMethod( + @JvmField + @PathParam + val batch_id: String +) : MailchimpMethod() diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/batches/GetBatchStatusMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/batches/GetBatchStatusMethod.kt new file mode 100644 index 0000000..4d95b99 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/batches/GetBatchStatusMethod.kt @@ -0,0 +1,23 @@ +package com.ecwid.maleorang.method.v3_0.batches + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.annotation.* + +/** + * [Get the status of a batch operation request](http://developer.mailchimp.com/documentation/mailchimp/reference/batches/#read-get_batches_batch_id) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/batches/{batch_id}") +class GetBatchStatusMethod( + @JvmField + @PathParam + val batch_id: String +) : MailchimpMethod() { + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/batches/GetBatchesStatusMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/batches/GetBatchesStatusMethod.kt new file mode 100644 index 0000000..cd246f4 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/batches/GetBatchesStatusMethod.kt @@ -0,0 +1,42 @@ +package com.ecwid.maleorang.method.v3_0.batches + +import com.ecwid.maleorang.annotation.Field +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.QueryStringParam + + +/** + * [Get a list of batch requests](http://developer.mailchimp.com/documentation/mailchimp/reference/batches/#read-get_batches) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/batches") +class GetBatchesStatusMethod : MailchimpMethod() { + @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 batches: List? = null + + @JvmField + @Field + var total_items: Int? = null + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/batches/StartBatchMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/batches/StartBatchMethod.kt new file mode 100644 index 0000000..399d786 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/batches/StartBatchMethod.kt @@ -0,0 +1,43 @@ +package com.ecwid.maleorang.method.v3_0.batches + +import com.ecwid.maleorang.annotation.Field +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpMethodInfo +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.APIVersion +import com.ecwid.maleorang.annotation.HttpMethod +import com.ecwid.maleorang.annotation.Method + + +/** + * [Start a batch operation](http://developer.mailchimp.com/documentation/mailchimp/reference/batches/#create-post_batches) + */ +@Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/batches") +class StartBatchMethod(operations: List>) : MailchimpMethod() { + + class Operation internal constructor(info: MailchimpMethodInfo): MailchimpObject() { + @JvmField + @Field + val method = info.httpMethod.name + + @JvmField + @Field + val path = info.buildPath() + + @JvmField + @Field + val params = info.queryStringParams + + @JvmField + @Field + val body = info.requestBody + + @JvmField + @Field + var operation_id: String? = null + } + + @JvmField + @Field + val operations = operations.map { Operation(MailchimpMethodInfo(it)) } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/members/DeleteMemberMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/members/DeleteMemberMethod.kt new file mode 100644 index 0000000..3d847af --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/members/DeleteMemberMethod.kt @@ -0,0 +1,25 @@ +package com.ecwid.maleorang.method.v3_0.members + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.annotation.APIVersion +import com.ecwid.maleorang.annotation.HttpMethod +import com.ecwid.maleorang.annotation.Method +import com.ecwid.maleorang.annotation.PathParam +import org.apache.commons.codec.digest.DigestUtils + +/** + * [Remove a list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#delete-delete_lists_list_id_members_subscriber_hash) + */ +@Method(httpMethod = HttpMethod.DELETE, version = APIVersion.v3_0, path = "/lists/{list_id}/members/{subscriber_hash}") +class DeleteMemberMethod( + @JvmField + @PathParam + val list_id: String, + + email: String +) : MailchimpMethod() { + @JvmField + @PathParam + val subscriber_hash: String = DigestUtils.md5Hex(email.toLowerCase()) +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/members/EditMemberMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/members/EditMemberMethod.kt new file mode 100644 index 0000000..40f2653 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/members/EditMemberMethod.kt @@ -0,0 +1,108 @@ +package com.ecwid.maleorang.method.v3_0.members + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* +import org.apache.commons.codec.digest.DigestUtils +import java.util.* + +/** + * Base class for member create or update operations. + */ +sealed class EditMemberMethod : MailchimpMethod() { + /** + * [Add a new list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#create-post_lists_list_id_members) + */ + @Method(httpMethod = HttpMethod.POST, version = APIVersion.v3_0, path = "/lists/{list_id}/members") + class Create( + @JvmField + @PathParam + val list_id: String, + + @JvmField + @Field + val email_address: String + ) : EditMemberMethod() + + /** + * [Update a list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#edit-patch_lists_list_id_members_subscriber_hash) + */ + @Method(httpMethod = HttpMethod.PATCH, version = APIVersion.v3_0, path = "/lists/{list_id}/members/{subscriber_hash}") + class Update( + @JvmField + @PathParam + val list_id: String, + + email_address: String + ) : EditMemberMethod() { + @JvmField + @PathParam + val subscriber_hash: String = DigestUtils.md5Hex(email_address.toLowerCase()) + } + + /** + * [Add or update a list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#edit-put_lists_list_id_members_subscriber_hash) + */ + @Method(httpMethod = HttpMethod.PUT, version = APIVersion.v3_0, path = "/lists/{list_id}/members/{subscriber_hash}") + class CreateOrUpdate( + @JvmField + @PathParam + val list_id: String, + + @JvmField + @Field + val email_address: String + ) : EditMemberMethod() { + @JvmField + @PathParam + val subscriber_hash: String = DigestUtils.md5Hex(email_address.toLowerCase()) + + @JvmField + @Field + var status_if_new: String? = null + } + + @JvmField + @Field + var email_type: String? = null + + @JvmField + @Field + var status: String? = null + + @JvmField + @Field + var merge_fields: MailchimpObject? = null + + @JvmField + @Field + var interests: MailchimpObject? = null + + @JvmField + @Field + var language: String? = null + + @JvmField + @Field + var vip: Boolean? = null + + @JvmField + @Field + var location: MailchimpObject? = null + + @JvmField + @Field + var ip_signup: String? = null + + @JvmField + @Field + var timestamp_signup: Date? = null + + @JvmField + @Field + var ip_opt: String? = null + + @JvmField + @Field + var timestamp_opt: Date? = null +} \ No newline at end of file diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/members/GetMemberMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/members/GetMemberMethod.kt new file mode 100644 index 0000000..8dccca8 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/members/GetMemberMethod.kt @@ -0,0 +1,30 @@ +package com.ecwid.maleorang.method.v3_0.members + + +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.annotation.* +import org.apache.commons.codec.digest.DigestUtils + +/** + * [Get information about a specific list member](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#read-get_lists_list_id_members_subscriber_hash) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/lists/{list_id}/members/{subscriber_hash}") +class GetMemberMethod( + @JvmField + @PathParam + val list_id: String, + + email: String +) : MailchimpMethod() { + @JvmField + @PathParam + val subscriber_hash: String = DigestUtils.md5Hex(email.toLowerCase()) + + @JvmField + @QueryStringParam + var fields: String? = null + + @JvmField + @QueryStringParam + var exclude_fields: String? = null +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/members/GetMembersMethod.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/members/GetMembersMethod.kt new file mode 100644 index 0000000..6a7c320 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/members/GetMembersMethod.kt @@ -0,0 +1,70 @@ +package com.ecwid.maleorang.method.v3_0.members + + +import com.ecwid.maleorang.annotation.Field +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.* + +import java.util.Date + +/** + * [Get information about members in a list](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#read-get_lists_list_id_members) + */ +@Method(httpMethod = HttpMethod.GET, version = APIVersion.v3_0, path = "/lists/{list_id}/members") +class GetMembersMethod( + @JvmField + @PathParam + val list_id: String +) : MailchimpMethod() { + + @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 email_type: String? = null + + @JvmField + @QueryStringParam + var status: String? = null + + @JvmField + @QueryStringParam + var since_timestamp_opt: Date? = null + + @JvmField + @QueryStringParam + var before_timestamp_opt: Date? = null + + @JvmField + @QueryStringParam + var since_last_changed: Date? = null + + @JvmField + @QueryStringParam + var before_last_changed: Date? = null + + class Response : MailchimpObject() { + @JvmField + @Field + var members: List? = null + + @JvmField + @Field + var total_items: Int? = null + } +} diff --git a/src/main/java/com/ecwid/maleorang/method/v3_0/members/MemberInfo.kt b/src/main/java/com/ecwid/maleorang/method/v3_0/members/MemberInfo.kt new file mode 100644 index 0000000..d45d3a5 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/method/v3_0/members/MemberInfo.kt @@ -0,0 +1,85 @@ +package com.ecwid.maleorang.method.v3_0.members + +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.annotation.Field +import org.apache.commons.codec.digest.DigestUtils + +import java.util.Date + +class MemberInfo : MailchimpObject() { + @JvmField + @Field + var id: String? = null + + @JvmField + @Field + var email_address: String? = null + + @JvmField + @Field + var unique_email_id: String? = null + + @JvmField + @Field + var status: String? = null + + @JvmField + @Field + var merge_fields: MailchimpObject? = null + + @JvmField + @Field + var interests: MailchimpObject? = null + + @JvmField + @Field + var stats: MailchimpObject? = null + + @JvmField + @Field + var ip_signup: String? = null + + @JvmField + @Field + var timestamp_signup: Date? = null + + @JvmField + @Field + var ip_opt: String? = null + + @JvmField + @Field + var timestamp_opt: Date? = null + + @JvmField + @Field + var member_rating: Int? = null + + @JvmField + @Field + var last_changed: Date? = null + + @JvmField + @Field + var language: String? = null + + @JvmField + @Field + var vip: Boolean? = null + + @JvmField + @Field + var email_client: String? = null + + @JvmField + @Field + var location: MailchimpObject? = null + + @JvmField + @Field + var last_note: MailchimpObject? = null + + @JvmField + @Field + var list_id: String? = null +} diff --git a/src/main/java/com/ecwid/maleorang/util/ClassUtil.kt b/src/main/java/com/ecwid/maleorang/util/ClassUtil.kt new file mode 100644 index 0000000..70816f6 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/util/ClassUtil.kt @@ -0,0 +1,47 @@ +package com.ecwid.maleorang.util + +import com.ecwid.maleorang.MailchimpObject +import com.google.common.cache.CacheBuilder +import java.lang.reflect.Field +import java.lang.reflect.Modifier +import java.util.* + + +internal object ClassUtil { + fun Class<*>.getAnnotatedFields(annotationClass: Class): List { + val classes = LinkedList>().apply { + var c: Class<*>? = this@getAnnotatedFields + while (c != null) { addFirst(c); c = c.superclass } + } + + return Collections.unmodifiableList(ArrayList().apply { + for (c in classes) { + for (f in c.declaredFields) { + if (f.getAnnotation(annotationClass) != null) { + require(!Modifier.isStatic(f.modifiers), { "The annotated field must not be static: $f" }) + f.isAccessible = true + this += f + } + } + } + }) + } + + private val fieldsCache = CacheBuilder.newBuilder().softValues().build, Map>() + + val Class.mailchimpObjectFields: Map + get() = fieldsCache.get(this, { + Collections.unmodifiableMap(LinkedHashMap().apply { + for (f in getAnnotatedFields(com.ecwid.maleorang.annotation.Field::class.java)) { + var name = f.getAnnotation(com.ecwid.maleorang.annotation.Field::class.java).name + if (name.isEmpty()) { + name = f.name + } + + if (put(name, f) != null) { + throw IllegalArgumentException("Ambiguous reflective mapping: " + name) + } + } + }) + }) +} diff --git a/src/main/java/com/ecwid/maleorang/util/DateUtil.kt b/src/main/java/com/ecwid/maleorang/util/DateUtil.kt new file mode 100644 index 0000000..12414e5 --- /dev/null +++ b/src/main/java/com/ecwid/maleorang/util/DateUtil.kt @@ -0,0 +1,12 @@ +package com.ecwid.maleorang.util + +import org.joda.time.DateTimeZone +import org.joda.time.format.ISODateTimeFormat +import java.util.* + +internal object DateUtil { + private val format = ISODateTimeFormat.dateTimeNoMillis().withZone(DateTimeZone.UTC) + + fun formatDate(date: Date) = format.print(date.time) + fun parseDate(string: String) = Date(format.parseMillis(string)) +} diff --git a/src/test/java/com/ecwid/maleorang/DateUtilTest.kt b/src/test/java/com/ecwid/maleorang/DateUtilTest.kt new file mode 100644 index 0000000..fd90134 --- /dev/null +++ b/src/test/java/com/ecwid/maleorang/DateUtilTest.kt @@ -0,0 +1,24 @@ +package com.ecwid.maleorang + +import com.ecwid.maleorang.util.DateUtil.formatDate +import com.ecwid.maleorang.util.DateUtil.parseDate +import org.testng.Assert.* +import org.testng.annotations.Test +import java.util.* + + +class DateUtilTest { + @Test + fun testParse() { + println(formatDate(Date(0))) + + assertEquals(parseDate("1970-01-01T00:00:00Z"), Date(0)) + assertEquals(parseDate("1970-01-01T00:00:00+00:00"), Date(0)) + assertEquals(parseDate("1970-01-01T04:00:00+04:00"), Date(0)) + } + + @Test + fun testFormat() { + assertEquals(formatDate(Date(0)), "1970-01-01T00:00:00Z") + } +} \ No newline at end of file diff --git a/src/test/java/com/ecwid/maleorang/MailchimpMethodTest.java b/src/test/java/com/ecwid/maleorang/MailchimpMethodTest.java new file mode 100644 index 0000000..c7faf10 --- /dev/null +++ b/src/test/java/com/ecwid/maleorang/MailchimpMethodTest.java @@ -0,0 +1,23 @@ +package com.ecwid.maleorang; + +import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + + +public class MailchimpMethodTest { + @Test + public void testGetResultType() throws Exception { + class Result extends MailchimpObject { } + class Method extends MailchimpMethod { } + + assertEquals(new Method().getResultType(), Result.class); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetResultType_BadParam() { + class Result extends MailchimpObject { } + class Method extends MailchimpMethod { } + + new Method().getResultType(); + } +} diff --git a/src/test/java/com/ecwid/maleorang/MailchimpObjectGsonFactoryTest.java b/src/test/java/com/ecwid/maleorang/MailchimpObjectGsonFactoryTest.java new file mode 100644 index 0000000..e366d1a --- /dev/null +++ b/src/test/java/com/ecwid/maleorang/MailchimpObjectGsonFactoryTest.java @@ -0,0 +1,147 @@ +package com.ecwid.maleorang; + +import com.ecwid.maleorang.annotation.Field; +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import org.testng.annotations.Test; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import static org.testng.Assert.*; + +public class MailchimpObjectGsonFactoryTest { + + private static class PlainOldObject { + @Expose(serialize=true, deserialize=true) // has no effect + String ignored = "ignored"; + } + + private static class TestObject extends MailchimpObject { + @Field + @Expose(serialize=false, deserialize=false) // has no effect + @SerializedName("hasNoEffect") // has no effect + Date date; + + @Field + @Expose(serialize=false, deserialize=false) // has no effect + @SerializedName("hasNoEffect") // has no effect + Timestamp timestamp; + + @Field + @Expose(serialize=false, deserialize=false) // has no effect + @SerializedName("hasNoEffect") // has no effect + Integer integer; + + @Field + @Expose(serialize=false, deserialize=false) // has no effect + @SerializedName("hasNoEffect") // has no effect + MailchimpObject object; + + @Field + @Expose(serialize=false, deserialize=false) // has no effect + @SerializedName("hasNoEffect") // has no effect + TestObject child; + + @Field(name="children_array") + @Expose(serialize=false, deserialize=false) // has no effect + @SerializedName("hasNoEffect") // has no effect + TestObject array[]; + + @Field(name="children_list") + @Expose(serialize=false, deserialize=false) // has no effect + @SerializedName("hasNoEffect") // has no effect + List list; + + @Field + PlainOldObject plainOldObject; + + @Expose(serialize=true, deserialize=true) // has no effect + String ignored = "ignored"; + } + + @Test + public void test() { + Gson gson = MailchimpObjectGsonFactory.INSTANCE.createGson(); + + TestObject o = new TestObject(); + o.date = new Date(0); + o.timestamp = new Timestamp(0); + o.integer = 666; + o.object = new MailchimpObject(); + o.object.mapping.put("key", "value"); + o.child = new TestObject(); + o.child.integer = 555; + o.array = new TestObject[] { new TestObject() }; + o.array[0].integer = 111; + o.list = Arrays.asList(new TestObject()); + o.list.get(0).integer = 222; + o.plainOldObject = new PlainOldObject(); + + JsonObject json = gson.toJsonTree(o).getAsJsonObject(); + assertEquals(json.entrySet().size(), 8); + assertEquals(json.get("date").getAsString(), "1970-01-01T00:00:00Z"); + assertEquals(json.get("timestamp").getAsString(), "1970-01-01T00:00:00Z"); + assertEquals(json.get("integer").getAsInt(), 666); + assertEquals(json.get("object").getAsJsonObject().get("key").getAsString(), "value"); + assertEquals(json.get("child").getAsJsonObject().get("integer").getAsInt(), 555); + assertEquals(json.get("children_array").getAsJsonArray().get(0).getAsJsonObject().get("integer").getAsInt(), 111); + assertEquals(json.get("children_list").getAsJsonArray().get(0).getAsJsonObject().get("integer").getAsInt(), 222); + assertEquals(json.get("plainOldObject").getAsJsonObject().entrySet().size(), 0); + assertNull(json.get("ignored")); + json.addProperty("ignored", "really ignored?"); + json.get("plainOldObject").getAsJsonObject().addProperty("ignored", "really ignored?"); + + o = gson.fromJson(json, TestObject.class); + assertEquals(o.date, new Date(0)); + assertEquals(o.timestamp, new Timestamp(0)); + assertEquals((int) o.integer, 666); + assertEquals(o.object.mapping.get("key"), "value"); + assertEquals((int) o.child.integer, 555); + assertEquals((int) o.array[0].integer, 111); + assertEquals((int) o.list.get(0).integer, 222); + assertEquals(o.ignored, "ignored"); + assertEquals(o.plainOldObject.ignored, "ignored"); + } + + @Test + public void testDeserialization_untyped() { + Gson gson = MailchimpObjectGsonFactory.INSTANCE.createGson(); + + MailchimpObject test1 = gson.fromJson("{ test1:{test1:{test1:{test1:{}}}} }", MailchimpObject.class); + assertEquals(test1.getClass(), MailchimpObject.class); + test1 = (MailchimpObject) test1.mapping.get("test1"); + assertEquals(test1.getClass(), MailchimpObject.class); + test1 = (MailchimpObject) test1.mapping.get("test1"); + assertEquals(test1.getClass(), MailchimpObject.class); + test1 = (MailchimpObject) test1.mapping.get("test1"); + assertEquals(test1.getClass(), MailchimpObject.class); + test1 = (MailchimpObject) test1.mapping.get("test1"); + assertEquals(test1.getClass(), MailchimpObject.class); + assertNull(test1.mapping.get("test1")); + + MailchimpObject test2 = gson.fromJson("{ 'test2':[{\"test2\":[{},{}]},true,[{}]] }", MailchimpObject.class); + assertEquals(test2.getClass(), MailchimpObject.class); + Iterator i = ((List) test2.mapping.get("test2")).iterator(); + + test2 = (MailchimpObject) i.next(); + assertEquals(test2.getClass(), MailchimpObject.class); + assertEquals(((List) test2.mapping.get("test2")).size(), 2); + assertEquals(((List) test2.mapping.get("test2")).get(0).getClass(), MailchimpObject.class); + assertEquals(((List) test2.mapping.get("test2")).get(1).getClass(), MailchimpObject.class); + + assertEquals(i.next(), true); + + List test2_list = (List) i.next(); + assertEquals(test2_list.size(), 1); + test2 = (MailchimpObject) test2_list.get(0); + assertEquals(test2.getClass(), MailchimpObject.class); + + assertFalse(i.hasNext()); + } +} diff --git a/src/test/java/com/ecwid/maleorang/MailchimpObjectTest.java b/src/test/java/com/ecwid/maleorang/MailchimpObjectTest.java new file mode 100644 index 0000000..b232a65 --- /dev/null +++ b/src/test/java/com/ecwid/maleorang/MailchimpObjectTest.java @@ -0,0 +1,247 @@ +package com.ecwid.maleorang; + +import com.ecwid.maleorang.annotation.Field; +import com.ecwid.maleorang.util.ClassUtil; +import org.testng.annotations.Test; + +import java.util.*; + +import static org.testng.Assert.*; +import static org.testng.Assert.assertTrue; + + +public class MailchimpObjectTest { + + private static class TestBase extends MailchimpObject { + @Field + String f1; + } + + private static class TestObject extends TestBase { + @Field + int f2; + + @Field(name="f-3") + Date f3; + + String ignored; + } + + @Test + public void testGetMailchimpObjectFields() { + TestObject o = new TestObject(); + assertEquals(o.mapping.size(), 3); + + Iterator> i = ClassUtil.INSTANCE.getMailchimpObjectFields(o.getClass()).entrySet().iterator(); + Map.Entry entry = i.next(); + assertEquals(entry.getKey(), "f1"); + assertEquals(entry.getValue().getType(), String.class); + entry = i.next(); + assertEquals(entry.getKey(), "f2"); + assertEquals(entry.getValue().getType(), int.class); + entry = i.next(); + assertEquals(entry.getKey(), "f-3"); + assertEquals(entry.getValue().getType(), Date.class); + assertFalse(i.hasNext()); + } + + @Test + public void testPutAndGet() { + TestObject o = new TestObject(); + assertEquals(o.mapping.size(), 3); + + o.f1 = "f1_value"; + o.f2 = 666; + o.mapping.put("f-3", new Date(123456)); + o.mapping.put("f-4", new Date(654321)); + + assertEquals(o.mapping.size(), 4); + assertEquals(o.mapping.get("f1"), "f1_value"); + assertEquals(o.mapping.get("f2"), 666); + assertEquals(o.mapping.get("f-3"), new Date(123456)); + assertEquals(o.mapping.get("f-4"), new Date(654321)); + assertEquals(o.f3, new Date(123456)); + + assertEquals(o.mapping.put("f2", 777), 666); + assertEquals(o.mapping.get("f2"), 777); + assertEquals(o.f2, 777); + + assertEquals(o.mapping.put("f-4", 777), new Date(654321)); + assertEquals(o.mapping.get("f-4"), 777); + + try { + o.mapping.put("f2", "a string"); + fail(); + } catch(IllegalArgumentException e) { + // types mismatch + } + } + + @Test + public void testContains() { + TestObject o = new TestObject(); + assertEquals(o.mapping.size(), 3); + + assertTrue(o.mapping.containsKey("f1")); + assertTrue(o.mapping.containsKey("f2")); + assertTrue(o.mapping.containsKey("f-3")); + assertFalse(o.mapping.containsKey("f-4")); + + assertFalse(o.mapping.containsValue("f1_value")); + o.f1 = "f1_value"; + assertTrue(o.mapping.containsValue("f1_value")); + + assertFalse(o.mapping.containsValue(666)); + o.f2 = 666; + assertTrue(o.mapping.containsValue(666)); + + assertFalse(o.mapping.containsValue(new Date(111222333))); + o.f3 = new Date(111222333); + assertTrue(o.mapping.containsValue(new Date(111222333))); + + assertFalse(o.mapping.containsValue(MailchimpObjectTest.this)); + o.mapping.put("f-4", MailchimpObjectTest.this); + assertTrue(o.mapping.containsValue(MailchimpObjectTest.this)); + } + + @Test + public void testRemove() { + TestObject o = new TestObject(); + + assertEquals(o.mapping.size(), 3); + assertNull(o.mapping.remove("f-4")); + assertEquals(o.mapping.size(), 3); + o.mapping.put("f-4", null); + assertEquals(o.mapping.size(), 4); + assertNull(o.mapping.remove("f-4")); + assertEquals(o.mapping.size(), 3); + o.mapping.put("f-4", new Date(654321)); + assertEquals(o.mapping.size(), 4); + assertEquals(o.mapping.remove("f-4"), new Date(654321)); + assertEquals(o.mapping.size(), 3); + + try { + o.mapping.remove("f-3"); + fail(); + } catch (IllegalArgumentException e) { + // cannot remove reflective mapping + } + } + + @Test + public void testClear() { + TestObject o = new TestObject(); + try { + o.mapping.clear(); + fail(); + } catch(IllegalArgumentException e) { + // cannot remove reflective mapping + } + } + + @Test + public void testKeySet() { + TestObject o = new TestObject(); + Set set = o.mapping.keySet(); + + o.mapping.put("f-4", 111); + assertEquals(set.size(), 4); + + Iterator i = set.iterator(); + assertEquals(i.next(), "f1"); + assertEquals(i.next(), "f2"); + assertEquals(i.next(), "f-3"); + + try { + i.remove(); + fail(); + } catch (IllegalArgumentException e) { + // cannot remove reflective mapping + } + + assertEquals(set.size(), 4); + assertEquals(i.next(), "f-4"); + i.remove(); + assertFalse(i.hasNext()); + assertEquals(set.size(), 3); + + assertTrue(set.contains("f-3")); + assertFalse(set.contains("rrr")); + o.mapping.put("rrr", null); + assertTrue(set.contains("rrr")); + assertEquals(set.size(), 4); + assertTrue(set.remove("rrr")); + assertFalse(set.contains("rrr")); + assertFalse(set.remove("rrr")); + assertEquals(set.size(), 3); + + try { + o.mapping.remove("f-3"); + fail(); + } catch (IllegalArgumentException e) { + // cannot remove reflective mapping + } + } + + @Test + public void testValues() { + TestObject o = new TestObject(); + + assertFalse(o.mapping.values().contains(new Date(666))); + o.f3 = new Date(666); + assertTrue(o.mapping.values().contains(new Date(666))); + + assertFalse(o.mapping.values().contains(111)); + o.mapping.put("f-4", 111); + assertTrue(o.mapping.values().contains(111)); + + Iterator i = o.mapping.values().iterator(); + assertNull(i.next()); + assertEquals(i.next(), 0); + assertEquals(i.next(), new Date(666)); + + try { + i.remove(); + fail(); + } catch (IllegalArgumentException e) { + // cannot remove reflective mapping + } + + assertEquals(i.next(), 111); + assertFalse(i.hasNext()); + + assertEquals(o.mapping.size(), 4); + i.remove(); + assertEquals(o.mapping.size(), 3); + assertFalse(i.hasNext()); + } + + @Test + public void testEntrySet() { + TestObject o = new TestObject(); + Set> set = o.mapping.entrySet(); + + o.f3 = new Date(222222); + assertEquals(set.size(), 3); + o.mapping.put("f-4", 456); + assertEquals(set.size(), 4); + + assertTrue(set.contains(new AbstractMap.SimpleEntry("f1", null))); + assertFalse(set.contains(new AbstractMap.SimpleEntry("f-3", null))); + assertTrue(set.contains(new AbstractMap.SimpleEntry("f-3", new Date(222222)))); + assertTrue(set.contains(new AbstractMap.SimpleEntry("f-4", 456))); + assertFalse(set.contains(new AbstractMap.SimpleEntry("f-5", 456))); + + assertFalse(set.remove(new AbstractMap.SimpleEntry("f1", 777))); + assertEquals(set.size(), 4); + try { + set.remove(new AbstractMap.SimpleEntry("f1", null)); + fail(); + } catch (IllegalArgumentException e) { + // cannot remove reflective mapping + } + + assertTrue(set.remove(new AbstractMap.SimpleEntry("f-4", 456))); + assertEquals(set.size(), 3); + } +} \ No newline at end of file diff --git a/src/test/java/com/ecwid/maleorang/examples/MembersMethodsExample.java b/src/test/java/com/ecwid/maleorang/examples/MembersMethodsExample.java new file mode 100644 index 0000000..bacc8a9 --- /dev/null +++ b/src/test/java/com/ecwid/maleorang/examples/MembersMethodsExample.java @@ -0,0 +1,42 @@ +package com.ecwid.maleorang.examples; + +import com.ecwid.maleorang.MailchimpClient; +import com.ecwid.maleorang.MailchimpObject; +import com.ecwid.maleorang.method.v3_0.members.EditMemberMethod; +import com.ecwid.maleorang.method.v3_0.members.MemberInfo; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +/** + * Created by basil on 09.08.16. + */ +public class MembersMethodsExample { + + private final String apiKey, listId; + + @Parameters({"mailchimp.test.apikey", "mailchimp.test.listid"}) + private MembersMethodsExample(String apiKey, String listId) { + this.apiKey = apiKey; + this.listId = listId; + } + + /** + * This example shows how to subsribe a user. + */ + @Test + public void run() throws Exception { + MailchimpClient client = new MailchimpClient(apiKey); + try { + EditMemberMethod.CreateOrUpdate method = new EditMemberMethod.CreateOrUpdate(listId, "vasya.pupkin@gmail.com"); + method.status = "subscribed"; + method.merge_fields = new MailchimpObject(); + method.merge_fields.mapping.put("FNAME", "Vasya"); + method.merge_fields.mapping.put("LNAME", "Pupkin"); + + MemberInfo member = client.execute(method); + System.err.println("The user has been successfully subscribed: " + member); + } finally { + client.close(); + } + } +} diff --git a/src/test/java/com/ecwid/maleorang/method/v3_0/batches/BatchTest.kt b/src/test/java/com/ecwid/maleorang/method/v3_0/batches/BatchTest.kt new file mode 100644 index 0000000..7445341 --- /dev/null +++ b/src/test/java/com/ecwid/maleorang/method/v3_0/batches/BatchTest.kt @@ -0,0 +1,49 @@ +package com.ecwid.maleorang.method.v3_0.batches + +import com.ecwid.maleorang.MailchimpClient +import com.ecwid.maleorang.MailchimpException +import com.ecwid.maleorang.method.v3_0.members.DeleteBatchMethod +import com.ecwid.maleorang.method.v3_0.members.DeleteMemberMethod +import com.ecwid.maleorang.method.v3_0.members.EditMemberMethod +import org.testng.Assert.* +import org.testng.annotations.Parameters +import org.testng.annotations.Test + +class BatchTest +@Parameters("mailchimp.test.apikey", "mailchimp.test.listid") +constructor(private val apiKey: String, private val listId: String) { + + @Test + fun testGetBatches() { + MailchimpClient(apiKey).use { client -> + client.execute(GetBatchesStatusMethod()).apply { + assertNotNull(batches) + assertNotNull(total_items) + } + } + } + + @Test + fun testCreateGetAndDelete() { + MailchimpClient(apiKey).use { client -> + val batchId = client.execute(StartBatchMethod(listOf( + EditMemberMethod.CreateOrUpdate(listId, "vasya.pupkin@gmail.com"), + DeleteMemberMethod(listId, "vasya.pupkin@gmail.com") + ))).id!! + + client.execute(GetBatchStatusMethod(batchId)).apply { + assertEquals(id, batchId) + assertNotNull(status) + } + + client.execute(DeleteBatchMethod(batchId)); + + try { + client.execute(GetBatchStatusMethod(batchId)) + fail() + } catch(e: MailchimpException) { + assertEquals(e.code, 404) + } + } + } +} \ No newline at end of file diff --git a/src/test/java/com/ecwid/maleorang/method/v3_0/members/MembersTest.kt b/src/test/java/com/ecwid/maleorang/method/v3_0/members/MembersTest.kt new file mode 100644 index 0000000..db6388e --- /dev/null +++ b/src/test/java/com/ecwid/maleorang/method/v3_0/members/MembersTest.kt @@ -0,0 +1,156 @@ +package com.ecwid.maleorang.method.v3_0.members + +import com.ecwid.maleorang.MailchimpClient +import com.ecwid.maleorang.MailchimpException +import com.ecwid.maleorang.MailchimpMethod +import com.ecwid.maleorang.MailchimpObject +import com.ecwid.maleorang.method.v3_0.batches.BatchStatus +import com.ecwid.maleorang.method.v3_0.batches.GetBatchStatusMethod +import com.ecwid.maleorang.method.v3_0.batches.GetBatchesStatusMethod +import com.ecwid.maleorang.method.v3_0.batches.StartBatchMethod +import org.testng.Assert +import org.testng.Assert.* +import org.testng.annotations.BeforeMethod +import org.testng.annotations.Parameters +import org.testng.annotations.Test + +import java.util.concurrent.TimeUnit + +import java.util.* + +class MembersTest +@Parameters("mailchimp.test.apikey", "mailchimp.test.listid") +constructor(private val apiKey: String, private val listId: String) { + + @BeforeMethod + private fun cleanup() { + MailchimpClient(apiKey).use { client -> + var members: GetMembersMethod.Response = client.execute(GetMembersMethod(listId)) + while (members.total_items!! > 0) { + for (member in members.members!!) { + client.execute(DeleteMemberMethod(listId, member.email_address!!)) + } + + members = client.execute(GetMembersMethod(listId)) + } + } + } + + @Test + fun test_POST_PATCH() { + MailchimpClient(apiKey).use { client -> + val email = "vasya.pupkin@gmail.com" + + // Get nonexistent + try { + client.execute(GetMemberMethod(listId, email)) + fail() + } catch(e: MailchimpException) { + assertEquals(e.code, 404) + } + + // Creating the user + client.execute(EditMemberMethod.Create(listId, email).apply { + status = "subscribed" + merge_fields = MailchimpObject().apply { + mapping["FNAME"] = "Vasya" + mapping["LNAME"] = "Pupkin" + } + timestamp_signup = Date(0) + }).apply { + assertEquals(email_address, email) + assertEquals(status, "subscribed") + assertEquals(merge_fields!!.mapping["FNAME"], "Vasya") + assertEquals(merge_fields!!.mapping["LNAME"], "Pupkin") + assertEquals(timestamp_signup, Date(0)) + } + + // Updating the user using PATCH method + client.execute(EditMemberMethod.Update(listId, email).apply { + status = "unsubscribed" + merge_fields = MailchimpObject().apply { + mapping["FNAME"] = "Vasya1" + mapping["LNAME"] = "Pupkin1" + } + timestamp_signup = Date(10000) + }).apply { + assertEquals(email_address, email) + assertEquals(status, "unsubscribed") + assertEquals(merge_fields!!.mapping["FNAME"], "Vasya1") + assertEquals(merge_fields!!.mapping["LNAME"], "Pupkin1") + assertEquals(timestamp_signup, Date(10000)) + } + + // Get + client.execute(GetMemberMethod(listId, email)).apply { + assertEquals(email_address, email) + assertEquals(status, "unsubscribed") + assertEquals(merge_fields!!.mapping["FNAME"], "Vasya1") + assertEquals(merge_fields!!.mapping["LNAME"], "Pupkin1") + assertEquals(timestamp_signup, Date(10000)) + } + + // Delete + client.execute(DeleteMemberMethod(listId, email)) + } + } + + @Test + fun test_PUT() { + MailchimpClient(apiKey).use { client -> + val email = "vasya.pupkin@gmail.com" + + // Get nonexistent + try { + client.execute(GetMemberMethod(listId, email)) + fail() + } catch(e: MailchimpException) { + assertEquals(e.code, 404) + } + + // Create + client.execute(EditMemberMethod.CreateOrUpdate(listId, email).apply { + status = "subscribed" + merge_fields = MailchimpObject().apply { + mapping["FNAME"] = "Vasya" + mapping["LNAME"] = "Pupkin" + } + timestamp_signup = Date(1000000) + }).apply { + assertEquals(email_address, email) + assertEquals(status, "subscribed") + assertEquals(merge_fields!!.mapping["FNAME"], "Vasya") + assertEquals(merge_fields!!.mapping["LNAME"], "Pupkin") + assertEquals(timestamp_signup, Date(1000000)) + } + + // Update + client.execute(EditMemberMethod.CreateOrUpdate(listId, email).apply { + status = "unsubscribed" + merge_fields = MailchimpObject().apply { + mapping["FNAME"] = "Vasya1" + mapping["LNAME"] = "Pupkin1" + } + timestamp_signup = Date(1005000) + }).apply { + assertEquals(email_address, email) + assertEquals(status, "unsubscribed") + assertEquals(merge_fields!!.mapping["FNAME"], "Vasya1") + assertEquals(merge_fields!!.mapping["LNAME"], "Pupkin1") + assertEquals(timestamp_signup, Date(1005000)) + } + + // Get + client.execute(GetMemberMethod(listId, email)).apply { + assertEquals(email_address, email) + assertEquals(status, "unsubscribed") + assertEquals(merge_fields!!.mapping["FNAME"], "Vasya1") + assertEquals(merge_fields!!.mapping["LNAME"], "Pupkin1") + assertEquals(timestamp_signup, Date(1005000)) + } + + // Delete + client.execute(DeleteMemberMethod(listId, email)) + } + } +} diff --git a/test.gradle b/test.gradle new file mode 100644 index 0000000..8d52f71 --- /dev/null +++ b/test.gradle @@ -0,0 +1,19 @@ +test { + useTestNG(); + + outputs.upToDateWhen { + false + } + + exclude '**/examples/**' + + testLogging { + events = ["STARTED", "PASSED", "FAILED", "SKIPPED"] + } + + doFirst { + ['mailchimp.test.apikey', 'mailchimp.test.listid'].each { prop -> + systemProperty prop, project.getProperty(prop) + } + } +} \ No newline at end of file diff --git a/wrapper.gradle b/wrapper.gradle new file mode 100644 index 0000000..5e01852 --- /dev/null +++ b/wrapper.gradle @@ -0,0 +1,8 @@ +wrapper { + gradleVersion '2.14.1' + distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip" + + if (gradle.gradleVersion != gradleVersion) { + logger.error("Gradle version $gradleVersion is required, but version $gradle.gradleVersion is used") + } +} \ No newline at end of file