Skip to content

Commit 324e442

Browse files
authored
Add list and list membership support (#2)
* checkin list and listmemberships * Fix checkstyles * reformat license * Include header * checkstyle violation * update license * update readme and changelog * bump version * fix test
1 parent c98e276 commit 324e442

File tree

128 files changed

+3320
-33
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+3320
-33
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22
The format is based on [Keep a Changelog](http://keepachangelog.com/)
33
and this project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## 0.2.0 (11/11/17)
6+
- Support Api version 4 via configuration method .withApiVersion4()
7+
- Add support for List and ListMembership API endpoints.
8+
9+
510
## 0.1.0 (08/15/17)
6-
- Initial release!
11+
- Initial release!

LICENSE

Lines changed: 0 additions & 7 deletions
This file was deleted.

LICENSE.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright 2017 Stephen Powis https://github.com/Crim/pardot-java-client
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
5+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6+
persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
9+
Software.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## What is it?
66

7-
This library intends to be a fluent style API client for Pardot's API (version 3).
7+
This library intends to be a fluent style API client for Pardot's API (version 3 and 4).
88

99
**Note** It currently is not fully featured/fully implemented. If there is a feature/end point that you
1010
need that is not yet implemented, please read the **[How to Contribute](#how-to-contribute)** section, or **[Create an issue](https://github.com/Crim/pardot-java-client/issues)**
@@ -21,7 +21,7 @@ This client library is released on Maven Central. Add a new dependency to your
2121
<dependency>
2222
<groupId>com.darksci</groupId>
2323
<artifactId>pardot-api-client</artifactId>
24-
<version>0.1.0</version>
24+
<version>0.2.0</version>
2525
</dependency>
2626
```
2727

@@ -35,6 +35,15 @@ Example Code:
3535
*/
3636
final Configuration configuration = new Configuration("YourPardotUserNameHere", "PardotPassword", "UserKey");
3737

38+
/*
39+
* Optionally select which API version to use, if none is explicitly selected
40+
* the library will default to version 3.
41+
*/
42+
configuration.withApiVersion3();
43+
44+
/* Or */
45+
configuration.withApiVersion4();
46+
3847
/*
3948
* Create an instance of PardotClient, passing your configuration.
4049
*/
@@ -109,6 +118,22 @@ Official Documentation: [Emails](http://developer.pardot.com/kb/api-version-3/em
109118
- Sending One to One Emails
110119
- Stats
111120

121+
### Lists
122+
Official Documentation: [Lists](http://developer.pardot.com/kb/api-version-3/lists/)
123+
124+
- Create
125+
- Query
126+
- Read
127+
- Update
128+
129+
### List Memberships
130+
Official Documentation: [ListMemberships](http://developer.pardot.com/kb/api-version-3/list-memberships/)
131+
132+
- Create
133+
- Query
134+
- Read
135+
- Update
136+
112137
### Prospects
113138
Official Documentation: [Prospects](http://developer.pardot.com/kb/api-version-3/prospects/)
114139

build/pardot_style-v1.5.xml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
11
<?xml version="1.0"?>
22
<!DOCTYPE module PUBLIC
3-
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4-
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
5-
<!--
6-
DO NOT MANUALLY EDIT THIS FILE!
7-
Pull Latest from here: https://confluence.dev.pardot.com/display/PE/Java+Standards
8-
9-
Checkstyle configuration based originally on the Google coding conventions.
10-
11-
Changelog:
12-
13-
v1.5 - August 8, 2017
14-
- Now requiring class level javadocs for all public scoped interfaces, classes, and enums.
15-
16-
-->
17-
3+
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4+
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
185
<module name = "Checker">
196
<property name="charset" value="UTF-8"/>
207

pom.xml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.darksci</groupId>
88
<artifactId>pardot-api-client</artifactId>
9-
<version>0.1.0</version>
9+
<version>0.2.0</version>
1010
<packaging>jar</packaging>
1111

1212
<!-- Require Maven 3.3.9 -->
@@ -248,6 +248,35 @@
248248
</dependency>
249249
</dependencies>
250250
</plugin>
251+
252+
<!-- License Auditing -->
253+
<plugin>
254+
<groupId>com.mycila</groupId>
255+
<artifactId>license-maven-plugin</artifactId>
256+
<version>3.0</version>
257+
<configuration>
258+
<header>LICENSE.txt</header>
259+
<excludes>
260+
<exclude>**/.md</exclude>
261+
<exclude>**/.bak</exclude>
262+
<exclude>**.yml</exclude>
263+
<exclude>**.yaml</exclude>
264+
<exclude>**.xml</exclude>
265+
<exclude>build/**</exclude>
266+
<exclude>src/test/resources/**</exclude>
267+
<exclude>src/main/resources/**</exclude>
268+
<exclude>LICENSE.txt</exclude>
269+
</excludes>
270+
</configuration>
271+
<executions>
272+
<execution>
273+
<phase>compile</phase>
274+
<goals>
275+
<goal>check</goal>
276+
</goals>
277+
</execution>
278+
</executions>
279+
</plugin>
251280
</plugins>
252281
</pluginManagement>
253282
</build>

src/main/java/com/darksci/pardot/api/Configuration.java

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* Copyright 2017 Stephen Powis https://github.com/Crim/pardot-java-client
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
7+
* persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10+
* Software.
11+
*
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13+
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16+
*/
17+
118
package com.darksci.pardot.api;
219

320
/**
@@ -24,7 +41,7 @@ public class Configuration {
2441
private String proxyUsername = null;
2542
private String proxyPassword = null;
2643

27-
// If you want to override the Pardot API url
44+
// If you want to override the Pardot API url or version.
2845
private String pardotApiHost = "https://pi.pardot.com/api";
2946
private String pardotApiVersion = "3";
3047

@@ -58,22 +75,44 @@ public String getUserKey() {
5875
* @param proxyHost Host for the proxy to use.
5976
* @param proxyPort Post for the proxy to use.
6077
* @param proxyScheme Scheme to use, HTTP/HTTPS
78+
* @return Configuration instance.
6179
*/
62-
public void useProxy(final String proxyHost, final int proxyPort, final String proxyScheme) {
80+
public Configuration useProxy(final String proxyHost, final int proxyPort, final String proxyScheme) {
6381
this.proxyHost = proxyHost;
6482
this.proxyPort = proxyPort;
6583
this.proxyScheme = proxyScheme;
84+
return this;
6685
}
6786

6887
/**
6988
* Allow setting credentials for a proxy that requires authentication.
7089
*
7190
* @param proxyUsername Username for proxy.
7291
* @param proxyPassword Password for proxy.
92+
* @return Configuration instance.
7393
*/
74-
public void useProxyAuthentication(final String proxyUsername, final String proxyPassword) {
94+
public Configuration useProxyAuthentication(final String proxyUsername, final String proxyPassword) {
7595
this.proxyUsername = proxyUsername;
7696
this.proxyPassword = proxyPassword;
97+
return this;
98+
}
99+
100+
/**
101+
* Configure library to use Pardot Api Version 4.
102+
* @return Configuration instance.
103+
*/
104+
public Configuration withApiVersion4() {
105+
this.pardotApiVersion = "4";
106+
return this;
107+
}
108+
109+
/**
110+
* Configure library to use Pardot Api Version 4.
111+
* @return Configuration instance.
112+
*/
113+
public Configuration withApiVersion3() {
114+
this.pardotApiVersion = "3";
115+
return this;
77116
}
78117

79118
public String getProxyHost() {

src/main/java/com/darksci/pardot/api/Example.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* Copyright 2017 Stephen Powis https://github.com/Crim/pardot-java-client
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
7+
* persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10+
* Software.
11+
*
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13+
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16+
*/
17+
118
package com.darksci.pardot.api;
219

320
import com.darksci.pardot.api.request.DateParameter;
@@ -23,6 +40,15 @@ public static void example() {
2340
*/
2441
final Configuration configuration = new Configuration("YourPardotUserNameHere", "PardotPassword", "UserKey");
2542

43+
/*
44+
* Optionally select which API version to use, if none is explicitly selected
45+
* the library will default to version 3.
46+
*/
47+
configuration.withApiVersion3();
48+
49+
/* Or */
50+
configuration.withApiVersion4();
51+
2652
/*
2753
* Create an instance of PardotClient, passing your configuration.
2854
*/

src/main/java/com/darksci/pardot/api/InvalidRequestException.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* Copyright 2017 Stephen Powis https://github.com/Crim/pardot-java-client
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
7+
* persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10+
* Software.
11+
*
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13+
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16+
*/
17+
118
package com.darksci.pardot.api;
219

320
/**

0 commit comments

Comments
 (0)