Skip to content

Commit fa08158

Browse files
authored
Add missing query parameters to ProspectQueryRequest (#66)
1 parent bedc58c commit fa08158

File tree

4 files changed

+39
-5
lines changed

4 files changed

+39
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +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-
## 3.0.0 (UNRELEASED)
5+
## 3.1.0 (10/23/2020)
6+
- [ISSUE-65](https://github.com/Crim/pardot-java-client/issues/65) Adds missing Query options to `ProspectQuerytRequest` for `withUpdatedAfter()` and `withUpdatedBefore()`.
7+
8+
## 3.0.0 (09/21/2020)
69

710
### Breaking Changes
811
This release has several breaking changes. See [3.0.0 Migration Notes](3_0_0_migration_notes.MD) for details on breaking changes and how to upgrade.

pom.xml

Lines changed: 1 addition & 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>3.0.0</version>
9+
<version>3.1.0</version>
1010
<packaging>jar</packaging>
1111

1212
<!-- Require Maven 3.5.0 -->

src/main/java/com/darksci/pardot/api/request/BaseQueryRequest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public T withCreatedBefore(final DateParameter createdBefore) {
6363

6464
/**
6565
* Add constraint where UpdatedAt field is after than the specified time value.
66+
* Note: marked as protected because not supported by all entities.
6667
* @param updatedAfter date constraint.
6768
* @return BaseQueryRequest
6869
*/
@@ -72,6 +73,7 @@ protected T withUpdatedAfter(final DateParameter updatedAfter) {
7273

7374
/**
7475
* Add constraint where UpdatedAt field is before than the specified time value.
76+
* Note: marked as protected because not supported by all entities.
7577
* @param updatedBefore date constraint.
7678
* @return BaseQueryRequest
7779
*/

src/main/java/com/darksci/pardot/api/request/prospect/ProspectQueryRequest.java

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public String getApiEndpoint() {
4343
* @param fields Collection of fields to be selected by the request.
4444
* @return RequestBuilder
4545
*/
46-
public ProspectQueryRequest withFields(Collection<String> fields) {
46+
public ProspectQueryRequest withFields(final Collection<String> fields) {
4747
final String fieldsStr = fields.stream().collect(Collectors.joining( "," ));
4848
final String currentValue = getParam("fields");
4949
if (currentValue == null) {
@@ -126,6 +126,16 @@ public ProspectQueryRequest withNotArchivedOnly() {
126126
return super.withArchivedOnly(false);
127127
}
128128

129+
/**
130+
* Retrieve only archived/non-archived prospects.
131+
* @param onlyReturnArchived True to only get returned archived entries.
132+
* @return BaseQueryRequest
133+
*/
134+
@Override
135+
public ProspectQueryRequest withArchivedOnly(final boolean onlyReturnArchived) {
136+
return super.withArchivedOnly(onlyReturnArchived);
137+
}
138+
129139
/**
130140
* Only select prospects who have a grade equal to the specified grade.
131141
* @param grade Grade in format of "A", "A+", "B", "C-"
@@ -174,10 +184,30 @@ public ProspectQueryRequest withNotStarredOnly() {
174184
* @param lastActivityAfter The date to filter.
175185
* @return RequestBuilder
176186
*/
177-
public ProspectQueryRequest withLastActivityAfter(DateParameter lastActivityAfter) {
187+
public ProspectQueryRequest withLastActivityAfter(final DateParameter lastActivityAfter) {
178188
return setParam("last_activity_after", lastActivityAfter);
179189
}
180190

191+
/**
192+
* Add constraint where UpdatedAt field is after than the specified time value.
193+
* @param updatedAfter date constraint.
194+
* @return BaseQueryRequest
195+
*/
196+
@Override
197+
public ProspectQueryRequest withUpdatedAfter(final DateParameter updatedAfter) {
198+
return super.withUpdatedAfter(updatedAfter);
199+
}
200+
201+
/**
202+
* Add constraint where UpdatedAt field is before than the specified time value.
203+
* @param updatedBefore date constraint.
204+
* @return BaseQueryRequest
205+
*/
206+
@Override
207+
public ProspectQueryRequest withUpdatedBefore(final DateParameter updatedBefore) {
208+
return super.withUpdatedBefore(updatedBefore);
209+
}
210+
181211
/**
182212
* Only select prospects who have no activity.
183213
* @return RequestBuilder
@@ -279,5 +309,4 @@ public ProspectQueryRequest withSortByLastActivityAt() {
279309
public ProspectQueryRequest withSortById() {
280310
return super.withSortById();
281311
}
282-
283312
}

0 commit comments

Comments
 (0)