|
78 | 78 | import java.io.InputStream; |
79 | 79 | import javax.ws.rs.core.GenericType; |
80 | 80 |
|
| 81 | +import okio.BufferedSource; |
81 | 82 | import org.apache.commons.lang3.StringUtils; |
82 | 83 |
|
83 | 84 | public class TweetsApi extends ApiCommon { |
@@ -1692,17 +1693,16 @@ private okhttp3.Call sampleStreamValidateBeforeCall(StreamQueryParameters stream |
1692 | 1693 | <tr><td> 0 </td><td> The request has failed. </td><td> - </td></tr> |
1693 | 1694 | </table> |
1694 | 1695 | */ |
1695 | | - public InputStream sampleStream(StreamQueryParameters streamParameters) throws ApiException { |
1696 | | - InputStream localVarResp = sampleStreamWithHttpInfo(streamParameters); |
1697 | | - return localVarResp; |
| 1696 | + public BufferedSource sampleStream(StreamQueryParameters streamParameters) throws ApiException { |
| 1697 | + return sampleStreamWithHttpInfo(streamParameters); |
1698 | 1698 | } |
1699 | 1699 |
|
1700 | 1700 | /** |
1701 | 1701 | * Calls the API using a retry mechanism to handle rate limits errors. |
1702 | 1702 | * |
1703 | 1703 | */ |
1704 | | - public InputStream sampleStream(Integer retries, StreamQueryParameters streamParameters) throws ApiException { |
1705 | | - InputStream localVarResp; |
| 1704 | + public BufferedSource sampleStream(Integer retries, StreamQueryParameters streamParameters) throws ApiException { |
| 1705 | + BufferedSource localVarResp; |
1706 | 1706 | try{ |
1707 | 1707 | localVarResp = sampleStream(streamParameters); |
1708 | 1708 | } |
@@ -1730,11 +1730,10 @@ public InputStream sampleStream(Integer retries, StreamQueryParameters streamPar |
1730 | 1730 | <tr><td> 0 </td><td> The request has failed. </td><td> - </td></tr> |
1731 | 1731 | </table> |
1732 | 1732 | */ |
1733 | | - public InputStream sampleStreamWithHttpInfo(StreamQueryParameters streamParameters) throws ApiException { |
| 1733 | + public BufferedSource sampleStreamWithHttpInfo(StreamQueryParameters streamParameters) throws ApiException { |
1734 | 1734 | okhttp3.Call localVarCall = sampleStreamValidateBeforeCall(streamParameters, null); |
1735 | 1735 | try { |
1736 | | - Type localVarReturnType = new TypeToken<StreamingTweet>(){}.getType(); |
1737 | | - return localVarApiClient.executeStream(localVarCall, localVarReturnType); |
| 1736 | + return localVarApiClient.executeStream(localVarCall); |
1738 | 1737 | } catch (ApiException e) { |
1739 | 1738 | e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<com.twitter.clientlib.model.ProblemOrError>(){}.getType())); |
1740 | 1739 | throw e; |
@@ -1857,17 +1856,16 @@ private okhttp3.Call searchStreamValidateBeforeCall(StreamQueryParameters stream |
1857 | 1856 | <tr><td> 0 </td><td> The request has failed. </td><td> - </td></tr> |
1858 | 1857 | </table> |
1859 | 1858 | */ |
1860 | | - public InputStream searchStream(StreamQueryParameters streamParameters) throws ApiException { |
1861 | | - InputStream localVarResp = searchStreamWithHttpInfo(streamParameters); |
1862 | | - return localVarResp; |
| 1859 | + public BufferedSource searchStream(StreamQueryParameters streamParameters) throws ApiException { |
| 1860 | + return searchStreamWithHttpInfo(streamParameters); |
1863 | 1861 | } |
1864 | 1862 |
|
1865 | 1863 | /** |
1866 | 1864 | * Calls the API using a retry mechanism to handle rate limits errors. |
1867 | 1865 | * |
1868 | 1866 | */ |
1869 | | - public InputStream searchStream(Integer retries, StreamQueryParameters streamParameters) throws ApiException { |
1870 | | - InputStream localVarResp; |
| 1867 | + public BufferedSource searchStream(Integer retries, StreamQueryParameters streamParameters) throws ApiException { |
| 1868 | + BufferedSource localVarResp; |
1871 | 1869 | try{ |
1872 | 1870 | localVarResp = searchStream(streamParameters); |
1873 | 1871 | } |
@@ -1895,11 +1893,10 @@ public InputStream searchStream(Integer retries, StreamQueryParameters streamPar |
1895 | 1893 | <tr><td> 0 </td><td> The request has failed. </td><td> - </td></tr> |
1896 | 1894 | </table> |
1897 | 1895 | */ |
1898 | | - public InputStream searchStreamWithHttpInfo(StreamQueryParameters streamParameters) throws ApiException { |
| 1896 | + public BufferedSource searchStreamWithHttpInfo(StreamQueryParameters streamParameters) throws ApiException { |
1899 | 1897 | okhttp3.Call localVarCall = searchStreamValidateBeforeCall(streamParameters, null); |
1900 | 1898 | try { |
1901 | | - Type localVarReturnType = new TypeToken<FilteredStreamingTweet>(){}.getType(); |
1902 | | - return localVarApiClient.executeStream(localVarCall, localVarReturnType); |
| 1899 | + return localVarApiClient.executeStream(localVarCall); |
1903 | 1900 | } catch (ApiException e) { |
1904 | 1901 | e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<com.twitter.clientlib.model.ProblemOrError>(){}.getType())); |
1905 | 1902 | throw e; |
|
0 commit comments