late-sdk 0.0.585 → 0.0.587
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/docs/SearchTweets200Response.md +24 -0
- data/docs/SearchTweets200ResponseMeta.md +24 -0
- data/docs/SearchTweets200ResponseTweetsInner.md +40 -0
- data/docs/SearchTweets200ResponseTweetsInnerAuthor.md +26 -0
- data/docs/TwitterEngagementApi.md +88 -0
- data/lib/zernio-sdk/api/twitter_engagement_api.rb +122 -0
- data/lib/zernio-sdk/models/search_tweets200_response.rb +176 -0
- data/lib/zernio-sdk/models/search_tweets200_response_meta.rb +176 -0
- data/lib/zernio-sdk/models/search_tweets200_response_tweets_inner.rb +248 -0
- data/lib/zernio-sdk/models/search_tweets200_response_tweets_inner_author.rb +183 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +4 -0
- data/openapi.yaml +109 -3
- data/spec/api/twitter_engagement_api_spec.rb +20 -0
- data/spec/models/search_tweets200_response_meta_spec.rb +54 -0
- data/spec/models/search_tweets200_response_spec.rb +54 -0
- data/spec/models/search_tweets200_response_tweets_inner_author_spec.rb +60 -0
- data/spec/models/search_tweets200_response_tweets_inner_spec.rb +102 -0
- data/zernio-sdk-0.0.587.gem +0 -0
- metadata +18 -2
- data/zernio-sdk-0.0.585.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a9cadd1fb1f6680d283d30ef6c065ffe44016557999c1845abae44745bd50e33
|
|
4
|
+
data.tar.gz: 17dffd1d21700dbddaff6983886f539e10e77e0f641859687e596a6fb0bd052e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f5eca35a8a3e12afa5a7c49402ea27e691a835bbf15c57d6e778c15eae6a2771dc841abdddc129c6700f0efffa11e7ac3f667668a1c0ae72edc3fffdeedcfd0
|
|
7
|
+
data.tar.gz: 252faaa26da766102832d975a8f40d52f78532518b56141aa13444e028cf0f83b51d6415298960741976a8829ad0bfeb13bbb02bba022f32ca1733732c0b3ef2
|
data/README.md
CHANGED
|
@@ -458,6 +458,7 @@ Class | Method | HTTP request | Description
|
|
|
458
458
|
*Zernio::TwitterEngagementApi* | [**follow_user**](docs/TwitterEngagementApi.md#follow_user) | **POST** /v1/twitter/follow | Follow a user
|
|
459
459
|
*Zernio::TwitterEngagementApi* | [**remove_bookmark**](docs/TwitterEngagementApi.md#remove_bookmark) | **DELETE** /v1/twitter/bookmark | Remove bookmark
|
|
460
460
|
*Zernio::TwitterEngagementApi* | [**retweet_post**](docs/TwitterEngagementApi.md#retweet_post) | **POST** /v1/twitter/retweet | Retweet a post
|
|
461
|
+
*Zernio::TwitterEngagementApi* | [**search_tweets**](docs/TwitterEngagementApi.md#search_tweets) | **GET** /v1/twitter/search | Search recent tweets
|
|
461
462
|
*Zernio::TwitterEngagementApi* | [**undo_retweet**](docs/TwitterEngagementApi.md#undo_retweet) | **DELETE** /v1/twitter/retweet | Undo retweet
|
|
462
463
|
*Zernio::TwitterEngagementApi* | [**unfollow_user**](docs/TwitterEngagementApi.md#unfollow_user) | **DELETE** /v1/twitter/follow | Unfollow a user
|
|
463
464
|
*Zernio::UsageApi* | [**get_billing**](docs/UsageApi.md#get_billing) | **GET** /v1/billing | Account billing snapshot (plan, cycle, balance, caps, status)
|
|
@@ -1653,6 +1654,10 @@ Class | Method | HTTP request | Description
|
|
|
1653
1654
|
- [Zernio::SearchInboxConversations200ResponseMetaAccountsSkippedInner](docs/SearchInboxConversations200ResponseMetaAccountsSkippedInner.md)
|
|
1654
1655
|
- [Zernio::SearchInboxConversations200ResponseMetaFailedAccountsInner](docs/SearchInboxConversations200ResponseMetaFailedAccountsInner.md)
|
|
1655
1656
|
- [Zernio::SearchReddit200Response](docs/SearchReddit200Response.md)
|
|
1657
|
+
- [Zernio::SearchTweets200Response](docs/SearchTweets200Response.md)
|
|
1658
|
+
- [Zernio::SearchTweets200ResponseMeta](docs/SearchTweets200ResponseMeta.md)
|
|
1659
|
+
- [Zernio::SearchTweets200ResponseTweetsInner](docs/SearchTweets200ResponseTweetsInner.md)
|
|
1660
|
+
- [Zernio::SearchTweets200ResponseTweetsInnerAuthor](docs/SearchTweets200ResponseTweetsInnerAuthor.md)
|
|
1656
1661
|
- [Zernio::SelectFacebookPage200Response](docs/SelectFacebookPage200Response.md)
|
|
1657
1662
|
- [Zernio::SelectFacebookPage200ResponseAccount](docs/SelectFacebookPage200ResponseAccount.md)
|
|
1658
1663
|
- [Zernio::SelectFacebookPage409Response](docs/SelectFacebookPage409Response.md)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Zernio::SearchTweets200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **status** | **String** | | [optional] |
|
|
8
|
+
| **tweets** | [**Array<SearchTweets200ResponseTweetsInner>**](SearchTweets200ResponseTweetsInner.md) | | [optional] |
|
|
9
|
+
| **pagination** | [**GetInboxPostComments200ResponsePagination**](GetInboxPostComments200ResponsePagination.md) | | [optional] |
|
|
10
|
+
| **meta** | [**SearchTweets200ResponseMeta**](SearchTweets200ResponseMeta.md) | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'zernio-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Zernio::SearchTweets200Response.new(
|
|
18
|
+
status: success,
|
|
19
|
+
tweets: null,
|
|
20
|
+
pagination: null,
|
|
21
|
+
meta: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Zernio::SearchTweets200ResponseMeta
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **result_count** | **Integer** | | [optional] |
|
|
8
|
+
| **newest_id** | **String** | | [optional] |
|
|
9
|
+
| **oldest_id** | **String** | | [optional] |
|
|
10
|
+
| **platform** | **String** | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'zernio-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Zernio::SearchTweets200ResponseMeta.new(
|
|
18
|
+
result_count: null,
|
|
19
|
+
newest_id: null,
|
|
20
|
+
oldest_id: null,
|
|
21
|
+
platform: twitter
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Zernio::SearchTweets200ResponseTweetsInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | | [optional] |
|
|
8
|
+
| **text** | **String** | | [optional] |
|
|
9
|
+
| **created** | **Time** | | [optional] |
|
|
10
|
+
| **conversation_id** | **String** | | [optional] |
|
|
11
|
+
| **in_reply_to_tweet_id** | **String** | Parent tweet ID when the result is itself a reply | [optional] |
|
|
12
|
+
| **lang** | **String** | | [optional] |
|
|
13
|
+
| **author** | [**SearchTweets200ResponseTweetsInnerAuthor**](SearchTweets200ResponseTweetsInnerAuthor.md) | | [optional] |
|
|
14
|
+
| **like_count** | **Integer** | | [optional] |
|
|
15
|
+
| **reply_count** | **Integer** | | [optional] |
|
|
16
|
+
| **retweet_count** | **Integer** | | [optional] |
|
|
17
|
+
| **quote_count** | **Integer** | | [optional] |
|
|
18
|
+
| **platform** | **String** | | [optional] |
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
|
|
22
|
+
```ruby
|
|
23
|
+
require 'zernio-sdk'
|
|
24
|
+
|
|
25
|
+
instance = Zernio::SearchTweets200ResponseTweetsInner.new(
|
|
26
|
+
id: null,
|
|
27
|
+
text: null,
|
|
28
|
+
created: null,
|
|
29
|
+
conversation_id: null,
|
|
30
|
+
in_reply_to_tweet_id: null,
|
|
31
|
+
lang: null,
|
|
32
|
+
author: null,
|
|
33
|
+
like_count: null,
|
|
34
|
+
reply_count: null,
|
|
35
|
+
retweet_count: null,
|
|
36
|
+
quote_count: null,
|
|
37
|
+
platform: twitter
|
|
38
|
+
)
|
|
39
|
+
```
|
|
40
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Zernio::SearchTweets200ResponseTweetsInnerAuthor
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | | [optional] |
|
|
8
|
+
| **username** | **String** | | [optional] |
|
|
9
|
+
| **display_name** | **String** | | [optional] |
|
|
10
|
+
| **avatar** | **String** | | [optional] |
|
|
11
|
+
| **verified_type** | **String** | | [optional] |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'zernio-sdk'
|
|
17
|
+
|
|
18
|
+
instance = Zernio::SearchTweets200ResponseTweetsInnerAuthor.new(
|
|
19
|
+
id: null,
|
|
20
|
+
username: null,
|
|
21
|
+
display_name: null,
|
|
22
|
+
avatar: null,
|
|
23
|
+
verified_type: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
|
@@ -8,6 +8,7 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
8
8
|
| [**follow_user**](TwitterEngagementApi.md#follow_user) | **POST** /v1/twitter/follow | Follow a user |
|
|
9
9
|
| [**remove_bookmark**](TwitterEngagementApi.md#remove_bookmark) | **DELETE** /v1/twitter/bookmark | Remove bookmark |
|
|
10
10
|
| [**retweet_post**](TwitterEngagementApi.md#retweet_post) | **POST** /v1/twitter/retweet | Retweet a post |
|
|
11
|
+
| [**search_tweets**](TwitterEngagementApi.md#search_tweets) | **GET** /v1/twitter/search | Search recent tweets |
|
|
11
12
|
| [**undo_retweet**](TwitterEngagementApi.md#undo_retweet) | **DELETE** /v1/twitter/retweet | Undo retweet |
|
|
12
13
|
| [**unfollow_user**](TwitterEngagementApi.md#unfollow_user) | **DELETE** /v1/twitter/follow | Unfollow a user |
|
|
13
14
|
|
|
@@ -290,6 +291,93 @@ end
|
|
|
290
291
|
- **Accept**: application/json
|
|
291
292
|
|
|
292
293
|
|
|
294
|
+
## search_tweets
|
|
295
|
+
|
|
296
|
+
> <SearchTweets200Response> search_tweets(account_id, query, opts)
|
|
297
|
+
|
|
298
|
+
Search recent tweets
|
|
299
|
+
|
|
300
|
+
Search public tweets from the last 7 days matching an X search query, e.g. to discover tweets to reply to. The query string is passed through to X unchanged and supports X's search operators (`from:user`, `-is:retweet`, `is:reply`, `lang:en`, `\"exact phrase\"`, `conversation_id:123`, boolean `OR`, ...). Note that standalone operators like `is:` / `has:` / `lang:` must be combined with a keyword or `from:` clause. To reply to a found tweet, pass its `id` as the twitter platform entry's `platformSpecificData.replyToTweetId` when creating a post. Rate limit: 300 requests per 15-min window per connected account.
|
|
301
|
+
|
|
302
|
+
### Examples
|
|
303
|
+
|
|
304
|
+
```ruby
|
|
305
|
+
require 'time'
|
|
306
|
+
require 'zernio-sdk'
|
|
307
|
+
# setup authorization
|
|
308
|
+
Zernio.configure do |config|
|
|
309
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
310
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
api_instance = Zernio::TwitterEngagementApi.new
|
|
314
|
+
account_id = 'account_id_example' # String | The social account ID
|
|
315
|
+
query = 'query_example' # String | X search query, max 512 characters. Operators are passed through unchanged; X rejects malformed queries with a 400.
|
|
316
|
+
opts = {
|
|
317
|
+
limit: 56, # Integer | Results per page. X requires a minimum of 10; values below 10 are rejected.
|
|
318
|
+
since_id: 'since_id_example', # String | Only return tweets with an ID greater than (more recent than) this numeric tweet ID. Non-numeric values are rejected with 400.
|
|
319
|
+
until_id: 'until_id_example', # String | Only return tweets with an ID less than (older than) this numeric tweet ID. Non-numeric values are rejected with 400.
|
|
320
|
+
start_time: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Oldest UTC timestamp (ISO 8601, inclusive), within the last 7 days
|
|
321
|
+
end_time: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Newest UTC timestamp (ISO 8601, exclusive), within the last 7 days
|
|
322
|
+
cursor: 'cursor_example', # String | Pagination cursor from a previous response
|
|
323
|
+
sort_order: 'recency' # String |
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
begin
|
|
327
|
+
# Search recent tweets
|
|
328
|
+
result = api_instance.search_tweets(account_id, query, opts)
|
|
329
|
+
p result
|
|
330
|
+
rescue Zernio::ApiError => e
|
|
331
|
+
puts "Error when calling TwitterEngagementApi->search_tweets: #{e}"
|
|
332
|
+
end
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
#### Using the search_tweets_with_http_info variant
|
|
336
|
+
|
|
337
|
+
This returns an Array which contains the response data, status code and headers.
|
|
338
|
+
|
|
339
|
+
> <Array(<SearchTweets200Response>, Integer, Hash)> search_tweets_with_http_info(account_id, query, opts)
|
|
340
|
+
|
|
341
|
+
```ruby
|
|
342
|
+
begin
|
|
343
|
+
# Search recent tweets
|
|
344
|
+
data, status_code, headers = api_instance.search_tweets_with_http_info(account_id, query, opts)
|
|
345
|
+
p status_code # => 2xx
|
|
346
|
+
p headers # => { ... }
|
|
347
|
+
p data # => <SearchTweets200Response>
|
|
348
|
+
rescue Zernio::ApiError => e
|
|
349
|
+
puts "Error when calling TwitterEngagementApi->search_tweets_with_http_info: #{e}"
|
|
350
|
+
end
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Parameters
|
|
354
|
+
|
|
355
|
+
| Name | Type | Description | Notes |
|
|
356
|
+
| ---- | ---- | ----------- | ----- |
|
|
357
|
+
| **account_id** | **String** | The social account ID | |
|
|
358
|
+
| **query** | **String** | X search query, max 512 characters. Operators are passed through unchanged; X rejects malformed queries with a 400. | |
|
|
359
|
+
| **limit** | **Integer** | Results per page. X requires a minimum of 10; values below 10 are rejected. | [optional][default to 10] |
|
|
360
|
+
| **since_id** | **String** | Only return tweets with an ID greater than (more recent than) this numeric tweet ID. Non-numeric values are rejected with 400. | [optional] |
|
|
361
|
+
| **until_id** | **String** | Only return tweets with an ID less than (older than) this numeric tweet ID. Non-numeric values are rejected with 400. | [optional] |
|
|
362
|
+
| **start_time** | **Time** | Oldest UTC timestamp (ISO 8601, inclusive), within the last 7 days | [optional] |
|
|
363
|
+
| **end_time** | **Time** | Newest UTC timestamp (ISO 8601, exclusive), within the last 7 days | [optional] |
|
|
364
|
+
| **cursor** | **String** | Pagination cursor from a previous response | [optional] |
|
|
365
|
+
| **sort_order** | **String** | | [optional][default to 'recency'] |
|
|
366
|
+
|
|
367
|
+
### Return type
|
|
368
|
+
|
|
369
|
+
[**SearchTweets200Response**](SearchTweets200Response.md)
|
|
370
|
+
|
|
371
|
+
### Authorization
|
|
372
|
+
|
|
373
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
374
|
+
|
|
375
|
+
### HTTP request headers
|
|
376
|
+
|
|
377
|
+
- **Content-Type**: Not defined
|
|
378
|
+
- **Accept**: application/json
|
|
379
|
+
|
|
380
|
+
|
|
293
381
|
## undo_retweet
|
|
294
382
|
|
|
295
383
|
> <UndoRetweet200Response> undo_retweet(account_id, tweet_id)
|
|
@@ -294,6 +294,128 @@ module Zernio
|
|
|
294
294
|
return data, status_code, headers
|
|
295
295
|
end
|
|
296
296
|
|
|
297
|
+
# Search recent tweets
|
|
298
|
+
# Search public tweets from the last 7 days matching an X search query, e.g. to discover tweets to reply to. The query string is passed through to X unchanged and supports X's search operators (`from:user`, `-is:retweet`, `is:reply`, `lang:en`, `\"exact phrase\"`, `conversation_id:123`, boolean `OR`, ...). Note that standalone operators like `is:` / `has:` / `lang:` must be combined with a keyword or `from:` clause. To reply to a found tweet, pass its `id` as the twitter platform entry's `platformSpecificData.replyToTweetId` when creating a post. Rate limit: 300 requests per 15-min window per connected account.
|
|
299
|
+
# @param account_id [String] The social account ID
|
|
300
|
+
# @param query [String] X search query, max 512 characters. Operators are passed through unchanged; X rejects malformed queries with a 400.
|
|
301
|
+
# @param [Hash] opts the optional parameters
|
|
302
|
+
# @option opts [Integer] :limit Results per page. X requires a minimum of 10; values below 10 are rejected. (default to 10)
|
|
303
|
+
# @option opts [String] :since_id Only return tweets with an ID greater than (more recent than) this numeric tweet ID. Non-numeric values are rejected with 400.
|
|
304
|
+
# @option opts [String] :until_id Only return tweets with an ID less than (older than) this numeric tweet ID. Non-numeric values are rejected with 400.
|
|
305
|
+
# @option opts [Time] :start_time Oldest UTC timestamp (ISO 8601, inclusive), within the last 7 days
|
|
306
|
+
# @option opts [Time] :end_time Newest UTC timestamp (ISO 8601, exclusive), within the last 7 days
|
|
307
|
+
# @option opts [String] :cursor Pagination cursor from a previous response
|
|
308
|
+
# @option opts [String] :sort_order (default to 'recency')
|
|
309
|
+
# @return [SearchTweets200Response]
|
|
310
|
+
def search_tweets(account_id, query, opts = {})
|
|
311
|
+
data, _status_code, _headers = search_tweets_with_http_info(account_id, query, opts)
|
|
312
|
+
data
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
# Search recent tweets
|
|
316
|
+
# Search public tweets from the last 7 days matching an X search query, e.g. to discover tweets to reply to. The query string is passed through to X unchanged and supports X's search operators (`from:user`, `-is:retweet`, `is:reply`, `lang:en`, `\"exact phrase\"`, `conversation_id:123`, boolean `OR`, ...). Note that standalone operators like `is:` / `has:` / `lang:` must be combined with a keyword or `from:` clause. To reply to a found tweet, pass its `id` as the twitter platform entry's `platformSpecificData.replyToTweetId` when creating a post. Rate limit: 300 requests per 15-min window per connected account.
|
|
317
|
+
# @param account_id [String] The social account ID
|
|
318
|
+
# @param query [String] X search query, max 512 characters. Operators are passed through unchanged; X rejects malformed queries with a 400.
|
|
319
|
+
# @param [Hash] opts the optional parameters
|
|
320
|
+
# @option opts [Integer] :limit Results per page. X requires a minimum of 10; values below 10 are rejected. (default to 10)
|
|
321
|
+
# @option opts [String] :since_id Only return tweets with an ID greater than (more recent than) this numeric tweet ID. Non-numeric values are rejected with 400.
|
|
322
|
+
# @option opts [String] :until_id Only return tweets with an ID less than (older than) this numeric tweet ID. Non-numeric values are rejected with 400.
|
|
323
|
+
# @option opts [Time] :start_time Oldest UTC timestamp (ISO 8601, inclusive), within the last 7 days
|
|
324
|
+
# @option opts [Time] :end_time Newest UTC timestamp (ISO 8601, exclusive), within the last 7 days
|
|
325
|
+
# @option opts [String] :cursor Pagination cursor from a previous response
|
|
326
|
+
# @option opts [String] :sort_order (default to 'recency')
|
|
327
|
+
# @return [Array<(SearchTweets200Response, Integer, Hash)>] SearchTweets200Response data, response status code and response headers
|
|
328
|
+
def search_tweets_with_http_info(account_id, query, opts = {})
|
|
329
|
+
if @api_client.config.debugging
|
|
330
|
+
@api_client.config.logger.debug 'Calling API: TwitterEngagementApi.search_tweets ...'
|
|
331
|
+
end
|
|
332
|
+
# verify the required parameter 'account_id' is set
|
|
333
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
334
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling TwitterEngagementApi.search_tweets"
|
|
335
|
+
end
|
|
336
|
+
# verify the required parameter 'query' is set
|
|
337
|
+
if @api_client.config.client_side_validation && query.nil?
|
|
338
|
+
fail ArgumentError, "Missing the required parameter 'query' when calling TwitterEngagementApi.search_tweets"
|
|
339
|
+
end
|
|
340
|
+
if @api_client.config.client_side_validation && query.to_s.length > 512
|
|
341
|
+
fail ArgumentError, 'invalid value for "query" when calling TwitterEngagementApi.search_tweets, the character length must be smaller than or equal to 512.'
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
if @api_client.config.client_side_validation && query.to_s.length < 1
|
|
345
|
+
fail ArgumentError, 'invalid value for "query" when calling TwitterEngagementApi.search_tweets, the character length must be greater than or equal to 1.'
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
349
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TwitterEngagementApi.search_tweets, must be smaller than or equal to 100.'
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 10
|
|
353
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TwitterEngagementApi.search_tweets, must be greater than or equal to 10.'
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
pattern = Regexp.new(/^[0-9]{1,19}$/)
|
|
357
|
+
if @api_client.config.client_side_validation && !opts[:'since_id'].nil? && opts[:'since_id'] !~ pattern
|
|
358
|
+
fail ArgumentError, "invalid value for 'opts[:\"since_id\"]' when calling TwitterEngagementApi.search_tweets, must conform to the pattern #{pattern}."
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
pattern = Regexp.new(/^[0-9]{1,19}$/)
|
|
362
|
+
if @api_client.config.client_side_validation && !opts[:'until_id'].nil? && opts[:'until_id'] !~ pattern
|
|
363
|
+
fail ArgumentError, "invalid value for 'opts[:\"until_id\"]' when calling TwitterEngagementApi.search_tweets, must conform to the pattern #{pattern}."
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
allowable_values = ["recency", "relevancy"]
|
|
367
|
+
if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order'])
|
|
368
|
+
fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}"
|
|
369
|
+
end
|
|
370
|
+
# resource path
|
|
371
|
+
local_var_path = '/v1/twitter/search'
|
|
372
|
+
|
|
373
|
+
# query parameters
|
|
374
|
+
query_params = opts[:query_params] || {}
|
|
375
|
+
query_params[:'accountId'] = account_id
|
|
376
|
+
query_params[:'query'] = query
|
|
377
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
378
|
+
query_params[:'sinceId'] = opts[:'since_id'] if !opts[:'since_id'].nil?
|
|
379
|
+
query_params[:'untilId'] = opts[:'until_id'] if !opts[:'until_id'].nil?
|
|
380
|
+
query_params[:'startTime'] = opts[:'start_time'] if !opts[:'start_time'].nil?
|
|
381
|
+
query_params[:'endTime'] = opts[:'end_time'] if !opts[:'end_time'].nil?
|
|
382
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
383
|
+
query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
|
|
384
|
+
|
|
385
|
+
# header parameters
|
|
386
|
+
header_params = opts[:header_params] || {}
|
|
387
|
+
# HTTP header 'Accept' (if needed)
|
|
388
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
389
|
+
|
|
390
|
+
# form parameters
|
|
391
|
+
form_params = opts[:form_params] || {}
|
|
392
|
+
|
|
393
|
+
# http body (model)
|
|
394
|
+
post_body = opts[:debug_body]
|
|
395
|
+
|
|
396
|
+
# return_type
|
|
397
|
+
return_type = opts[:debug_return_type] || 'SearchTweets200Response'
|
|
398
|
+
|
|
399
|
+
# auth_names
|
|
400
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
401
|
+
|
|
402
|
+
new_options = opts.merge(
|
|
403
|
+
:operation => :"TwitterEngagementApi.search_tweets",
|
|
404
|
+
:header_params => header_params,
|
|
405
|
+
:query_params => query_params,
|
|
406
|
+
:form_params => form_params,
|
|
407
|
+
:body => post_body,
|
|
408
|
+
:auth_names => auth_names,
|
|
409
|
+
:return_type => return_type
|
|
410
|
+
)
|
|
411
|
+
|
|
412
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
413
|
+
if @api_client.config.debugging
|
|
414
|
+
@api_client.config.logger.debug "API called: TwitterEngagementApi#search_tweets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
415
|
+
end
|
|
416
|
+
return data, status_code, headers
|
|
417
|
+
end
|
|
418
|
+
|
|
297
419
|
# Undo retweet
|
|
298
420
|
# Undo a retweet (un-repost a tweet).
|
|
299
421
|
# @param account_id [String]
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class SearchTweets200Response < ApiModelBase
|
|
18
|
+
attr_accessor :status
|
|
19
|
+
|
|
20
|
+
attr_accessor :tweets
|
|
21
|
+
|
|
22
|
+
attr_accessor :pagination
|
|
23
|
+
|
|
24
|
+
attr_accessor :meta
|
|
25
|
+
|
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
|
+
def self.attribute_map
|
|
28
|
+
{
|
|
29
|
+
:'status' => :'status',
|
|
30
|
+
:'tweets' => :'tweets',
|
|
31
|
+
:'pagination' => :'pagination',
|
|
32
|
+
:'meta' => :'meta'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'status' => :'String',
|
|
50
|
+
:'tweets' => :'Array<SearchTweets200ResponseTweetsInner>',
|
|
51
|
+
:'pagination' => :'GetInboxPostComments200ResponsePagination',
|
|
52
|
+
:'meta' => :'SearchTweets200ResponseMeta'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SearchTweets200Response` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SearchTweets200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'status')
|
|
79
|
+
self.status = attributes[:'status']
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'tweets')
|
|
83
|
+
if (value = attributes[:'tweets']).is_a?(Array)
|
|
84
|
+
self.tweets = value
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'pagination')
|
|
89
|
+
self.pagination = attributes[:'pagination']
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'meta')
|
|
93
|
+
self.meta = attributes[:'meta']
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
98
|
+
# @return Array for valid properties with the reasons
|
|
99
|
+
def list_invalid_properties
|
|
100
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
101
|
+
invalid_properties = Array.new
|
|
102
|
+
invalid_properties
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Check to see if the all the properties in the model are valid
|
|
106
|
+
# @return true if the model is valid
|
|
107
|
+
def valid?
|
|
108
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
109
|
+
true
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Checks equality by comparing each attribute.
|
|
113
|
+
# @param [Object] Object to be compared
|
|
114
|
+
def ==(o)
|
|
115
|
+
return true if self.equal?(o)
|
|
116
|
+
self.class == o.class &&
|
|
117
|
+
status == o.status &&
|
|
118
|
+
tweets == o.tweets &&
|
|
119
|
+
pagination == o.pagination &&
|
|
120
|
+
meta == o.meta
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# @see the `==` method
|
|
124
|
+
# @param [Object] Object to be compared
|
|
125
|
+
def eql?(o)
|
|
126
|
+
self == o
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Calculates hash code according to all attributes.
|
|
130
|
+
# @return [Integer] Hash code
|
|
131
|
+
def hash
|
|
132
|
+
[status, tweets, pagination, meta].hash
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Builds the object from hash
|
|
136
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
137
|
+
# @return [Object] Returns the model itself
|
|
138
|
+
def self.build_from_hash(attributes)
|
|
139
|
+
return nil unless attributes.is_a?(Hash)
|
|
140
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
141
|
+
transformed_hash = {}
|
|
142
|
+
openapi_types.each_pair do |key, type|
|
|
143
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
144
|
+
transformed_hash["#{key}"] = nil
|
|
145
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
146
|
+
# check to ensure the input is an array given that the attribute
|
|
147
|
+
# is documented as an array but the input is not
|
|
148
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
149
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
150
|
+
end
|
|
151
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
152
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
new(transformed_hash)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Returns the object in the form of hash
|
|
159
|
+
# @return [Hash] Returns the object in the form of hash
|
|
160
|
+
def to_hash
|
|
161
|
+
hash = {}
|
|
162
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
163
|
+
value = self.send(attr)
|
|
164
|
+
if value.nil?
|
|
165
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
166
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
hash[param] = _to_hash(value)
|
|
170
|
+
end
|
|
171
|
+
hash
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
end
|