-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathProspectAccountQueryRequest.java
More file actions
109 lines (91 loc) · 3.54 KB
/
Copy pathProspectAccountQueryRequest.java
File metadata and controls
109 lines (91 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package com.darksci.pardot.api.request.prospectaccount;
import com.darksci.pardot.api.request.BaseQueryRequest;
import com.darksci.pardot.api.request.DateParameter;
import com.darksci.pardot.api.request.prospect.ProspectQueryRequest;
import java.util.Collection;
import java.util.stream.Collectors;
public class ProspectAccountQueryRequest extends BaseQueryRequest<ProspectAccountQueryRequest>
{
@Override
public String getApiEndpoint() {
return "prospectAccount/do/query";
}
/**
* Specifies the fields to be returned. Note: If this parameter isn't present, all default fields and custom fields
* for which the prospect has a value will be returned;
* id field will always be returned.
*
* Each call will append the field argument to the list of previously passed fields.
*
* @param fields Collection of fields to be selected by the request.
* @return RequestBuilder
*/
public ProspectAccountQueryRequest withFields(final Collection<String> fields) {
final String fieldsStr = fields.stream().collect(Collectors.joining( "," ));
final String currentValue = getParam("fields");
if (currentValue == null) {
// set
return setParam("fields", fieldsStr);
} else {
// Append
return setParam("fields", currentValue + "," + fieldsStr);
}
}
/**
* Specifies the fields to be returned. Note: If this parameter isn't present, all default fields and custom fields
* for which the prospect has a value will be returned;
* id field will always be returned.
*
* Each call will append the field argument to the list of previously passed fields.
*
* @param field Field to be selected by request.
* @return RequestBuilder
*/
public ProspectAccountQueryRequest withField(final String field) {
final String currentValue = getParam("fields");
if (currentValue == null) {
// set
return setParam("fields", field);
} else {
// Append
return setParam("fields", currentValue + "," + field);
}
}
public ProspectAccountQueryRequest withUpdatedAfter(final DateParameter dateParameter) {
return super.withUpdatedAfter(dateParameter);
}
public ProspectAccountQueryRequest withUpdatedBefore(final DateParameter dateParameter) {
return super.withUpdatedBefore(dateParameter);
}
public ProspectAccountQueryRequest withCreatedBefore(final DateParameter dateParameter) {
return super.withCreatedBefore(dateParameter);
}
public ProspectAccountQueryRequest withCreatedAfter(final DateParameter dateParameter) {
return super.withCreatedAfter(dateParameter);
}
// Filter Options
public ProspectAccountQueryRequest withName(final String name) {
return setParam("name", name);
}
/**
* Sort by CreatedAt.
* @return BaseQueryRequest
*/
public ProspectAccountQueryRequest withSortByCreatedAt() {
return super.withSortByCreatedAt();
}
/**
* Sort results by Id.
* @return BaseQueryRequest
*/
public ProspectAccountQueryRequest withSortById() {
return super.withSortById();
}
@Override
public ProspectAccountQueryRequest withSortByName() {
return super.withSortByName();
}
public ProspectAccountQueryRequest withSortByUpdatedAt() {
return super.withSortByUpdatedAt();
}
}