Skip to content

Commit 10bcb4f

Browse files
tmoskovitchzacmos
authored andcommitted
Adding result_count to RulesResponseMetadata.
1 parent b06cfc0 commit 10bcb4f

File tree

8 files changed

+49
-10
lines changed

8 files changed

+49
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Add this dependency to your project's POM:
4444
<dependency>
4545
<groupId>com.twitter</groupId>
4646
<artifactId>twitter-api-java-sdk</artifactId>
47-
<version>1.1.2</version>
47+
<version>1.1.3</version>
4848
</dependency>
4949
```
5050

@@ -53,7 +53,7 @@ Add this dependency to your project's POM:
5353
Add this dependency to your project's build file:
5454

5555
```groovy
56-
implementation "com.twitter:twitter-api-java-sdk:1.1.2"
56+
implementation "com.twitter:twitter-api-java-sdk:1.1.3"
5757
```
5858

5959
### Others
@@ -66,7 +66,7 @@ mvn clean package
6666

6767
Then manually install the following JARs:
6868

69-
- `target/twitter-api-java-sdk-1.1.2.jar`
69+
- `target/twitter-api-java-sdk-1.1.3.jar`
7070
- `target/lib/*.jar`
7171

7272
## Twitter Credentials

docs/RulesResponseMetadata.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
------------ | ------------- | ------------- | -------------
1010
**sent** | **String** | |
1111
**summary** | [**RulesRequestSummary**](RulesRequestSummary.md) | | [optional]
12+
**resultCount** | **Integer** | The number of rules results returned in this response | [optional]
1213

1314

1415

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<dependency>
1717
<groupId>com.twitter</groupId>
1818
<artifactId>twitter-api-java-sdk</artifactId>
19-
<version>1.1.2</version>
19+
<version>1.1.3</version>
2020
<scope>compile</scope>
2121
</dependency>
2222
</dependencies>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>twitter-api-java-sdk</artifactId>
66
<packaging>jar</packaging>
77
<name>twitter-api-java-sdk</name>
8-
<version>1.1.2</version>
8+
<version>1.1.3</version>
99
<url>https://github.com/twitterdev/twitter-api-java-sdk</url>
1010
<description>Twitter API v2 available endpoints</description>
1111
<scm>

src/main/java/com/twitter/clientlib/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private void init() {
232232
json = new JSON();
233233

234234
// Set default User-Agent.
235-
setUserAgent("twitter-api-java-sdk/1.1.2");
235+
setUserAgent("twitter-api-java-sdk/1.1.3");
236236

237237
authentications = new HashMap<String, Authentication>();
238238
}

src/main/java/com/twitter/clientlib/model/RulesResponseMetadata.java

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ public class RulesResponseMetadata {
6666
@SerializedName(SERIALIZED_NAME_SUMMARY)
6767
private RulesRequestSummary summary;
6868

69+
public static final String SERIALIZED_NAME_RESULT_COUNT = "result_count";
70+
@SerializedName(SERIALIZED_NAME_RESULT_COUNT)
71+
private Integer resultCount;
72+
6973
public RulesResponseMetadata() {
7074
}
7175

@@ -115,6 +119,29 @@ public void setSummary(RulesRequestSummary summary) {
115119
}
116120

117121

122+
public RulesResponseMetadata resultCount(Integer resultCount) {
123+
124+
this.resultCount = resultCount;
125+
return this;
126+
}
127+
128+
/**
129+
* The number of rules results returned in this response
130+
* @return resultCount
131+
**/
132+
@javax.annotation.Nullable
133+
@ApiModelProperty(value = "The number of rules results returned in this response")
134+
135+
public Integer getResultCount() {
136+
return resultCount;
137+
}
138+
139+
140+
public void setResultCount(Integer resultCount) {
141+
this.resultCount = resultCount;
142+
}
143+
144+
118145
@Override
119146
public boolean equals(Object o) {
120147
if (this == o) {
@@ -125,12 +152,13 @@ public boolean equals(Object o) {
125152
}
126153
RulesResponseMetadata rulesResponseMetadata = (RulesResponseMetadata) o;
127154
return Objects.equals(this.sent, rulesResponseMetadata.sent) &&
128-
Objects.equals(this.summary, rulesResponseMetadata.summary);
155+
Objects.equals(this.summary, rulesResponseMetadata.summary) &&
156+
Objects.equals(this.resultCount, rulesResponseMetadata.resultCount);
129157
}
130158

131159
@Override
132160
public int hashCode() {
133-
return Objects.hash(sent, summary);
161+
return Objects.hash(sent, summary, resultCount);
134162
}
135163

136164
@Override
@@ -139,6 +167,7 @@ public String toString() {
139167
sb.append("class RulesResponseMetadata {\n");
140168
sb.append(" sent: ").append(toIndentedString(sent)).append("\n");
141169
sb.append(" summary: ").append(toIndentedString(summary)).append("\n");
170+
sb.append(" resultCount: ").append(toIndentedString(resultCount)).append("\n");
142171
sb.append("}");
143172
return sb.toString();
144173
}
@@ -163,6 +192,7 @@ private String toIndentedString(Object o) {
163192
openapiFields = new HashSet<String>();
164193
openapiFields.add("sent");
165194
openapiFields.add("summary");
195+
openapiFields.add("result_count");
166196

167197
// a set of required properties/fields (JSON key names)
168198
openapiRequiredFields = new HashSet<String>();

src/test/java/com/twitter/clientlib/integration/ApiTweetBearerTester.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private AddOrDeleteRulesResponse deleteRule(String ruleStrValue) throws ApiExcep
8080
}
8181

8282

83-
/* @Test
83+
@Test
8484
public void getRulesAllTest() throws ApiException {
8585
GetRulesResponse result = apiInstance.tweets().getRules(null, null, null);
8686
assertNotNull(result.getData());
@@ -90,7 +90,7 @@ public void getRulesAllTest() throws ApiException {
9090
assertNotNull(result.getMeta());
9191
assertNotNull(result.getMeta().getSent());
9292
assertTrue(result.getMeta().getResultCount() > 0);
93-
} */
93+
}
9494

9595
@Test
9696
public void addOrDeleteRulesAddTest() throws ApiException {

src/test/java/com/twitter/clientlib/model/RulesResponseMetadataTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,12 @@ public void summaryTest() {
6666
// TODO: test summary
6767
}
6868

69+
/**
70+
* Test the property 'resultCount'
71+
*/
72+
@Test
73+
public void resultCountTest() {
74+
// TODO: test resultCount
75+
}
76+
6977
}

0 commit comments

Comments
 (0)