Skip to content

Commit

Permalink
Add list and list membership support (#2)
Browse files Browse the repository at this point in the history
* checkin list and listmemberships

* Fix checkstyles

* reformat license

* Include header

* checkstyle violation

* update license

* update readme and changelog

* bump version

* fix test
  • Loading branch information
Crim authored Nov 11, 2017
1 parent c98e276 commit 324e442
Show file tree
Hide file tree
Showing 128 changed files with 3,320 additions and 33 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 0.2.0 (11/11/17)
- Support Api version 4 via configuration method .withApiVersion4()
- Add support for List and ListMembership API endpoints.


## 0.1.0 (08/15/17)
- Initial release!
- Initial release!
7 changes: 0 additions & 7 deletions LICENSE

This file was deleted.

14 changes: 14 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright 2017 Stephen Powis https://github.com/Crim/pardot-java-client

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## What is it?

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

**Note** It currently is not fully featured/fully implemented. If there is a feature/end point that you
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)**
Expand All @@ -21,7 +21,7 @@ This client library is released on Maven Central. Add a new dependency to your
<dependency>
<groupId>com.darksci</groupId>
<artifactId>pardot-api-client</artifactId>
<version>0.1.0</version>
<version>0.2.0</version>
</dependency>
```

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

/*
* Optionally select which API version to use, if none is explicitly selected
* the library will default to version 3.
*/
configuration.withApiVersion3();

/* Or */
configuration.withApiVersion4();

/*
* Create an instance of PardotClient, passing your configuration.
*/
Expand Down Expand Up @@ -109,6 +118,22 @@ Official Documentation: [Emails](http://developer.pardot.com/kb/api-version-3/em
- Sending One to One Emails
- Stats

### Lists
Official Documentation: [Lists](http://developer.pardot.com/kb/api-version-3/lists/)

- Create
- Query
- Read
- Update

### List Memberships
Official Documentation: [ListMemberships](http://developer.pardot.com/kb/api-version-3/list-memberships/)

- Create
- Query
- Read
- Update

### Prospects
Official Documentation: [Prospects](http://developer.pardot.com/kb/api-version-3/prospects/)

Expand Down
17 changes: 2 additions & 15 deletions build/pardot_style-v1.5.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
DO NOT MANUALLY EDIT THIS FILE!
Pull Latest from here: https://confluence.dev.pardot.com/display/PE/Java+Standards
Checkstyle configuration based originally on the Google coding conventions.
Changelog:
v1.5 - August 8, 2017
- Now requiring class level javadocs for all public scoped interfaces, classes, and enums.
-->

"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name = "Checker">
<property name="charset" value="UTF-8"/>

Expand Down
31 changes: 30 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.darksci</groupId>
<artifactId>pardot-api-client</artifactId>
<version>0.1.0</version>
<version>0.2.0</version>
<packaging>jar</packaging>

<!-- Require Maven 3.3.9 -->
Expand Down Expand Up @@ -248,6 +248,35 @@
</dependency>
</dependencies>
</plugin>

<!-- License Auditing -->
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<header>LICENSE.txt</header>
<excludes>
<exclude>**/.md</exclude>
<exclude>**/.bak</exclude>
<exclude>**.yml</exclude>
<exclude>**.yaml</exclude>
<exclude>**.xml</exclude>
<exclude>build/**</exclude>
<exclude>src/test/resources/**</exclude>
<exclude>src/main/resources/**</exclude>
<exclude>LICENSE.txt</exclude>
</excludes>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
45 changes: 42 additions & 3 deletions src/main/java/com/darksci/pardot/api/Configuration.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Copyright 2017 Stephen Powis https://github.com/Crim/pardot-java-client
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.darksci.pardot.api;

/**
Expand All @@ -24,7 +41,7 @@ public class Configuration {
private String proxyUsername = null;
private String proxyPassword = null;

// If you want to override the Pardot API url
// If you want to override the Pardot API url or version.
private String pardotApiHost = "https://pi.pardot.com/api";
private String pardotApiVersion = "3";

Expand Down Expand Up @@ -58,22 +75,44 @@ public String getUserKey() {
* @param proxyHost Host for the proxy to use.
* @param proxyPort Post for the proxy to use.
* @param proxyScheme Scheme to use, HTTP/HTTPS
* @return Configuration instance.
*/
public void useProxy(final String proxyHost, final int proxyPort, final String proxyScheme) {
public Configuration useProxy(final String proxyHost, final int proxyPort, final String proxyScheme) {
this.proxyHost = proxyHost;
this.proxyPort = proxyPort;
this.proxyScheme = proxyScheme;
return this;
}

/**
* Allow setting credentials for a proxy that requires authentication.
*
* @param proxyUsername Username for proxy.
* @param proxyPassword Password for proxy.
* @return Configuration instance.
*/
public void useProxyAuthentication(final String proxyUsername, final String proxyPassword) {
public Configuration useProxyAuthentication(final String proxyUsername, final String proxyPassword) {
this.proxyUsername = proxyUsername;
this.proxyPassword = proxyPassword;
return this;
}

/**
* Configure library to use Pardot Api Version 4.
* @return Configuration instance.
*/
public Configuration withApiVersion4() {
this.pardotApiVersion = "4";
return this;
}

/**
* Configure library to use Pardot Api Version 4.
* @return Configuration instance.
*/
public Configuration withApiVersion3() {
this.pardotApiVersion = "3";
return this;
}

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

package com.darksci.pardot.api;

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

/*
* Optionally select which API version to use, if none is explicitly selected
* the library will default to version 3.
*/
configuration.withApiVersion3();

/* Or */
configuration.withApiVersion4();

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

package com.darksci.pardot.api;

/**
Expand Down
Loading

0 comments on commit 324e442

Please sign in to comment.