scrapebadger 0.1.0

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.
Files changed (185) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +548 -0
  5. data/Rakefile +10 -0
  6. data/docs/AccountApi.md +76 -0
  7. data/docs/AccountInfo.md +28 -0
  8. data/docs/AmazonApi.md +1244 -0
  9. data/docs/ApartmentsApi.md +373 -0
  10. data/docs/BaiduApi.md +447 -0
  11. data/docs/BillingLogListResponse.md +24 -0
  12. data/docs/BillingLogResponse.md +32 -0
  13. data/docs/BingApi.md +610 -0
  14. data/docs/ChatGPTApi.md +521 -0
  15. data/docs/DepopApi.md +542 -0
  16. data/docs/DuckDuckGoApi.md +700 -0
  17. data/docs/EBayApi.md +1019 -0
  18. data/docs/FacebookApi.md +1671 -0
  19. data/docs/FilterRuleCreate.md +28 -0
  20. data/docs/FilterRuleDeliveryLogListResponse.md +24 -0
  21. data/docs/FilterRuleDeliveryLogResponse.md +44 -0
  22. data/docs/FilterRuleListResponse.md +24 -0
  23. data/docs/FilterRuleResponse.md +40 -0
  24. data/docs/FilterRuleUpdate.md +30 -0
  25. data/docs/FilterRuleValidateRequest.md +18 -0
  26. data/docs/FilterRuleValidateResponse.md +22 -0
  27. data/docs/GoogleApi.md +3175 -0
  28. data/docs/HTTPValidationError.md +18 -0
  29. data/docs/IdealistaApi.md +822 -0
  30. data/docs/ImmobiliareApi.md +773 -0
  31. data/docs/InstagramApi.md +1673 -0
  32. data/docs/LeboncoinApi.md +884 -0
  33. data/docs/LinkedInApi.md +925 -0
  34. data/docs/LoopNetApi.md +529 -0
  35. data/docs/PortalApiRoutersV1TwitterFilterRulesFilterRulePricingResponse.md +20 -0
  36. data/docs/RealtorApi.md +474 -0
  37. data/docs/RedditApi.md +1677 -0
  38. data/docs/RedfinApi.md +616 -0
  39. data/docs/StreamMonitorCreate.md +26 -0
  40. data/docs/StreamMonitorListResponse.md +24 -0
  41. data/docs/StreamMonitorResponse.md +42 -0
  42. data/docs/StreamMonitorUpdate.md +28 -0
  43. data/docs/SubscriptionInfo.md +40 -0
  44. data/docs/TikTokApi.md +2104 -0
  45. data/docs/TweetDeliveryLogListResponse.md +24 -0
  46. data/docs/TweetDeliveryLogResponse.md +44 -0
  47. data/docs/TwitterApi.md +4091 -0
  48. data/docs/ValidationError.md +22 -0
  49. data/docs/ValidationErrorLocInner.md +15 -0
  50. data/docs/VintedApi.md +766 -0
  51. data/docs/WalmartApi.md +904 -0
  52. data/docs/WebApi.md +634 -0
  53. data/docs/WebhookCreate.md +22 -0
  54. data/docs/WebhookListItem.md +28 -0
  55. data/docs/WebhookListResponse.md +20 -0
  56. data/docs/WebhookResponse.md +26 -0
  57. data/docs/WebhookTestRequest.md +18 -0
  58. data/docs/WebhookTestResponse.md +24 -0
  59. data/docs/YahooApi.md +602 -0
  60. data/docs/YandexApi.md +450 -0
  61. data/docs/YouTubeApi.md +2872 -0
  62. data/docs/ZillowApi.md +622 -0
  63. data/git_push.sh +57 -0
  64. data/lib/scrapebadger/api/account_api.rb +79 -0
  65. data/lib/scrapebadger/api/amazon_api.rb +1165 -0
  66. data/lib/scrapebadger/api/apartments_api.rb +377 -0
  67. data/lib/scrapebadger/api/baidu_api.rb +436 -0
  68. data/lib/scrapebadger/api/bing_api.rb +580 -0
  69. data/lib/scrapebadger/api/chat_gpt_api.rb +466 -0
  70. data/lib/scrapebadger/api/depop_api.rb +518 -0
  71. data/lib/scrapebadger/api/duck_duck_go_api.rb +675 -0
  72. data/lib/scrapebadger/api/e_bay_api.rb +1029 -0
  73. data/lib/scrapebadger/api/facebook_api.rb +1492 -0
  74. data/lib/scrapebadger/api/google_api.rb +3191 -0
  75. data/lib/scrapebadger/api/idealista_api.rb +864 -0
  76. data/lib/scrapebadger/api/immobiliare_api.rb +734 -0
  77. data/lib/scrapebadger/api/instagram_api.rb +1555 -0
  78. data/lib/scrapebadger/api/leboncoin_api.rb +818 -0
  79. data/lib/scrapebadger/api/linked_in_api.rb +832 -0
  80. data/lib/scrapebadger/api/loop_net_api.rb +503 -0
  81. data/lib/scrapebadger/api/realtor_api.rb +481 -0
  82. data/lib/scrapebadger/api/reddit_api.rb +1601 -0
  83. data/lib/scrapebadger/api/redfin_api.rb +625 -0
  84. data/lib/scrapebadger/api/tik_tok_api.rb +2029 -0
  85. data/lib/scrapebadger/api/twitter_api.rb +3696 -0
  86. data/lib/scrapebadger/api/vinted_api.rb +705 -0
  87. data/lib/scrapebadger/api/walmart_api.rb +876 -0
  88. data/lib/scrapebadger/api/web_api.rb +547 -0
  89. data/lib/scrapebadger/api/yahoo_api.rb +560 -0
  90. data/lib/scrapebadger/api/yandex_api.rb +422 -0
  91. data/lib/scrapebadger/api/you_tube_api.rb +2520 -0
  92. data/lib/scrapebadger/api/zillow_api.rb +634 -0
  93. data/lib/scrapebadger/api_client.rb +394 -0
  94. data/lib/scrapebadger/api_error.rb +58 -0
  95. data/lib/scrapebadger/configuration.rb +308 -0
  96. data/lib/scrapebadger/models/account_info.rb +288 -0
  97. data/lib/scrapebadger/models/billing_log_list_response.rb +272 -0
  98. data/lib/scrapebadger/models/billing_log_response.rb +334 -0
  99. data/lib/scrapebadger/models/filter_rule_create.rb +427 -0
  100. data/lib/scrapebadger/models/filter_rule_delivery_log_list_response.rb +272 -0
  101. data/lib/scrapebadger/models/filter_rule_delivery_log_response.rb +422 -0
  102. data/lib/scrapebadger/models/filter_rule_list_response.rb +272 -0
  103. data/lib/scrapebadger/models/filter_rule_response.rb +390 -0
  104. data/lib/scrapebadger/models/filter_rule_update.rb +389 -0
  105. data/lib/scrapebadger/models/filter_rule_validate_request.rb +250 -0
  106. data/lib/scrapebadger/models/filter_rule_validate_response.rb +248 -0
  107. data/lib/scrapebadger/models/http_validation_error.rb +216 -0
  108. data/lib/scrapebadger/models/portal_api_routers_v1_twitter_filter_rules_filter_rule_pricing_response.rb +238 -0
  109. data/lib/scrapebadger/models/stream_monitor_create.rb +373 -0
  110. data/lib/scrapebadger/models/stream_monitor_list_response.rb +272 -0
  111. data/lib/scrapebadger/models/stream_monitor_response.rb +406 -0
  112. data/lib/scrapebadger/models/stream_monitor_update.rb +335 -0
  113. data/lib/scrapebadger/models/subscription_info.rb +352 -0
  114. data/lib/scrapebadger/models/tweet_delivery_log_list_response.rb +272 -0
  115. data/lib/scrapebadger/models/tweet_delivery_log_response.rb +422 -0
  116. data/lib/scrapebadger/models/validation_error.rb +255 -0
  117. data/lib/scrapebadger/models/validation_error_loc_inner.rb +104 -0
  118. data/lib/scrapebadger/models/webhook_create.rb +282 -0
  119. data/lib/scrapebadger/models/webhook_list_item.rb +302 -0
  120. data/lib/scrapebadger/models/webhook_list_response.rb +240 -0
  121. data/lib/scrapebadger/models/webhook_response.rb +286 -0
  122. data/lib/scrapebadger/models/webhook_test_request.rb +223 -0
  123. data/lib/scrapebadger/models/webhook_test_response.rb +259 -0
  124. data/lib/scrapebadger/version.rb +15 -0
  125. data/lib/scrapebadger.rb +96 -0
  126. data/scrapebadger.gemspec +39 -0
  127. data/spec/api/account_api_spec.rb +46 -0
  128. data/spec/api/amazon_api_spec.rb +258 -0
  129. data/spec/api/apartments_api_spec.rb +98 -0
  130. data/spec/api/baidu_api_spec.rb +109 -0
  131. data/spec/api/bing_api_spec.rb +141 -0
  132. data/spec/api/chat_gpt_api_spec.rb +123 -0
  133. data/spec/api/depop_api_spec.rb +132 -0
  134. data/spec/api/duck_duck_go_api_spec.rb +162 -0
  135. data/spec/api/e_bay_api_spec.rb +222 -0
  136. data/spec/api/facebook_api_spec.rb +326 -0
  137. data/spec/api/google_api_spec.rb +649 -0
  138. data/spec/api/idealista_api_spec.rb +197 -0
  139. data/spec/api/immobiliare_api_spec.rb +174 -0
  140. data/spec/api/instagram_api_spec.rb +309 -0
  141. data/spec/api/leboncoin_api_spec.rb +184 -0
  142. data/spec/api/linked_in_api_spec.rb +197 -0
  143. data/spec/api/loop_net_api_spec.rb +127 -0
  144. data/spec/api/realtor_api_spec.rb +123 -0
  145. data/spec/api/reddit_api_spec.rb +331 -0
  146. data/spec/api/redfin_api_spec.rb +147 -0
  147. data/spec/api/tik_tok_api_spec.rb +413 -0
  148. data/spec/api/twitter_api_spec.rb +735 -0
  149. data/spec/api/vinted_api_spec.rb +169 -0
  150. data/spec/api/walmart_api_spec.rb +192 -0
  151. data/spec/api/web_api_spec.rb +136 -0
  152. data/spec/api/yahoo_api_spec.rb +137 -0
  153. data/spec/api/yandex_api_spec.rb +111 -0
  154. data/spec/api/you_tube_api_spec.rb +500 -0
  155. data/spec/api/zillow_api_spec.rb +150 -0
  156. data/spec/models/account_info_spec.rb +66 -0
  157. data/spec/models/billing_log_list_response_spec.rb +54 -0
  158. data/spec/models/billing_log_response_spec.rb +78 -0
  159. data/spec/models/filter_rule_create_spec.rb +66 -0
  160. data/spec/models/filter_rule_delivery_log_list_response_spec.rb +54 -0
  161. data/spec/models/filter_rule_delivery_log_response_spec.rb +114 -0
  162. data/spec/models/filter_rule_list_response_spec.rb +54 -0
  163. data/spec/models/filter_rule_response_spec.rb +102 -0
  164. data/spec/models/filter_rule_update_spec.rb +72 -0
  165. data/spec/models/filter_rule_validate_request_spec.rb +36 -0
  166. data/spec/models/filter_rule_validate_response_spec.rb +48 -0
  167. data/spec/models/http_validation_error_spec.rb +36 -0
  168. data/spec/models/portal_api_routers_v1_twitter_filter_rules_filter_rule_pricing_response_spec.rb +42 -0
  169. data/spec/models/stream_monitor_create_spec.rb +60 -0
  170. data/spec/models/stream_monitor_list_response_spec.rb +54 -0
  171. data/spec/models/stream_monitor_response_spec.rb +108 -0
  172. data/spec/models/stream_monitor_update_spec.rb +66 -0
  173. data/spec/models/subscription_info_spec.rb +102 -0
  174. data/spec/models/tweet_delivery_log_list_response_spec.rb +54 -0
  175. data/spec/models/tweet_delivery_log_response_spec.rb +114 -0
  176. data/spec/models/validation_error_loc_inner_spec.rb +21 -0
  177. data/spec/models/validation_error_spec.rb +48 -0
  178. data/spec/models/webhook_create_spec.rb +48 -0
  179. data/spec/models/webhook_list_item_spec.rb +66 -0
  180. data/spec/models/webhook_list_response_spec.rb +42 -0
  181. data/spec/models/webhook_response_spec.rb +60 -0
  182. data/spec/models/webhook_test_request_spec.rb +36 -0
  183. data/spec/models/webhook_test_response_spec.rb +54 -0
  184. data/spec/spec_helper.rb +111 -0
  185. metadata +324 -0
@@ -0,0 +1,3696 @@
1
+ =begin
2
+ #ScrapeBadger API
3
+
4
+ #Unified credit-based scraping API. https://docs.scrapebadger.com
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module ScrapeBadger
16
+ class TwitterApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Advanced tweet search
23
+ # Search tweets with advanced options.
24
+ # @param query [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :query_type
27
+ # @option opts [Integer] :count
28
+ # @option opts [String] :cursor
29
+ # @return [Object]
30
+ def twitter_advanced_tweet_search(query, opts = {})
31
+ data, _status_code, _headers = twitter_advanced_tweet_search_with_http_info(query, opts)
32
+ data
33
+ end
34
+
35
+ # Advanced tweet search
36
+ # Search tweets with advanced options.
37
+ # @param query [String]
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :query_type
40
+ # @option opts [Integer] :count
41
+ # @option opts [String] :cursor
42
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
43
+ def twitter_advanced_tweet_search_with_http_info(query, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_advanced_tweet_search ...'
46
+ end
47
+ # verify the required parameter 'query' is set
48
+ if @api_client.config.client_side_validation && query.nil?
49
+ fail ArgumentError, "Missing the required parameter 'query' when calling TwitterApi.twitter_advanced_tweet_search"
50
+ end
51
+ # resource path
52
+ local_var_path = '/v1/twitter/tweets/advanced_search'
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+ query_params[:'query'] = query
57
+ query_params[:'query_type'] = opts[:'query_type'] if !opts[:'query_type'].nil?
58
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
59
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
60
+
61
+ # header parameters
62
+ header_params = opts[:header_params] || {}
63
+ # HTTP header 'Accept' (if needed)
64
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
65
+
66
+ # form parameters
67
+ form_params = opts[:form_params] || {}
68
+
69
+ # http body (model)
70
+ post_body = opts[:debug_body]
71
+
72
+ # return_type
73
+ return_type = opts[:debug_return_type] || 'Object'
74
+
75
+ # auth_names
76
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
77
+
78
+ new_options = opts.merge(
79
+ :operation => :"TwitterApi.twitter_advanced_tweet_search",
80
+ :header_params => header_params,
81
+ :query_params => query_params,
82
+ :form_params => form_params,
83
+ :body => post_body,
84
+ :auth_names => auth_names,
85
+ :return_type => return_type
86
+ )
87
+
88
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
89
+ if @api_client.config.debugging
90
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_advanced_tweet_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
91
+ end
92
+ return data, status_code, headers
93
+ end
94
+
95
+ # Batch get users by IDs
96
+ # Get multiple user profiles by their numeric IDs (comma-separated).
97
+ # @param user_ids [String]
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [Object]
100
+ def twitter_batch_get_users_by_ids(user_ids, opts = {})
101
+ data, _status_code, _headers = twitter_batch_get_users_by_ids_with_http_info(user_ids, opts)
102
+ data
103
+ end
104
+
105
+ # Batch get users by IDs
106
+ # Get multiple user profiles by their numeric IDs (comma-separated).
107
+ # @param user_ids [String]
108
+ # @param [Hash] opts the optional parameters
109
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
110
+ def twitter_batch_get_users_by_ids_with_http_info(user_ids, opts = {})
111
+ if @api_client.config.debugging
112
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_batch_get_users_by_ids ...'
113
+ end
114
+ # verify the required parameter 'user_ids' is set
115
+ if @api_client.config.client_side_validation && user_ids.nil?
116
+ fail ArgumentError, "Missing the required parameter 'user_ids' when calling TwitterApi.twitter_batch_get_users_by_ids"
117
+ end
118
+ # resource path
119
+ local_var_path = '/v1/twitter/users/batch_by_ids'
120
+
121
+ # query parameters
122
+ query_params = opts[:query_params] || {}
123
+ query_params[:'user_ids'] = user_ids
124
+
125
+ # header parameters
126
+ header_params = opts[:header_params] || {}
127
+ # HTTP header 'Accept' (if needed)
128
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
129
+
130
+ # form parameters
131
+ form_params = opts[:form_params] || {}
132
+
133
+ # http body (model)
134
+ post_body = opts[:debug_body]
135
+
136
+ # return_type
137
+ return_type = opts[:debug_return_type] || 'Object'
138
+
139
+ # auth_names
140
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
141
+
142
+ new_options = opts.merge(
143
+ :operation => :"TwitterApi.twitter_batch_get_users_by_ids",
144
+ :header_params => header_params,
145
+ :query_params => query_params,
146
+ :form_params => form_params,
147
+ :body => post_body,
148
+ :auth_names => auth_names,
149
+ :return_type => return_type
150
+ )
151
+
152
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
153
+ if @api_client.config.debugging
154
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_batch_get_users_by_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
155
+ end
156
+ return data, status_code, headers
157
+ end
158
+
159
+ # Batch get users by usernames
160
+ # Get multiple user profiles by their usernames (comma-separated).
161
+ # @param usernames [String]
162
+ # @param [Hash] opts the optional parameters
163
+ # @return [Object]
164
+ def twitter_batch_get_users_by_usernames(usernames, opts = {})
165
+ data, _status_code, _headers = twitter_batch_get_users_by_usernames_with_http_info(usernames, opts)
166
+ data
167
+ end
168
+
169
+ # Batch get users by usernames
170
+ # Get multiple user profiles by their usernames (comma-separated).
171
+ # @param usernames [String]
172
+ # @param [Hash] opts the optional parameters
173
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
174
+ def twitter_batch_get_users_by_usernames_with_http_info(usernames, opts = {})
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_batch_get_users_by_usernames ...'
177
+ end
178
+ # verify the required parameter 'usernames' is set
179
+ if @api_client.config.client_side_validation && usernames.nil?
180
+ fail ArgumentError, "Missing the required parameter 'usernames' when calling TwitterApi.twitter_batch_get_users_by_usernames"
181
+ end
182
+ # resource path
183
+ local_var_path = '/v1/twitter/users/batch_by_usernames'
184
+
185
+ # query parameters
186
+ query_params = opts[:query_params] || {}
187
+ query_params[:'usernames'] = usernames
188
+
189
+ # header parameters
190
+ header_params = opts[:header_params] || {}
191
+ # HTTP header 'Accept' (if needed)
192
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
193
+
194
+ # form parameters
195
+ form_params = opts[:form_params] || {}
196
+
197
+ # http body (model)
198
+ post_body = opts[:debug_body]
199
+
200
+ # return_type
201
+ return_type = opts[:debug_return_type] || 'Object'
202
+
203
+ # auth_names
204
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
205
+
206
+ new_options = opts.merge(
207
+ :operation => :"TwitterApi.twitter_batch_get_users_by_usernames",
208
+ :header_params => header_params,
209
+ :query_params => query_params,
210
+ :form_params => form_params,
211
+ :body => post_body,
212
+ :auth_names => auth_names,
213
+ :return_type => return_type
214
+ )
215
+
216
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
217
+ if @api_client.config.debugging
218
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_batch_get_users_by_usernames\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
219
+ end
220
+ return data, status_code, headers
221
+ end
222
+
223
+ # Configure webhook on a monitor
224
+ # Configure a webhook delivery URL on a stream monitor. The secret is returned only once on creation. Subsequent calls show secret_set: bool. If monitor already has a webhook, delete it first (409 is returned).
225
+ # @param webhook_create [WebhookCreate]
226
+ # @param [Hash] opts the optional parameters
227
+ # @return [WebhookResponse]
228
+ def twitter_configure_webhook_on_a_monitor(webhook_create, opts = {})
229
+ data, _status_code, _headers = twitter_configure_webhook_on_a_monitor_with_http_info(webhook_create, opts)
230
+ data
231
+ end
232
+
233
+ # Configure webhook on a monitor
234
+ # Configure a webhook delivery URL on a stream monitor. The secret is returned only once on creation. Subsequent calls show secret_set: bool. If monitor already has a webhook, delete it first (409 is returned).
235
+ # @param webhook_create [WebhookCreate]
236
+ # @param [Hash] opts the optional parameters
237
+ # @return [Array<(WebhookResponse, Integer, Hash)>] WebhookResponse data, response status code and response headers
238
+ def twitter_configure_webhook_on_a_monitor_with_http_info(webhook_create, opts = {})
239
+ if @api_client.config.debugging
240
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_configure_webhook_on_a_monitor ...'
241
+ end
242
+ # verify the required parameter 'webhook_create' is set
243
+ if @api_client.config.client_side_validation && webhook_create.nil?
244
+ fail ArgumentError, "Missing the required parameter 'webhook_create' when calling TwitterApi.twitter_configure_webhook_on_a_monitor"
245
+ end
246
+ # resource path
247
+ local_var_path = '/v1/twitter/stream/webhooks'
248
+
249
+ # query parameters
250
+ query_params = opts[:query_params] || {}
251
+
252
+ # header parameters
253
+ header_params = opts[:header_params] || {}
254
+ # HTTP header 'Accept' (if needed)
255
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
256
+ # HTTP header 'Content-Type'
257
+ content_type = @api_client.select_header_content_type(['application/json'])
258
+ if !content_type.nil?
259
+ header_params['Content-Type'] = content_type
260
+ end
261
+
262
+ # form parameters
263
+ form_params = opts[:form_params] || {}
264
+
265
+ # http body (model)
266
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_create)
267
+
268
+ # return_type
269
+ return_type = opts[:debug_return_type] || 'WebhookResponse'
270
+
271
+ # auth_names
272
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
273
+
274
+ new_options = opts.merge(
275
+ :operation => :"TwitterApi.twitter_configure_webhook_on_a_monitor",
276
+ :header_params => header_params,
277
+ :query_params => query_params,
278
+ :form_params => form_params,
279
+ :body => post_body,
280
+ :auth_names => auth_names,
281
+ :return_type => return_type
282
+ )
283
+
284
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
285
+ if @api_client.config.debugging
286
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_configure_webhook_on_a_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
287
+ end
288
+ return data, status_code, headers
289
+ end
290
+
291
+ # Create filter rule
292
+ # Create a new query-based tweet filter rule. The rule starts in 'active' status immediately. Credits must be positive. The (api_key_id, tag) pair must be unique.
293
+ # @param filter_rule_create [FilterRuleCreate]
294
+ # @param [Hash] opts the optional parameters
295
+ # @return [FilterRuleResponse]
296
+ def twitter_create_filter_rule(filter_rule_create, opts = {})
297
+ data, _status_code, _headers = twitter_create_filter_rule_with_http_info(filter_rule_create, opts)
298
+ data
299
+ end
300
+
301
+ # Create filter rule
302
+ # Create a new query-based tweet filter rule. The rule starts in &#39;active&#39; status immediately. Credits must be positive. The (api_key_id, tag) pair must be unique.
303
+ # @param filter_rule_create [FilterRuleCreate]
304
+ # @param [Hash] opts the optional parameters
305
+ # @return [Array<(FilterRuleResponse, Integer, Hash)>] FilterRuleResponse data, response status code and response headers
306
+ def twitter_create_filter_rule_with_http_info(filter_rule_create, opts = {})
307
+ if @api_client.config.debugging
308
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_create_filter_rule ...'
309
+ end
310
+ # verify the required parameter 'filter_rule_create' is set
311
+ if @api_client.config.client_side_validation && filter_rule_create.nil?
312
+ fail ArgumentError, "Missing the required parameter 'filter_rule_create' when calling TwitterApi.twitter_create_filter_rule"
313
+ end
314
+ # resource path
315
+ local_var_path = '/v1/twitter/stream/filter-rules'
316
+
317
+ # query parameters
318
+ query_params = opts[:query_params] || {}
319
+
320
+ # header parameters
321
+ header_params = opts[:header_params] || {}
322
+ # HTTP header 'Accept' (if needed)
323
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
324
+ # HTTP header 'Content-Type'
325
+ content_type = @api_client.select_header_content_type(['application/json'])
326
+ if !content_type.nil?
327
+ header_params['Content-Type'] = content_type
328
+ end
329
+
330
+ # form parameters
331
+ form_params = opts[:form_params] || {}
332
+
333
+ # http body (model)
334
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(filter_rule_create)
335
+
336
+ # return_type
337
+ return_type = opts[:debug_return_type] || 'FilterRuleResponse'
338
+
339
+ # auth_names
340
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
341
+
342
+ new_options = opts.merge(
343
+ :operation => :"TwitterApi.twitter_create_filter_rule",
344
+ :header_params => header_params,
345
+ :query_params => query_params,
346
+ :form_params => form_params,
347
+ :body => post_body,
348
+ :auth_names => auth_names,
349
+ :return_type => return_type
350
+ )
351
+
352
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
353
+ if @api_client.config.debugging
354
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_create_filter_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
355
+ end
356
+ return data, status_code, headers
357
+ end
358
+
359
+ # Create stream monitor
360
+ # Create a new stream monitor to watch Twitter accounts in real-time.
361
+ # @param stream_monitor_create [StreamMonitorCreate]
362
+ # @param [Hash] opts the optional parameters
363
+ # @return [StreamMonitorResponse]
364
+ def twitter_create_stream_monitor(stream_monitor_create, opts = {})
365
+ data, _status_code, _headers = twitter_create_stream_monitor_with_http_info(stream_monitor_create, opts)
366
+ data
367
+ end
368
+
369
+ # Create stream monitor
370
+ # Create a new stream monitor to watch Twitter accounts in real-time.
371
+ # @param stream_monitor_create [StreamMonitorCreate]
372
+ # @param [Hash] opts the optional parameters
373
+ # @return [Array<(StreamMonitorResponse, Integer, Hash)>] StreamMonitorResponse data, response status code and response headers
374
+ def twitter_create_stream_monitor_with_http_info(stream_monitor_create, opts = {})
375
+ if @api_client.config.debugging
376
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_create_stream_monitor ...'
377
+ end
378
+ # verify the required parameter 'stream_monitor_create' is set
379
+ if @api_client.config.client_side_validation && stream_monitor_create.nil?
380
+ fail ArgumentError, "Missing the required parameter 'stream_monitor_create' when calling TwitterApi.twitter_create_stream_monitor"
381
+ end
382
+ # resource path
383
+ local_var_path = '/v1/twitter/stream/monitors'
384
+
385
+ # query parameters
386
+ query_params = opts[:query_params] || {}
387
+
388
+ # header parameters
389
+ header_params = opts[:header_params] || {}
390
+ # HTTP header 'Accept' (if needed)
391
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
392
+ # HTTP header 'Content-Type'
393
+ content_type = @api_client.select_header_content_type(['application/json'])
394
+ if !content_type.nil?
395
+ header_params['Content-Type'] = content_type
396
+ end
397
+
398
+ # form parameters
399
+ form_params = opts[:form_params] || {}
400
+
401
+ # http body (model)
402
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(stream_monitor_create)
403
+
404
+ # return_type
405
+ return_type = opts[:debug_return_type] || 'StreamMonitorResponse'
406
+
407
+ # auth_names
408
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
409
+
410
+ new_options = opts.merge(
411
+ :operation => :"TwitterApi.twitter_create_stream_monitor",
412
+ :header_params => header_params,
413
+ :query_params => query_params,
414
+ :form_params => form_params,
415
+ :body => post_body,
416
+ :auth_names => auth_names,
417
+ :return_type => return_type
418
+ )
419
+
420
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
421
+ if @api_client.config.debugging
422
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_create_stream_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
423
+ end
424
+ return data, status_code, headers
425
+ end
426
+
427
+ # Delete filter rule
428
+ # Delete a filter rule and all its logs.
429
+ # @param rule_id [String]
430
+ # @param [Hash] opts the optional parameters
431
+ # @return [nil]
432
+ def twitter_delete_filter_rule(rule_id, opts = {})
433
+ twitter_delete_filter_rule_with_http_info(rule_id, opts)
434
+ nil
435
+ end
436
+
437
+ # Delete filter rule
438
+ # Delete a filter rule and all its logs.
439
+ # @param rule_id [String]
440
+ # @param [Hash] opts the optional parameters
441
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
442
+ def twitter_delete_filter_rule_with_http_info(rule_id, opts = {})
443
+ if @api_client.config.debugging
444
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_delete_filter_rule ...'
445
+ end
446
+ # verify the required parameter 'rule_id' is set
447
+ if @api_client.config.client_side_validation && rule_id.nil?
448
+ fail ArgumentError, "Missing the required parameter 'rule_id' when calling TwitterApi.twitter_delete_filter_rule"
449
+ end
450
+ # resource path
451
+ local_var_path = '/v1/twitter/stream/filter-rules/{rule_id}'.sub('{' + 'rule_id' + '}', CGI.escape(rule_id.to_s))
452
+
453
+ # query parameters
454
+ query_params = opts[:query_params] || {}
455
+
456
+ # header parameters
457
+ header_params = opts[:header_params] || {}
458
+ # HTTP header 'Accept' (if needed)
459
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
460
+
461
+ # form parameters
462
+ form_params = opts[:form_params] || {}
463
+
464
+ # http body (model)
465
+ post_body = opts[:debug_body]
466
+
467
+ # return_type
468
+ return_type = opts[:debug_return_type]
469
+
470
+ # auth_names
471
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
472
+
473
+ new_options = opts.merge(
474
+ :operation => :"TwitterApi.twitter_delete_filter_rule",
475
+ :header_params => header_params,
476
+ :query_params => query_params,
477
+ :form_params => form_params,
478
+ :body => post_body,
479
+ :auth_names => auth_names,
480
+ :return_type => return_type
481
+ )
482
+
483
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
484
+ if @api_client.config.debugging
485
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_delete_filter_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
486
+ end
487
+ return data, status_code, headers
488
+ end
489
+
490
+ # Delete stream monitor
491
+ # Delete a stream monitor and all its logs.
492
+ # @param monitor_id [String]
493
+ # @param [Hash] opts the optional parameters
494
+ # @return [nil]
495
+ def twitter_delete_stream_monitor(monitor_id, opts = {})
496
+ twitter_delete_stream_monitor_with_http_info(monitor_id, opts)
497
+ nil
498
+ end
499
+
500
+ # Delete stream monitor
501
+ # Delete a stream monitor and all its logs.
502
+ # @param monitor_id [String]
503
+ # @param [Hash] opts the optional parameters
504
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
505
+ def twitter_delete_stream_monitor_with_http_info(monitor_id, opts = {})
506
+ if @api_client.config.debugging
507
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_delete_stream_monitor ...'
508
+ end
509
+ # verify the required parameter 'monitor_id' is set
510
+ if @api_client.config.client_side_validation && monitor_id.nil?
511
+ fail ArgumentError, "Missing the required parameter 'monitor_id' when calling TwitterApi.twitter_delete_stream_monitor"
512
+ end
513
+ # resource path
514
+ local_var_path = '/v1/twitter/stream/monitors/{monitor_id}'.sub('{' + 'monitor_id' + '}', CGI.escape(monitor_id.to_s))
515
+
516
+ # query parameters
517
+ query_params = opts[:query_params] || {}
518
+
519
+ # header parameters
520
+ header_params = opts[:header_params] || {}
521
+ # HTTP header 'Accept' (if needed)
522
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
523
+
524
+ # form parameters
525
+ form_params = opts[:form_params] || {}
526
+
527
+ # http body (model)
528
+ post_body = opts[:debug_body]
529
+
530
+ # return_type
531
+ return_type = opts[:debug_return_type]
532
+
533
+ # auth_names
534
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
535
+
536
+ new_options = opts.merge(
537
+ :operation => :"TwitterApi.twitter_delete_stream_monitor",
538
+ :header_params => header_params,
539
+ :query_params => query_params,
540
+ :form_params => form_params,
541
+ :body => post_body,
542
+ :auth_names => auth_names,
543
+ :return_type => return_type
544
+ )
545
+
546
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
547
+ if @api_client.config.debugging
548
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_delete_stream_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
549
+ end
550
+ return data, status_code, headers
551
+ end
552
+
553
+ # Get article by ID
554
+ # Get a long-form article by its ID.
555
+ # @param article_id [String]
556
+ # @param [Hash] opts the optional parameters
557
+ # @return [Object]
558
+ def twitter_get_article_by_id(article_id, opts = {})
559
+ data, _status_code, _headers = twitter_get_article_by_id_with_http_info(article_id, opts)
560
+ data
561
+ end
562
+
563
+ # Get article by ID
564
+ # Get a long-form article by its ID.
565
+ # @param article_id [String]
566
+ # @param [Hash] opts the optional parameters
567
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
568
+ def twitter_get_article_by_id_with_http_info(article_id, opts = {})
569
+ if @api_client.config.debugging
570
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_article_by_id ...'
571
+ end
572
+ # verify the required parameter 'article_id' is set
573
+ if @api_client.config.client_side_validation && article_id.nil?
574
+ fail ArgumentError, "Missing the required parameter 'article_id' when calling TwitterApi.twitter_get_article_by_id"
575
+ end
576
+ # resource path
577
+ local_var_path = '/v1/twitter/tweets/article/{article_id}'.sub('{' + 'article_id' + '}', CGI.escape(article_id.to_s))
578
+
579
+ # query parameters
580
+ query_params = opts[:query_params] || {}
581
+
582
+ # header parameters
583
+ header_params = opts[:header_params] || {}
584
+ # HTTP header 'Accept' (if needed)
585
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
586
+
587
+ # form parameters
588
+ form_params = opts[:form_params] || {}
589
+
590
+ # http body (model)
591
+ post_body = opts[:debug_body]
592
+
593
+ # return_type
594
+ return_type = opts[:debug_return_type] || 'Object'
595
+
596
+ # auth_names
597
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
598
+
599
+ new_options = opts.merge(
600
+ :operation => :"TwitterApi.twitter_get_article_by_id",
601
+ :header_params => header_params,
602
+ :query_params => query_params,
603
+ :form_params => form_params,
604
+ :body => post_body,
605
+ :auth_names => auth_names,
606
+ :return_type => return_type
607
+ )
608
+
609
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
610
+ if @api_client.config.debugging
611
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_article_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
612
+ end
613
+ return data, status_code, headers
614
+ end
615
+
616
+ # Get broadcast details
617
+ # Get details of a live video broadcast.
618
+ # @param broadcast_id [String]
619
+ # @param [Hash] opts the optional parameters
620
+ # @return [Object]
621
+ def twitter_get_broadcast_details(broadcast_id, opts = {})
622
+ data, _status_code, _headers = twitter_get_broadcast_details_with_http_info(broadcast_id, opts)
623
+ data
624
+ end
625
+
626
+ # Get broadcast details
627
+ # Get details of a live video broadcast.
628
+ # @param broadcast_id [String]
629
+ # @param [Hash] opts the optional parameters
630
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
631
+ def twitter_get_broadcast_details_with_http_info(broadcast_id, opts = {})
632
+ if @api_client.config.debugging
633
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_broadcast_details ...'
634
+ end
635
+ # verify the required parameter 'broadcast_id' is set
636
+ if @api_client.config.client_side_validation && broadcast_id.nil?
637
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling TwitterApi.twitter_get_broadcast_details"
638
+ end
639
+ # resource path
640
+ local_var_path = '/v1/twitter/spaces/broadcast/{broadcast_id}'.sub('{' + 'broadcast_id' + '}', CGI.escape(broadcast_id.to_s))
641
+
642
+ # query parameters
643
+ query_params = opts[:query_params] || {}
644
+
645
+ # header parameters
646
+ header_params = opts[:header_params] || {}
647
+ # HTTP header 'Accept' (if needed)
648
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
649
+
650
+ # form parameters
651
+ form_params = opts[:form_params] || {}
652
+
653
+ # http body (model)
654
+ post_body = opts[:debug_body]
655
+
656
+ # return_type
657
+ return_type = opts[:debug_return_type] || 'Object'
658
+
659
+ # auth_names
660
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
661
+
662
+ new_options = opts.merge(
663
+ :operation => :"TwitterApi.twitter_get_broadcast_details",
664
+ :header_params => header_params,
665
+ :query_params => query_params,
666
+ :form_params => form_params,
667
+ :body => post_body,
668
+ :auth_names => auth_names,
669
+ :return_type => return_type
670
+ )
671
+
672
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
673
+ if @api_client.config.debugging
674
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_broadcast_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
675
+ end
676
+ return data, status_code, headers
677
+ end
678
+
679
+ # Get community details
680
+ # Get details of a specific community.
681
+ # @param community_id [String]
682
+ # @param [Hash] opts the optional parameters
683
+ # @return [Object]
684
+ def twitter_get_community_details(community_id, opts = {})
685
+ data, _status_code, _headers = twitter_get_community_details_with_http_info(community_id, opts)
686
+ data
687
+ end
688
+
689
+ # Get community details
690
+ # Get details of a specific community.
691
+ # @param community_id [String]
692
+ # @param [Hash] opts the optional parameters
693
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
694
+ def twitter_get_community_details_with_http_info(community_id, opts = {})
695
+ if @api_client.config.debugging
696
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_community_details ...'
697
+ end
698
+ # verify the required parameter 'community_id' is set
699
+ if @api_client.config.client_side_validation && community_id.nil?
700
+ fail ArgumentError, "Missing the required parameter 'community_id' when calling TwitterApi.twitter_get_community_details"
701
+ end
702
+ # resource path
703
+ local_var_path = '/v1/twitter/communities/{community_id}'.sub('{' + 'community_id' + '}', CGI.escape(community_id.to_s))
704
+
705
+ # query parameters
706
+ query_params = opts[:query_params] || {}
707
+
708
+ # header parameters
709
+ header_params = opts[:header_params] || {}
710
+ # HTTP header 'Accept' (if needed)
711
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
712
+
713
+ # form parameters
714
+ form_params = opts[:form_params] || {}
715
+
716
+ # http body (model)
717
+ post_body = opts[:debug_body]
718
+
719
+ # return_type
720
+ return_type = opts[:debug_return_type] || 'Object'
721
+
722
+ # auth_names
723
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
724
+
725
+ new_options = opts.merge(
726
+ :operation => :"TwitterApi.twitter_get_community_details",
727
+ :header_params => header_params,
728
+ :query_params => query_params,
729
+ :form_params => form_params,
730
+ :body => post_body,
731
+ :auth_names => auth_names,
732
+ :return_type => return_type
733
+ )
734
+
735
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
736
+ if @api_client.config.debugging
737
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_community_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
738
+ end
739
+ return data, status_code, headers
740
+ end
741
+
742
+ # Get community notes
743
+ # Get community notes (Birdwatch) for a specific tweet.
744
+ # @param tweet_id [String]
745
+ # @param [Hash] opts the optional parameters
746
+ # @return [Object]
747
+ def twitter_get_community_notes(tweet_id, opts = {})
748
+ data, _status_code, _headers = twitter_get_community_notes_with_http_info(tweet_id, opts)
749
+ data
750
+ end
751
+
752
+ # Get community notes
753
+ # Get community notes (Birdwatch) for a specific tweet.
754
+ # @param tweet_id [String]
755
+ # @param [Hash] opts the optional parameters
756
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
757
+ def twitter_get_community_notes_with_http_info(tweet_id, opts = {})
758
+ if @api_client.config.debugging
759
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_community_notes ...'
760
+ end
761
+ # verify the required parameter 'tweet_id' is set
762
+ if @api_client.config.client_side_validation && tweet_id.nil?
763
+ fail ArgumentError, "Missing the required parameter 'tweet_id' when calling TwitterApi.twitter_get_community_notes"
764
+ end
765
+ # resource path
766
+ local_var_path = '/v1/twitter/tweets/tweet/{tweet_id}/community_notes'.sub('{' + 'tweet_id' + '}', CGI.escape(tweet_id.to_s))
767
+
768
+ # query parameters
769
+ query_params = opts[:query_params] || {}
770
+
771
+ # header parameters
772
+ header_params = opts[:header_params] || {}
773
+ # HTTP header 'Accept' (if needed)
774
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
775
+
776
+ # form parameters
777
+ form_params = opts[:form_params] || {}
778
+
779
+ # http body (model)
780
+ post_body = opts[:debug_body]
781
+
782
+ # return_type
783
+ return_type = opts[:debug_return_type] || 'Object'
784
+
785
+ # auth_names
786
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
787
+
788
+ new_options = opts.merge(
789
+ :operation => :"TwitterApi.twitter_get_community_notes",
790
+ :header_params => header_params,
791
+ :query_params => query_params,
792
+ :form_params => form_params,
793
+ :body => post_body,
794
+ :auth_names => auth_names,
795
+ :return_type => return_type
796
+ )
797
+
798
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
799
+ if @api_client.config.debugging
800
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_community_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
801
+ end
802
+ return data, status_code, headers
803
+ end
804
+
805
+ # Get community tweets
806
+ # Get tweets from a specific community.
807
+ # @param community_id [String]
808
+ # @param [Hash] opts the optional parameters
809
+ # @option opts [String] :tweet_type
810
+ # @option opts [String] :cursor
811
+ # @return [Object]
812
+ def twitter_get_community_tweets(community_id, opts = {})
813
+ data, _status_code, _headers = twitter_get_community_tweets_with_http_info(community_id, opts)
814
+ data
815
+ end
816
+
817
+ # Get community tweets
818
+ # Get tweets from a specific community.
819
+ # @param community_id [String]
820
+ # @param [Hash] opts the optional parameters
821
+ # @option opts [String] :tweet_type
822
+ # @option opts [String] :cursor
823
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
824
+ def twitter_get_community_tweets_with_http_info(community_id, opts = {})
825
+ if @api_client.config.debugging
826
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_community_tweets ...'
827
+ end
828
+ # verify the required parameter 'community_id' is set
829
+ if @api_client.config.client_side_validation && community_id.nil?
830
+ fail ArgumentError, "Missing the required parameter 'community_id' when calling TwitterApi.twitter_get_community_tweets"
831
+ end
832
+ # resource path
833
+ local_var_path = '/v1/twitter/communities/{community_id}/tweets'.sub('{' + 'community_id' + '}', CGI.escape(community_id.to_s))
834
+
835
+ # query parameters
836
+ query_params = opts[:query_params] || {}
837
+ query_params[:'tweet_type'] = opts[:'tweet_type'] if !opts[:'tweet_type'].nil?
838
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
839
+
840
+ # header parameters
841
+ header_params = opts[:header_params] || {}
842
+ # HTTP header 'Accept' (if needed)
843
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
844
+
845
+ # form parameters
846
+ form_params = opts[:form_params] || {}
847
+
848
+ # http body (model)
849
+ post_body = opts[:debug_body]
850
+
851
+ # return_type
852
+ return_type = opts[:debug_return_type] || 'Object'
853
+
854
+ # auth_names
855
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
856
+
857
+ new_options = opts.merge(
858
+ :operation => :"TwitterApi.twitter_get_community_tweets",
859
+ :header_params => header_params,
860
+ :query_params => query_params,
861
+ :form_params => form_params,
862
+ :body => post_body,
863
+ :auth_names => auth_names,
864
+ :return_type => return_type
865
+ )
866
+
867
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
868
+ if @api_client.config.debugging
869
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_community_tweets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
870
+ end
871
+ return data, status_code, headers
872
+ end
873
+
874
+ # Get filter rule
875
+ # Get a single filter rule by ID.
876
+ # @param rule_id [String]
877
+ # @param [Hash] opts the optional parameters
878
+ # @return [FilterRuleResponse]
879
+ def twitter_get_filter_rule(rule_id, opts = {})
880
+ data, _status_code, _headers = twitter_get_filter_rule_with_http_info(rule_id, opts)
881
+ data
882
+ end
883
+
884
+ # Get filter rule
885
+ # Get a single filter rule by ID.
886
+ # @param rule_id [String]
887
+ # @param [Hash] opts the optional parameters
888
+ # @return [Array<(FilterRuleResponse, Integer, Hash)>] FilterRuleResponse data, response status code and response headers
889
+ def twitter_get_filter_rule_with_http_info(rule_id, opts = {})
890
+ if @api_client.config.debugging
891
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_filter_rule ...'
892
+ end
893
+ # verify the required parameter 'rule_id' is set
894
+ if @api_client.config.client_side_validation && rule_id.nil?
895
+ fail ArgumentError, "Missing the required parameter 'rule_id' when calling TwitterApi.twitter_get_filter_rule"
896
+ end
897
+ # resource path
898
+ local_var_path = '/v1/twitter/stream/filter-rules/{rule_id}'.sub('{' + 'rule_id' + '}', CGI.escape(rule_id.to_s))
899
+
900
+ # query parameters
901
+ query_params = opts[:query_params] || {}
902
+
903
+ # header parameters
904
+ header_params = opts[:header_params] || {}
905
+ # HTTP header 'Accept' (if needed)
906
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
907
+
908
+ # form parameters
909
+ form_params = opts[:form_params] || {}
910
+
911
+ # http body (model)
912
+ post_body = opts[:debug_body]
913
+
914
+ # return_type
915
+ return_type = opts[:debug_return_type] || 'FilterRuleResponse'
916
+
917
+ # auth_names
918
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
919
+
920
+ new_options = opts.merge(
921
+ :operation => :"TwitterApi.twitter_get_filter_rule",
922
+ :header_params => header_params,
923
+ :query_params => query_params,
924
+ :form_params => form_params,
925
+ :body => post_body,
926
+ :auth_names => auth_names,
927
+ :return_type => return_type
928
+ )
929
+
930
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
931
+ if @api_client.config.debugging
932
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_filter_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
933
+ end
934
+ return data, status_code, headers
935
+ end
936
+
937
+ # Get filter rule per-poll rates
938
+ # Current per-poll rates (auth required — used by SDK + dashboard).
939
+ # @param [Hash] opts the optional parameters
940
+ # @return [PortalApiRoutersV1TwitterFilterRulesFilterRulePricingResponse]
941
+ def twitter_get_filter_rule_per_poll_rates(opts = {})
942
+ data, _status_code, _headers = twitter_get_filter_rule_per_poll_rates_with_http_info(opts)
943
+ data
944
+ end
945
+
946
+ # Get filter rule per-poll rates
947
+ # Current per-poll rates (auth required — used by SDK + dashboard).
948
+ # @param [Hash] opts the optional parameters
949
+ # @return [Array<(PortalApiRoutersV1TwitterFilterRulesFilterRulePricingResponse, Integer, Hash)>] PortalApiRoutersV1TwitterFilterRulesFilterRulePricingResponse data, response status code and response headers
950
+ def twitter_get_filter_rule_per_poll_rates_with_http_info(opts = {})
951
+ if @api_client.config.debugging
952
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_filter_rule_per_poll_rates ...'
953
+ end
954
+ # resource path
955
+ local_var_path = '/v1/twitter/stream/filter-rules-pricing'
956
+
957
+ # query parameters
958
+ query_params = opts[:query_params] || {}
959
+
960
+ # header parameters
961
+ header_params = opts[:header_params] || {}
962
+ # HTTP header 'Accept' (if needed)
963
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
964
+
965
+ # form parameters
966
+ form_params = opts[:form_params] || {}
967
+
968
+ # http body (model)
969
+ post_body = opts[:debug_body]
970
+
971
+ # return_type
972
+ return_type = opts[:debug_return_type] || 'PortalApiRoutersV1TwitterFilterRulesFilterRulePricingResponse'
973
+
974
+ # auth_names
975
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
976
+
977
+ new_options = opts.merge(
978
+ :operation => :"TwitterApi.twitter_get_filter_rule_per_poll_rates",
979
+ :header_params => header_params,
980
+ :query_params => query_params,
981
+ :form_params => form_params,
982
+ :body => post_body,
983
+ :auth_names => auth_names,
984
+ :return_type => return_type
985
+ )
986
+
987
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
988
+ if @api_client.config.debugging
989
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_filter_rule_per_poll_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
990
+ end
991
+ return data, status_code, headers
992
+ end
993
+
994
+ # Get list details
995
+ # Get details of a specific list.
996
+ # @param list_id [String]
997
+ # @param [Hash] opts the optional parameters
998
+ # @return [Object]
999
+ def twitter_get_list_details(list_id, opts = {})
1000
+ data, _status_code, _headers = twitter_get_list_details_with_http_info(list_id, opts)
1001
+ data
1002
+ end
1003
+
1004
+ # Get list details
1005
+ # Get details of a specific list.
1006
+ # @param list_id [String]
1007
+ # @param [Hash] opts the optional parameters
1008
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1009
+ def twitter_get_list_details_with_http_info(list_id, opts = {})
1010
+ if @api_client.config.debugging
1011
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_list_details ...'
1012
+ end
1013
+ # verify the required parameter 'list_id' is set
1014
+ if @api_client.config.client_side_validation && list_id.nil?
1015
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling TwitterApi.twitter_get_list_details"
1016
+ end
1017
+ # resource path
1018
+ local_var_path = '/v1/twitter/lists/{list_id}/detail'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
1019
+
1020
+ # query parameters
1021
+ query_params = opts[:query_params] || {}
1022
+
1023
+ # header parameters
1024
+ header_params = opts[:header_params] || {}
1025
+ # HTTP header 'Accept' (if needed)
1026
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1027
+
1028
+ # form parameters
1029
+ form_params = opts[:form_params] || {}
1030
+
1031
+ # http body (model)
1032
+ post_body = opts[:debug_body]
1033
+
1034
+ # return_type
1035
+ return_type = opts[:debug_return_type] || 'Object'
1036
+
1037
+ # auth_names
1038
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1039
+
1040
+ new_options = opts.merge(
1041
+ :operation => :"TwitterApi.twitter_get_list_details",
1042
+ :header_params => header_params,
1043
+ :query_params => query_params,
1044
+ :form_params => form_params,
1045
+ :body => post_body,
1046
+ :auth_names => auth_names,
1047
+ :return_type => return_type
1048
+ )
1049
+
1050
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1051
+ if @api_client.config.debugging
1052
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_list_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1053
+ end
1054
+ return data, status_code, headers
1055
+ end
1056
+
1057
+ # Get list tweets
1058
+ # Get tweets from a specific list.
1059
+ # @param list_id [String]
1060
+ # @param [Hash] opts the optional parameters
1061
+ # @option opts [String] :cursor
1062
+ # @return [Object]
1063
+ def twitter_get_list_tweets(list_id, opts = {})
1064
+ data, _status_code, _headers = twitter_get_list_tweets_with_http_info(list_id, opts)
1065
+ data
1066
+ end
1067
+
1068
+ # Get list tweets
1069
+ # Get tweets from a specific list.
1070
+ # @param list_id [String]
1071
+ # @param [Hash] opts the optional parameters
1072
+ # @option opts [String] :cursor
1073
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1074
+ def twitter_get_list_tweets_with_http_info(list_id, opts = {})
1075
+ if @api_client.config.debugging
1076
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_list_tweets ...'
1077
+ end
1078
+ # verify the required parameter 'list_id' is set
1079
+ if @api_client.config.client_side_validation && list_id.nil?
1080
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling TwitterApi.twitter_get_list_tweets"
1081
+ end
1082
+ # resource path
1083
+ local_var_path = '/v1/twitter/lists/{list_id}/tweets'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
1084
+
1085
+ # query parameters
1086
+ query_params = opts[:query_params] || {}
1087
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1088
+
1089
+ # header parameters
1090
+ header_params = opts[:header_params] || {}
1091
+ # HTTP header 'Accept' (if needed)
1092
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1093
+
1094
+ # form parameters
1095
+ form_params = opts[:form_params] || {}
1096
+
1097
+ # http body (model)
1098
+ post_body = opts[:debug_body]
1099
+
1100
+ # return_type
1101
+ return_type = opts[:debug_return_type] || 'Object'
1102
+
1103
+ # auth_names
1104
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1105
+
1106
+ new_options = opts.merge(
1107
+ :operation => :"TwitterApi.twitter_get_list_tweets",
1108
+ :header_params => header_params,
1109
+ :query_params => query_params,
1110
+ :form_params => form_params,
1111
+ :body => post_body,
1112
+ :auth_names => auth_names,
1113
+ :return_type => return_type
1114
+ )
1115
+
1116
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1117
+ if @api_client.config.debugging
1118
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_list_tweets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1119
+ end
1120
+ return data, status_code, headers
1121
+ end
1122
+
1123
+ # Get place details
1124
+ # Get details of a specific place.
1125
+ # @param place_id [String]
1126
+ # @param [Hash] opts the optional parameters
1127
+ # @return [Object]
1128
+ def twitter_get_place_details(place_id, opts = {})
1129
+ data, _status_code, _headers = twitter_get_place_details_with_http_info(place_id, opts)
1130
+ data
1131
+ end
1132
+
1133
+ # Get place details
1134
+ # Get details of a specific place.
1135
+ # @param place_id [String]
1136
+ # @param [Hash] opts the optional parameters
1137
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1138
+ def twitter_get_place_details_with_http_info(place_id, opts = {})
1139
+ if @api_client.config.debugging
1140
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_place_details ...'
1141
+ end
1142
+ # verify the required parameter 'place_id' is set
1143
+ if @api_client.config.client_side_validation && place_id.nil?
1144
+ fail ArgumentError, "Missing the required parameter 'place_id' when calling TwitterApi.twitter_get_place_details"
1145
+ end
1146
+ # resource path
1147
+ local_var_path = '/v1/twitter/geo/places/{place_id}'.sub('{' + 'place_id' + '}', CGI.escape(place_id.to_s))
1148
+
1149
+ # query parameters
1150
+ query_params = opts[:query_params] || {}
1151
+
1152
+ # header parameters
1153
+ header_params = opts[:header_params] || {}
1154
+ # HTTP header 'Accept' (if needed)
1155
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1156
+
1157
+ # form parameters
1158
+ form_params = opts[:form_params] || {}
1159
+
1160
+ # http body (model)
1161
+ post_body = opts[:debug_body]
1162
+
1163
+ # return_type
1164
+ return_type = opts[:debug_return_type] || 'Object'
1165
+
1166
+ # auth_names
1167
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1168
+
1169
+ new_options = opts.merge(
1170
+ :operation => :"TwitterApi.twitter_get_place_details",
1171
+ :header_params => header_params,
1172
+ :query_params => query_params,
1173
+ :form_params => form_params,
1174
+ :body => post_body,
1175
+ :auth_names => auth_names,
1176
+ :return_type => return_type
1177
+ )
1178
+
1179
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1180
+ if @api_client.config.debugging
1181
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_place_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1182
+ end
1183
+ return data, status_code, headers
1184
+ end
1185
+
1186
+ # Get similar tweets
1187
+ # Get tweets similar to a specific tweet.
1188
+ # @param tweet_id [String]
1189
+ # @param [Hash] opts the optional parameters
1190
+ # @return [Object]
1191
+ def twitter_get_similar_tweets(tweet_id, opts = {})
1192
+ data, _status_code, _headers = twitter_get_similar_tweets_with_http_info(tweet_id, opts)
1193
+ data
1194
+ end
1195
+
1196
+ # Get similar tweets
1197
+ # Get tweets similar to a specific tweet.
1198
+ # @param tweet_id [String]
1199
+ # @param [Hash] opts the optional parameters
1200
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1201
+ def twitter_get_similar_tweets_with_http_info(tweet_id, opts = {})
1202
+ if @api_client.config.debugging
1203
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_similar_tweets ...'
1204
+ end
1205
+ # verify the required parameter 'tweet_id' is set
1206
+ if @api_client.config.client_side_validation && tweet_id.nil?
1207
+ fail ArgumentError, "Missing the required parameter 'tweet_id' when calling TwitterApi.twitter_get_similar_tweets"
1208
+ end
1209
+ # resource path
1210
+ local_var_path = '/v1/twitter/tweets/tweet/{tweet_id}/similar'.sub('{' + 'tweet_id' + '}', CGI.escape(tweet_id.to_s))
1211
+
1212
+ # query parameters
1213
+ query_params = opts[:query_params] || {}
1214
+
1215
+ # header parameters
1216
+ header_params = opts[:header_params] || {}
1217
+ # HTTP header 'Accept' (if needed)
1218
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1219
+
1220
+ # form parameters
1221
+ form_params = opts[:form_params] || {}
1222
+
1223
+ # http body (model)
1224
+ post_body = opts[:debug_body]
1225
+
1226
+ # return_type
1227
+ return_type = opts[:debug_return_type] || 'Object'
1228
+
1229
+ # auth_names
1230
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1231
+
1232
+ new_options = opts.merge(
1233
+ :operation => :"TwitterApi.twitter_get_similar_tweets",
1234
+ :header_params => header_params,
1235
+ :query_params => query_params,
1236
+ :form_params => form_params,
1237
+ :body => post_body,
1238
+ :auth_names => auth_names,
1239
+ :return_type => return_type
1240
+ )
1241
+
1242
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1243
+ if @api_client.config.debugging
1244
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_similar_tweets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1245
+ end
1246
+ return data, status_code, headers
1247
+ end
1248
+
1249
+ # Get Space details
1250
+ # Get details of a Twitter Space.
1251
+ # @param space_id [String]
1252
+ # @param [Hash] opts the optional parameters
1253
+ # @return [Object]
1254
+ def twitter_get_space_details(space_id, opts = {})
1255
+ data, _status_code, _headers = twitter_get_space_details_with_http_info(space_id, opts)
1256
+ data
1257
+ end
1258
+
1259
+ # Get Space details
1260
+ # Get details of a Twitter Space.
1261
+ # @param space_id [String]
1262
+ # @param [Hash] opts the optional parameters
1263
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1264
+ def twitter_get_space_details_with_http_info(space_id, opts = {})
1265
+ if @api_client.config.debugging
1266
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_space_details ...'
1267
+ end
1268
+ # verify the required parameter 'space_id' is set
1269
+ if @api_client.config.client_side_validation && space_id.nil?
1270
+ fail ArgumentError, "Missing the required parameter 'space_id' when calling TwitterApi.twitter_get_space_details"
1271
+ end
1272
+ # resource path
1273
+ local_var_path = '/v1/twitter/spaces/{space_id}'.sub('{' + 'space_id' + '}', CGI.escape(space_id.to_s))
1274
+
1275
+ # query parameters
1276
+ query_params = opts[:query_params] || {}
1277
+
1278
+ # header parameters
1279
+ header_params = opts[:header_params] || {}
1280
+ # HTTP header 'Accept' (if needed)
1281
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1282
+
1283
+ # form parameters
1284
+ form_params = opts[:form_params] || {}
1285
+
1286
+ # http body (model)
1287
+ post_body = opts[:debug_body]
1288
+
1289
+ # return_type
1290
+ return_type = opts[:debug_return_type] || 'Object'
1291
+
1292
+ # auth_names
1293
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1294
+
1295
+ new_options = opts.merge(
1296
+ :operation => :"TwitterApi.twitter_get_space_details",
1297
+ :header_params => header_params,
1298
+ :query_params => query_params,
1299
+ :form_params => form_params,
1300
+ :body => post_body,
1301
+ :auth_names => auth_names,
1302
+ :return_type => return_type
1303
+ )
1304
+
1305
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1306
+ if @api_client.config.debugging
1307
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_space_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1308
+ end
1309
+ return data, status_code, headers
1310
+ end
1311
+
1312
+ # Get stream monitor
1313
+ # Get a single stream monitor by ID.
1314
+ # @param monitor_id [String]
1315
+ # @param [Hash] opts the optional parameters
1316
+ # @return [StreamMonitorResponse]
1317
+ def twitter_get_stream_monitor(monitor_id, opts = {})
1318
+ data, _status_code, _headers = twitter_get_stream_monitor_with_http_info(monitor_id, opts)
1319
+ data
1320
+ end
1321
+
1322
+ # Get stream monitor
1323
+ # Get a single stream monitor by ID.
1324
+ # @param monitor_id [String]
1325
+ # @param [Hash] opts the optional parameters
1326
+ # @return [Array<(StreamMonitorResponse, Integer, Hash)>] StreamMonitorResponse data, response status code and response headers
1327
+ def twitter_get_stream_monitor_with_http_info(monitor_id, opts = {})
1328
+ if @api_client.config.debugging
1329
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_stream_monitor ...'
1330
+ end
1331
+ # verify the required parameter 'monitor_id' is set
1332
+ if @api_client.config.client_side_validation && monitor_id.nil?
1333
+ fail ArgumentError, "Missing the required parameter 'monitor_id' when calling TwitterApi.twitter_get_stream_monitor"
1334
+ end
1335
+ # resource path
1336
+ local_var_path = '/v1/twitter/stream/monitors/{monitor_id}'.sub('{' + 'monitor_id' + '}', CGI.escape(monitor_id.to_s))
1337
+
1338
+ # query parameters
1339
+ query_params = opts[:query_params] || {}
1340
+
1341
+ # header parameters
1342
+ header_params = opts[:header_params] || {}
1343
+ # HTTP header 'Accept' (if needed)
1344
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1345
+
1346
+ # form parameters
1347
+ form_params = opts[:form_params] || {}
1348
+
1349
+ # http body (model)
1350
+ post_body = opts[:debug_body]
1351
+
1352
+ # return_type
1353
+ return_type = opts[:debug_return_type] || 'StreamMonitorResponse'
1354
+
1355
+ # auth_names
1356
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1357
+
1358
+ new_options = opts.merge(
1359
+ :operation => :"TwitterApi.twitter_get_stream_monitor",
1360
+ :header_params => header_params,
1361
+ :query_params => query_params,
1362
+ :form_params => form_params,
1363
+ :body => post_body,
1364
+ :auth_names => auth_names,
1365
+ :return_type => return_type
1366
+ )
1367
+
1368
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1369
+ if @api_client.config.debugging
1370
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_stream_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1371
+ end
1372
+ return data, status_code, headers
1373
+ end
1374
+
1375
+ # Get trending topics
1376
+ # Get trending topics.
1377
+ # @param [Hash] opts the optional parameters
1378
+ # @option opts [String] :category
1379
+ # @option opts [Integer] :count
1380
+ # @return [Object]
1381
+ def twitter_get_trending_topics(opts = {})
1382
+ data, _status_code, _headers = twitter_get_trending_topics_with_http_info(opts)
1383
+ data
1384
+ end
1385
+
1386
+ # Get trending topics
1387
+ # Get trending topics.
1388
+ # @param [Hash] opts the optional parameters
1389
+ # @option opts [String] :category
1390
+ # @option opts [Integer] :count
1391
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1392
+ def twitter_get_trending_topics_with_http_info(opts = {})
1393
+ if @api_client.config.debugging
1394
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_trending_topics ...'
1395
+ end
1396
+ # resource path
1397
+ local_var_path = '/v1/twitter/trends/'
1398
+
1399
+ # query parameters
1400
+ query_params = opts[:query_params] || {}
1401
+ query_params[:'category'] = opts[:'category'] if !opts[:'category'].nil?
1402
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
1403
+
1404
+ # header parameters
1405
+ header_params = opts[:header_params] || {}
1406
+ # HTTP header 'Accept' (if needed)
1407
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1408
+
1409
+ # form parameters
1410
+ form_params = opts[:form_params] || {}
1411
+
1412
+ # http body (model)
1413
+ post_body = opts[:debug_body]
1414
+
1415
+ # return_type
1416
+ return_type = opts[:debug_return_type] || 'Object'
1417
+
1418
+ # auth_names
1419
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1420
+
1421
+ new_options = opts.merge(
1422
+ :operation => :"TwitterApi.twitter_get_trending_topics",
1423
+ :header_params => header_params,
1424
+ :query_params => query_params,
1425
+ :form_params => form_params,
1426
+ :body => post_body,
1427
+ :auth_names => auth_names,
1428
+ :return_type => return_type
1429
+ )
1430
+
1431
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1432
+ if @api_client.config.debugging
1433
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_trending_topics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1434
+ end
1435
+ return data, status_code, headers
1436
+ end
1437
+
1438
+ # Get trends by location
1439
+ # Get trending topics for a specific location (WOEID).
1440
+ # @param woeid [String]
1441
+ # @param [Hash] opts the optional parameters
1442
+ # @return [Object]
1443
+ def twitter_get_trends_by_location(woeid, opts = {})
1444
+ data, _status_code, _headers = twitter_get_trends_by_location_with_http_info(woeid, opts)
1445
+ data
1446
+ end
1447
+
1448
+ # Get trends by location
1449
+ # Get trending topics for a specific location (WOEID).
1450
+ # @param woeid [String]
1451
+ # @param [Hash] opts the optional parameters
1452
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1453
+ def twitter_get_trends_by_location_with_http_info(woeid, opts = {})
1454
+ if @api_client.config.debugging
1455
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_trends_by_location ...'
1456
+ end
1457
+ # verify the required parameter 'woeid' is set
1458
+ if @api_client.config.client_side_validation && woeid.nil?
1459
+ fail ArgumentError, "Missing the required parameter 'woeid' when calling TwitterApi.twitter_get_trends_by_location"
1460
+ end
1461
+ # resource path
1462
+ local_var_path = '/v1/twitter/trends/place/{woeid}'.sub('{' + 'woeid' + '}', CGI.escape(woeid.to_s))
1463
+
1464
+ # query parameters
1465
+ query_params = opts[:query_params] || {}
1466
+
1467
+ # header parameters
1468
+ header_params = opts[:header_params] || {}
1469
+ # HTTP header 'Accept' (if needed)
1470
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1471
+
1472
+ # form parameters
1473
+ form_params = opts[:form_params] || {}
1474
+
1475
+ # http body (model)
1476
+ post_body = opts[:debug_body]
1477
+
1478
+ # return_type
1479
+ return_type = opts[:debug_return_type] || 'Object'
1480
+
1481
+ # auth_names
1482
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1483
+
1484
+ new_options = opts.merge(
1485
+ :operation => :"TwitterApi.twitter_get_trends_by_location",
1486
+ :header_params => header_params,
1487
+ :query_params => query_params,
1488
+ :form_params => form_params,
1489
+ :body => post_body,
1490
+ :auth_names => auth_names,
1491
+ :return_type => return_type
1492
+ )
1493
+
1494
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1495
+ if @api_client.config.debugging
1496
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_trends_by_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1497
+ end
1498
+ return data, status_code, headers
1499
+ end
1500
+
1501
+ # Get tweet details
1502
+ # Get detailed information about a specific tweet.
1503
+ # @param tweet_id [String]
1504
+ # @param [Hash] opts the optional parameters
1505
+ # @option opts [String] :cursor
1506
+ # @return [Object]
1507
+ def twitter_get_tweet_details(tweet_id, opts = {})
1508
+ data, _status_code, _headers = twitter_get_tweet_details_with_http_info(tweet_id, opts)
1509
+ data
1510
+ end
1511
+
1512
+ # Get tweet details
1513
+ # Get detailed information about a specific tweet.
1514
+ # @param tweet_id [String]
1515
+ # @param [Hash] opts the optional parameters
1516
+ # @option opts [String] :cursor
1517
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1518
+ def twitter_get_tweet_details_with_http_info(tweet_id, opts = {})
1519
+ if @api_client.config.debugging
1520
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_tweet_details ...'
1521
+ end
1522
+ # verify the required parameter 'tweet_id' is set
1523
+ if @api_client.config.client_side_validation && tweet_id.nil?
1524
+ fail ArgumentError, "Missing the required parameter 'tweet_id' when calling TwitterApi.twitter_get_tweet_details"
1525
+ end
1526
+ # resource path
1527
+ local_var_path = '/v1/twitter/tweets/tweet/{tweet_id}'.sub('{' + 'tweet_id' + '}', CGI.escape(tweet_id.to_s))
1528
+
1529
+ # query parameters
1530
+ query_params = opts[:query_params] || {}
1531
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1532
+
1533
+ # header parameters
1534
+ header_params = opts[:header_params] || {}
1535
+ # HTTP header 'Accept' (if needed)
1536
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1537
+
1538
+ # form parameters
1539
+ form_params = opts[:form_params] || {}
1540
+
1541
+ # http body (model)
1542
+ post_body = opts[:debug_body]
1543
+
1544
+ # return_type
1545
+ return_type = opts[:debug_return_type] || 'Object'
1546
+
1547
+ # auth_names
1548
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1549
+
1550
+ new_options = opts.merge(
1551
+ :operation => :"TwitterApi.twitter_get_tweet_details",
1552
+ :header_params => header_params,
1553
+ :query_params => query_params,
1554
+ :form_params => form_params,
1555
+ :body => post_body,
1556
+ :auth_names => auth_names,
1557
+ :return_type => return_type
1558
+ )
1559
+
1560
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1561
+ if @api_client.config.debugging
1562
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_tweet_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1563
+ end
1564
+ return data, status_code, headers
1565
+ end
1566
+
1567
+ # Get tweet edit history
1568
+ # Get the edit history of a tweet.
1569
+ # @param tweet_id [String]
1570
+ # @param [Hash] opts the optional parameters
1571
+ # @return [Object]
1572
+ def twitter_get_tweet_edit_history(tweet_id, opts = {})
1573
+ data, _status_code, _headers = twitter_get_tweet_edit_history_with_http_info(tweet_id, opts)
1574
+ data
1575
+ end
1576
+
1577
+ # Get tweet edit history
1578
+ # Get the edit history of a tweet.
1579
+ # @param tweet_id [String]
1580
+ # @param [Hash] opts the optional parameters
1581
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1582
+ def twitter_get_tweet_edit_history_with_http_info(tweet_id, opts = {})
1583
+ if @api_client.config.debugging
1584
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_tweet_edit_history ...'
1585
+ end
1586
+ # verify the required parameter 'tweet_id' is set
1587
+ if @api_client.config.client_side_validation && tweet_id.nil?
1588
+ fail ArgumentError, "Missing the required parameter 'tweet_id' when calling TwitterApi.twitter_get_tweet_edit_history"
1589
+ end
1590
+ # resource path
1591
+ local_var_path = '/v1/twitter/tweets/tweet/{tweet_id}/edit_history'.sub('{' + 'tweet_id' + '}', CGI.escape(tweet_id.to_s))
1592
+
1593
+ # query parameters
1594
+ query_params = opts[:query_params] || {}
1595
+
1596
+ # header parameters
1597
+ header_params = opts[:header_params] || {}
1598
+ # HTTP header 'Accept' (if needed)
1599
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1600
+
1601
+ # form parameters
1602
+ form_params = opts[:form_params] || {}
1603
+
1604
+ # http body (model)
1605
+ post_body = opts[:debug_body]
1606
+
1607
+ # return_type
1608
+ return_type = opts[:debug_return_type] || 'Object'
1609
+
1610
+ # auth_names
1611
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1612
+
1613
+ new_options = opts.merge(
1614
+ :operation => :"TwitterApi.twitter_get_tweet_edit_history",
1615
+ :header_params => header_params,
1616
+ :query_params => query_params,
1617
+ :form_params => form_params,
1618
+ :body => post_body,
1619
+ :auth_names => auth_names,
1620
+ :return_type => return_type
1621
+ )
1622
+
1623
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1624
+ if @api_client.config.debugging
1625
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_tweet_edit_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1626
+ end
1627
+ return data, status_code, headers
1628
+ end
1629
+
1630
+ # Get tweet favoriters
1631
+ # Get users who favorited a specific tweet.
1632
+ # @param tweet_id [String]
1633
+ # @param [Hash] opts the optional parameters
1634
+ # @option opts [String] :cursor
1635
+ # @return [Object]
1636
+ def twitter_get_tweet_favoriters(tweet_id, opts = {})
1637
+ data, _status_code, _headers = twitter_get_tweet_favoriters_with_http_info(tweet_id, opts)
1638
+ data
1639
+ end
1640
+
1641
+ # Get tweet favoriters
1642
+ # Get users who favorited a specific tweet.
1643
+ # @param tweet_id [String]
1644
+ # @param [Hash] opts the optional parameters
1645
+ # @option opts [String] :cursor
1646
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1647
+ def twitter_get_tweet_favoriters_with_http_info(tweet_id, opts = {})
1648
+ if @api_client.config.debugging
1649
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_tweet_favoriters ...'
1650
+ end
1651
+ # verify the required parameter 'tweet_id' is set
1652
+ if @api_client.config.client_side_validation && tweet_id.nil?
1653
+ fail ArgumentError, "Missing the required parameter 'tweet_id' when calling TwitterApi.twitter_get_tweet_favoriters"
1654
+ end
1655
+ # resource path
1656
+ local_var_path = '/v1/twitter/tweets/tweet/{tweet_id}/favoriters'.sub('{' + 'tweet_id' + '}', CGI.escape(tweet_id.to_s))
1657
+
1658
+ # query parameters
1659
+ query_params = opts[:query_params] || {}
1660
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1661
+
1662
+ # header parameters
1663
+ header_params = opts[:header_params] || {}
1664
+ # HTTP header 'Accept' (if needed)
1665
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1666
+
1667
+ # form parameters
1668
+ form_params = opts[:form_params] || {}
1669
+
1670
+ # http body (model)
1671
+ post_body = opts[:debug_body]
1672
+
1673
+ # return_type
1674
+ return_type = opts[:debug_return_type] || 'Object'
1675
+
1676
+ # auth_names
1677
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1678
+
1679
+ new_options = opts.merge(
1680
+ :operation => :"TwitterApi.twitter_get_tweet_favoriters",
1681
+ :header_params => header_params,
1682
+ :query_params => query_params,
1683
+ :form_params => form_params,
1684
+ :body => post_body,
1685
+ :auth_names => auth_names,
1686
+ :return_type => return_type
1687
+ )
1688
+
1689
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1690
+ if @api_client.config.debugging
1691
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_tweet_favoriters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1692
+ end
1693
+ return data, status_code, headers
1694
+ end
1695
+
1696
+ # Get tweet quotes
1697
+ # Get tweets that quote a specific tweet.
1698
+ # @param tweet_id [String]
1699
+ # @param [Hash] opts the optional parameters
1700
+ # @option opts [String] :cursor
1701
+ # @return [Object]
1702
+ def twitter_get_tweet_quotes(tweet_id, opts = {})
1703
+ data, _status_code, _headers = twitter_get_tweet_quotes_with_http_info(tweet_id, opts)
1704
+ data
1705
+ end
1706
+
1707
+ # Get tweet quotes
1708
+ # Get tweets that quote a specific tweet.
1709
+ # @param tweet_id [String]
1710
+ # @param [Hash] opts the optional parameters
1711
+ # @option opts [String] :cursor
1712
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1713
+ def twitter_get_tweet_quotes_with_http_info(tweet_id, opts = {})
1714
+ if @api_client.config.debugging
1715
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_tweet_quotes ...'
1716
+ end
1717
+ # verify the required parameter 'tweet_id' is set
1718
+ if @api_client.config.client_side_validation && tweet_id.nil?
1719
+ fail ArgumentError, "Missing the required parameter 'tweet_id' when calling TwitterApi.twitter_get_tweet_quotes"
1720
+ end
1721
+ # resource path
1722
+ local_var_path = '/v1/twitter/tweets/tweet/{tweet_id}/quotes'.sub('{' + 'tweet_id' + '}', CGI.escape(tweet_id.to_s))
1723
+
1724
+ # query parameters
1725
+ query_params = opts[:query_params] || {}
1726
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1727
+
1728
+ # header parameters
1729
+ header_params = opts[:header_params] || {}
1730
+ # HTTP header 'Accept' (if needed)
1731
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1732
+
1733
+ # form parameters
1734
+ form_params = opts[:form_params] || {}
1735
+
1736
+ # http body (model)
1737
+ post_body = opts[:debug_body]
1738
+
1739
+ # return_type
1740
+ return_type = opts[:debug_return_type] || 'Object'
1741
+
1742
+ # auth_names
1743
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1744
+
1745
+ new_options = opts.merge(
1746
+ :operation => :"TwitterApi.twitter_get_tweet_quotes",
1747
+ :header_params => header_params,
1748
+ :query_params => query_params,
1749
+ :form_params => form_params,
1750
+ :body => post_body,
1751
+ :auth_names => auth_names,
1752
+ :return_type => return_type
1753
+ )
1754
+
1755
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1756
+ if @api_client.config.debugging
1757
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_tweet_quotes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1758
+ end
1759
+ return data, status_code, headers
1760
+ end
1761
+
1762
+ # Get tweet replies
1763
+ # Get replies to a specific tweet.
1764
+ # @param tweet_id [String]
1765
+ # @param [Hash] opts the optional parameters
1766
+ # @option opts [String] :cursor
1767
+ # @return [Object]
1768
+ def twitter_get_tweet_replies(tweet_id, opts = {})
1769
+ data, _status_code, _headers = twitter_get_tweet_replies_with_http_info(tweet_id, opts)
1770
+ data
1771
+ end
1772
+
1773
+ # Get tweet replies
1774
+ # Get replies to a specific tweet.
1775
+ # @param tweet_id [String]
1776
+ # @param [Hash] opts the optional parameters
1777
+ # @option opts [String] :cursor
1778
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1779
+ def twitter_get_tweet_replies_with_http_info(tweet_id, opts = {})
1780
+ if @api_client.config.debugging
1781
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_tweet_replies ...'
1782
+ end
1783
+ # verify the required parameter 'tweet_id' is set
1784
+ if @api_client.config.client_side_validation && tweet_id.nil?
1785
+ fail ArgumentError, "Missing the required parameter 'tweet_id' when calling TwitterApi.twitter_get_tweet_replies"
1786
+ end
1787
+ # resource path
1788
+ local_var_path = '/v1/twitter/tweets/tweet/{tweet_id}/replies'.sub('{' + 'tweet_id' + '}', CGI.escape(tweet_id.to_s))
1789
+
1790
+ # query parameters
1791
+ query_params = opts[:query_params] || {}
1792
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1793
+
1794
+ # header parameters
1795
+ header_params = opts[:header_params] || {}
1796
+ # HTTP header 'Accept' (if needed)
1797
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1798
+
1799
+ # form parameters
1800
+ form_params = opts[:form_params] || {}
1801
+
1802
+ # http body (model)
1803
+ post_body = opts[:debug_body]
1804
+
1805
+ # return_type
1806
+ return_type = opts[:debug_return_type] || 'Object'
1807
+
1808
+ # auth_names
1809
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1810
+
1811
+ new_options = opts.merge(
1812
+ :operation => :"TwitterApi.twitter_get_tweet_replies",
1813
+ :header_params => header_params,
1814
+ :query_params => query_params,
1815
+ :form_params => form_params,
1816
+ :body => post_body,
1817
+ :auth_names => auth_names,
1818
+ :return_type => return_type
1819
+ )
1820
+
1821
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1822
+ if @api_client.config.debugging
1823
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_tweet_replies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1824
+ end
1825
+ return data, status_code, headers
1826
+ end
1827
+
1828
+ # Get tweet retweeters
1829
+ # Get users who retweeted a specific tweet.
1830
+ # @param tweet_id [String]
1831
+ # @param [Hash] opts the optional parameters
1832
+ # @option opts [String] :cursor
1833
+ # @return [Object]
1834
+ def twitter_get_tweet_retweeters(tweet_id, opts = {})
1835
+ data, _status_code, _headers = twitter_get_tweet_retweeters_with_http_info(tweet_id, opts)
1836
+ data
1837
+ end
1838
+
1839
+ # Get tweet retweeters
1840
+ # Get users who retweeted a specific tweet.
1841
+ # @param tweet_id [String]
1842
+ # @param [Hash] opts the optional parameters
1843
+ # @option opts [String] :cursor
1844
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1845
+ def twitter_get_tweet_retweeters_with_http_info(tweet_id, opts = {})
1846
+ if @api_client.config.debugging
1847
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_tweet_retweeters ...'
1848
+ end
1849
+ # verify the required parameter 'tweet_id' is set
1850
+ if @api_client.config.client_side_validation && tweet_id.nil?
1851
+ fail ArgumentError, "Missing the required parameter 'tweet_id' when calling TwitterApi.twitter_get_tweet_retweeters"
1852
+ end
1853
+ # resource path
1854
+ local_var_path = '/v1/twitter/tweets/tweet/{tweet_id}/retweeters'.sub('{' + 'tweet_id' + '}', CGI.escape(tweet_id.to_s))
1855
+
1856
+ # query parameters
1857
+ query_params = opts[:query_params] || {}
1858
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1859
+
1860
+ # header parameters
1861
+ header_params = opts[:header_params] || {}
1862
+ # HTTP header 'Accept' (if needed)
1863
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1864
+
1865
+ # form parameters
1866
+ form_params = opts[:form_params] || {}
1867
+
1868
+ # http body (model)
1869
+ post_body = opts[:debug_body]
1870
+
1871
+ # return_type
1872
+ return_type = opts[:debug_return_type] || 'Object'
1873
+
1874
+ # auth_names
1875
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1876
+
1877
+ new_options = opts.merge(
1878
+ :operation => :"TwitterApi.twitter_get_tweet_retweeters",
1879
+ :header_params => header_params,
1880
+ :query_params => query_params,
1881
+ :form_params => form_params,
1882
+ :body => post_body,
1883
+ :auth_names => auth_names,
1884
+ :return_type => return_type
1885
+ )
1886
+
1887
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1888
+ if @api_client.config.debugging
1889
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_tweet_retweeters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1890
+ end
1891
+ return data, status_code, headers
1892
+ end
1893
+
1894
+ # Get tweets by IDs
1895
+ # Get multiple tweets by their IDs.
1896
+ # @param tweets [String]
1897
+ # @param [Hash] opts the optional parameters
1898
+ # @return [Object]
1899
+ def twitter_get_tweets_by_ids(tweets, opts = {})
1900
+ data, _status_code, _headers = twitter_get_tweets_by_ids_with_http_info(tweets, opts)
1901
+ data
1902
+ end
1903
+
1904
+ # Get tweets by IDs
1905
+ # Get multiple tweets by their IDs.
1906
+ # @param tweets [String]
1907
+ # @param [Hash] opts the optional parameters
1908
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1909
+ def twitter_get_tweets_by_ids_with_http_info(tweets, opts = {})
1910
+ if @api_client.config.debugging
1911
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_tweets_by_ids ...'
1912
+ end
1913
+ # verify the required parameter 'tweets' is set
1914
+ if @api_client.config.client_side_validation && tweets.nil?
1915
+ fail ArgumentError, "Missing the required parameter 'tweets' when calling TwitterApi.twitter_get_tweets_by_ids"
1916
+ end
1917
+ # resource path
1918
+ local_var_path = '/v1/twitter/tweets/'
1919
+
1920
+ # query parameters
1921
+ query_params = opts[:query_params] || {}
1922
+ query_params[:'tweets'] = tweets
1923
+
1924
+ # header parameters
1925
+ header_params = opts[:header_params] || {}
1926
+ # HTTP header 'Accept' (if needed)
1927
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1928
+
1929
+ # form parameters
1930
+ form_params = opts[:form_params] || {}
1931
+
1932
+ # http body (model)
1933
+ post_body = opts[:debug_body]
1934
+
1935
+ # return_type
1936
+ return_type = opts[:debug_return_type] || 'Object'
1937
+
1938
+ # auth_names
1939
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1940
+
1941
+ new_options = opts.merge(
1942
+ :operation => :"TwitterApi.twitter_get_tweets_by_ids",
1943
+ :header_params => header_params,
1944
+ :query_params => query_params,
1945
+ :form_params => form_params,
1946
+ :body => post_body,
1947
+ :auth_names => auth_names,
1948
+ :return_type => return_type
1949
+ )
1950
+
1951
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1952
+ if @api_client.config.debugging
1953
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_tweets_by_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1954
+ end
1955
+ return data, status_code, headers
1956
+ end
1957
+
1958
+ # Get user articles
1959
+ # Get long-form articles written by a user.
1960
+ # @param user_id [String]
1961
+ # @param [Hash] opts the optional parameters
1962
+ # @option opts [String] :cursor
1963
+ # @return [Object]
1964
+ def twitter_get_user_articles(user_id, opts = {})
1965
+ data, _status_code, _headers = twitter_get_user_articles_with_http_info(user_id, opts)
1966
+ data
1967
+ end
1968
+
1969
+ # Get user articles
1970
+ # Get long-form articles written by a user.
1971
+ # @param user_id [String]
1972
+ # @param [Hash] opts the optional parameters
1973
+ # @option opts [String] :cursor
1974
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1975
+ def twitter_get_user_articles_with_http_info(user_id, opts = {})
1976
+ if @api_client.config.debugging
1977
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_user_articles ...'
1978
+ end
1979
+ # verify the required parameter 'user_id' is set
1980
+ if @api_client.config.client_side_validation && user_id.nil?
1981
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling TwitterApi.twitter_get_user_articles"
1982
+ end
1983
+ # resource path
1984
+ local_var_path = '/v1/twitter/users/{user_id}/articles'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
1985
+
1986
+ # query parameters
1987
+ query_params = opts[:query_params] || {}
1988
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1989
+
1990
+ # header parameters
1991
+ header_params = opts[:header_params] || {}
1992
+ # HTTP header 'Accept' (if needed)
1993
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1994
+
1995
+ # form parameters
1996
+ form_params = opts[:form_params] || {}
1997
+
1998
+ # http body (model)
1999
+ post_body = opts[:debug_body]
2000
+
2001
+ # return_type
2002
+ return_type = opts[:debug_return_type] || 'Object'
2003
+
2004
+ # auth_names
2005
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2006
+
2007
+ new_options = opts.merge(
2008
+ :operation => :"TwitterApi.twitter_get_user_articles",
2009
+ :header_params => header_params,
2010
+ :query_params => query_params,
2011
+ :form_params => form_params,
2012
+ :body => post_body,
2013
+ :auth_names => auth_names,
2014
+ :return_type => return_type
2015
+ )
2016
+
2017
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2018
+ if @api_client.config.debugging
2019
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_user_articles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2020
+ end
2021
+ return data, status_code, headers
2022
+ end
2023
+
2024
+ # Get user by ID
2025
+ # Get user profile by user ID.
2026
+ # @param user_id [String]
2027
+ # @param [Hash] opts the optional parameters
2028
+ # @return [Object]
2029
+ def twitter_get_user_by_id(user_id, opts = {})
2030
+ data, _status_code, _headers = twitter_get_user_by_id_with_http_info(user_id, opts)
2031
+ data
2032
+ end
2033
+
2034
+ # Get user by ID
2035
+ # Get user profile by user ID.
2036
+ # @param user_id [String]
2037
+ # @param [Hash] opts the optional parameters
2038
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
2039
+ def twitter_get_user_by_id_with_http_info(user_id, opts = {})
2040
+ if @api_client.config.debugging
2041
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_user_by_id ...'
2042
+ end
2043
+ # verify the required parameter 'user_id' is set
2044
+ if @api_client.config.client_side_validation && user_id.nil?
2045
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling TwitterApi.twitter_get_user_by_id"
2046
+ end
2047
+ # resource path
2048
+ local_var_path = '/v1/twitter/users/{user_id}/by_id'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
2049
+
2050
+ # query parameters
2051
+ query_params = opts[:query_params] || {}
2052
+
2053
+ # header parameters
2054
+ header_params = opts[:header_params] || {}
2055
+ # HTTP header 'Accept' (if needed)
2056
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2057
+
2058
+ # form parameters
2059
+ form_params = opts[:form_params] || {}
2060
+
2061
+ # http body (model)
2062
+ post_body = opts[:debug_body]
2063
+
2064
+ # return_type
2065
+ return_type = opts[:debug_return_type] || 'Object'
2066
+
2067
+ # auth_names
2068
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2069
+
2070
+ new_options = opts.merge(
2071
+ :operation => :"TwitterApi.twitter_get_user_by_id",
2072
+ :header_params => header_params,
2073
+ :query_params => query_params,
2074
+ :form_params => form_params,
2075
+ :body => post_body,
2076
+ :auth_names => auth_names,
2077
+ :return_type => return_type
2078
+ )
2079
+
2080
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2081
+ if @api_client.config.debugging
2082
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_user_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2083
+ end
2084
+ return data, status_code, headers
2085
+ end
2086
+
2087
+ # Get user by username
2088
+ # Get user profile by username.
2089
+ # @param username [String]
2090
+ # @param [Hash] opts the optional parameters
2091
+ # @return [Object]
2092
+ def twitter_get_user_by_username(username, opts = {})
2093
+ data, _status_code, _headers = twitter_get_user_by_username_with_http_info(username, opts)
2094
+ data
2095
+ end
2096
+
2097
+ # Get user by username
2098
+ # Get user profile by username.
2099
+ # @param username [String]
2100
+ # @param [Hash] opts the optional parameters
2101
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
2102
+ def twitter_get_user_by_username_with_http_info(username, opts = {})
2103
+ if @api_client.config.debugging
2104
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_user_by_username ...'
2105
+ end
2106
+ # verify the required parameter 'username' is set
2107
+ if @api_client.config.client_side_validation && username.nil?
2108
+ fail ArgumentError, "Missing the required parameter 'username' when calling TwitterApi.twitter_get_user_by_username"
2109
+ end
2110
+ # resource path
2111
+ local_var_path = '/v1/twitter/users/{username}/by_username'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
2112
+
2113
+ # query parameters
2114
+ query_params = opts[:query_params] || {}
2115
+
2116
+ # header parameters
2117
+ header_params = opts[:header_params] || {}
2118
+ # HTTP header 'Accept' (if needed)
2119
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2120
+
2121
+ # form parameters
2122
+ form_params = opts[:form_params] || {}
2123
+
2124
+ # http body (model)
2125
+ post_body = opts[:debug_body]
2126
+
2127
+ # return_type
2128
+ return_type = opts[:debug_return_type] || 'Object'
2129
+
2130
+ # auth_names
2131
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2132
+
2133
+ new_options = opts.merge(
2134
+ :operation => :"TwitterApi.twitter_get_user_by_username",
2135
+ :header_params => header_params,
2136
+ :query_params => query_params,
2137
+ :form_params => form_params,
2138
+ :body => post_body,
2139
+ :auth_names => auth_names,
2140
+ :return_type => return_type
2141
+ )
2142
+
2143
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2144
+ if @api_client.config.debugging
2145
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_user_by_username\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2146
+ end
2147
+ return data, status_code, headers
2148
+ end
2149
+
2150
+ # Get user followers
2151
+ # Get followers of a specific user.
2152
+ # @param username [String]
2153
+ # @param [Hash] opts the optional parameters
2154
+ # @option opts [String] :cursor
2155
+ # @return [Object]
2156
+ def twitter_get_user_followers(username, opts = {})
2157
+ data, _status_code, _headers = twitter_get_user_followers_with_http_info(username, opts)
2158
+ data
2159
+ end
2160
+
2161
+ # Get user followers
2162
+ # Get followers of a specific user.
2163
+ # @param username [String]
2164
+ # @param [Hash] opts the optional parameters
2165
+ # @option opts [String] :cursor
2166
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
2167
+ def twitter_get_user_followers_with_http_info(username, opts = {})
2168
+ if @api_client.config.debugging
2169
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_user_followers ...'
2170
+ end
2171
+ # verify the required parameter 'username' is set
2172
+ if @api_client.config.client_side_validation && username.nil?
2173
+ fail ArgumentError, "Missing the required parameter 'username' when calling TwitterApi.twitter_get_user_followers"
2174
+ end
2175
+ # resource path
2176
+ local_var_path = '/v1/twitter/users/{username}/followers'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
2177
+
2178
+ # query parameters
2179
+ query_params = opts[:query_params] || {}
2180
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2181
+
2182
+ # header parameters
2183
+ header_params = opts[:header_params] || {}
2184
+ # HTTP header 'Accept' (if needed)
2185
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2186
+
2187
+ # form parameters
2188
+ form_params = opts[:form_params] || {}
2189
+
2190
+ # http body (model)
2191
+ post_body = opts[:debug_body]
2192
+
2193
+ # return_type
2194
+ return_type = opts[:debug_return_type] || 'Object'
2195
+
2196
+ # auth_names
2197
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2198
+
2199
+ new_options = opts.merge(
2200
+ :operation => :"TwitterApi.twitter_get_user_followers",
2201
+ :header_params => header_params,
2202
+ :query_params => query_params,
2203
+ :form_params => form_params,
2204
+ :body => post_body,
2205
+ :auth_names => auth_names,
2206
+ :return_type => return_type
2207
+ )
2208
+
2209
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2210
+ if @api_client.config.debugging
2211
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_user_followers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2212
+ end
2213
+ return data, status_code, headers
2214
+ end
2215
+
2216
+ # Get user following
2217
+ # Get users that a specific user is following.
2218
+ # @param username [String]
2219
+ # @param [Hash] opts the optional parameters
2220
+ # @option opts [String] :cursor
2221
+ # @return [Object]
2222
+ def twitter_get_user_following(username, opts = {})
2223
+ data, _status_code, _headers = twitter_get_user_following_with_http_info(username, opts)
2224
+ data
2225
+ end
2226
+
2227
+ # Get user following
2228
+ # Get users that a specific user is following.
2229
+ # @param username [String]
2230
+ # @param [Hash] opts the optional parameters
2231
+ # @option opts [String] :cursor
2232
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
2233
+ def twitter_get_user_following_with_http_info(username, opts = {})
2234
+ if @api_client.config.debugging
2235
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_user_following ...'
2236
+ end
2237
+ # verify the required parameter 'username' is set
2238
+ if @api_client.config.client_side_validation && username.nil?
2239
+ fail ArgumentError, "Missing the required parameter 'username' when calling TwitterApi.twitter_get_user_following"
2240
+ end
2241
+ # resource path
2242
+ local_var_path = '/v1/twitter/users/{username}/followings'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
2243
+
2244
+ # query parameters
2245
+ query_params = opts[:query_params] || {}
2246
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2247
+
2248
+ # header parameters
2249
+ header_params = opts[:header_params] || {}
2250
+ # HTTP header 'Accept' (if needed)
2251
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2252
+
2253
+ # form parameters
2254
+ form_params = opts[:form_params] || {}
2255
+
2256
+ # http body (model)
2257
+ post_body = opts[:debug_body]
2258
+
2259
+ # return_type
2260
+ return_type = opts[:debug_return_type] || 'Object'
2261
+
2262
+ # auth_names
2263
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2264
+
2265
+ new_options = opts.merge(
2266
+ :operation => :"TwitterApi.twitter_get_user_following",
2267
+ :header_params => header_params,
2268
+ :query_params => query_params,
2269
+ :form_params => form_params,
2270
+ :body => post_body,
2271
+ :auth_names => auth_names,
2272
+ :return_type => return_type
2273
+ )
2274
+
2275
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2276
+ if @api_client.config.debugging
2277
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_user_following\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2278
+ end
2279
+ return data, status_code, headers
2280
+ end
2281
+
2282
+ # Get user mentions
2283
+ # Get tweets mentioning a specific user.
2284
+ # @param username [String]
2285
+ # @param [Hash] opts the optional parameters
2286
+ # @option opts [Integer] :count
2287
+ # @option opts [String] :cursor
2288
+ # @return [Object]
2289
+ def twitter_get_user_mentions(username, opts = {})
2290
+ data, _status_code, _headers = twitter_get_user_mentions_with_http_info(username, opts)
2291
+ data
2292
+ end
2293
+
2294
+ # Get user mentions
2295
+ # Get tweets mentioning a specific user.
2296
+ # @param username [String]
2297
+ # @param [Hash] opts the optional parameters
2298
+ # @option opts [Integer] :count
2299
+ # @option opts [String] :cursor
2300
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
2301
+ def twitter_get_user_mentions_with_http_info(username, opts = {})
2302
+ if @api_client.config.debugging
2303
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_user_mentions ...'
2304
+ end
2305
+ # verify the required parameter 'username' is set
2306
+ if @api_client.config.client_side_validation && username.nil?
2307
+ fail ArgumentError, "Missing the required parameter 'username' when calling TwitterApi.twitter_get_user_mentions"
2308
+ end
2309
+ # resource path
2310
+ local_var_path = '/v1/twitter/users/{username}/mentions'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
2311
+
2312
+ # query parameters
2313
+ query_params = opts[:query_params] || {}
2314
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
2315
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2316
+
2317
+ # header parameters
2318
+ header_params = opts[:header_params] || {}
2319
+ # HTTP header 'Accept' (if needed)
2320
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2321
+
2322
+ # form parameters
2323
+ form_params = opts[:form_params] || {}
2324
+
2325
+ # http body (model)
2326
+ post_body = opts[:debug_body]
2327
+
2328
+ # return_type
2329
+ return_type = opts[:debug_return_type] || 'Object'
2330
+
2331
+ # auth_names
2332
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2333
+
2334
+ new_options = opts.merge(
2335
+ :operation => :"TwitterApi.twitter_get_user_mentions",
2336
+ :header_params => header_params,
2337
+ :query_params => query_params,
2338
+ :form_params => form_params,
2339
+ :body => post_body,
2340
+ :auth_names => auth_names,
2341
+ :return_type => return_type
2342
+ )
2343
+
2344
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2345
+ if @api_client.config.debugging
2346
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_user_mentions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2347
+ end
2348
+ return data, status_code, headers
2349
+ end
2350
+
2351
+ # Get user subscriptions
2352
+ # Get subscriptions of a specific user.
2353
+ # @param user_id [String]
2354
+ # @param [Hash] opts the optional parameters
2355
+ # @option opts [String] :cursor
2356
+ # @return [Object]
2357
+ def twitter_get_user_subscriptions(user_id, opts = {})
2358
+ data, _status_code, _headers = twitter_get_user_subscriptions_with_http_info(user_id, opts)
2359
+ data
2360
+ end
2361
+
2362
+ # Get user subscriptions
2363
+ # Get subscriptions of a specific user.
2364
+ # @param user_id [String]
2365
+ # @param [Hash] opts the optional parameters
2366
+ # @option opts [String] :cursor
2367
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
2368
+ def twitter_get_user_subscriptions_with_http_info(user_id, opts = {})
2369
+ if @api_client.config.debugging
2370
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_user_subscriptions ...'
2371
+ end
2372
+ # verify the required parameter 'user_id' is set
2373
+ if @api_client.config.client_side_validation && user_id.nil?
2374
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling TwitterApi.twitter_get_user_subscriptions"
2375
+ end
2376
+ # resource path
2377
+ local_var_path = '/v1/twitter/users/{user_id}/subscriptions'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
2378
+
2379
+ # query parameters
2380
+ query_params = opts[:query_params] || {}
2381
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2382
+
2383
+ # header parameters
2384
+ header_params = opts[:header_params] || {}
2385
+ # HTTP header 'Accept' (if needed)
2386
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2387
+
2388
+ # form parameters
2389
+ form_params = opts[:form_params] || {}
2390
+
2391
+ # http body (model)
2392
+ post_body = opts[:debug_body]
2393
+
2394
+ # return_type
2395
+ return_type = opts[:debug_return_type] || 'Object'
2396
+
2397
+ # auth_names
2398
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2399
+
2400
+ new_options = opts.merge(
2401
+ :operation => :"TwitterApi.twitter_get_user_subscriptions",
2402
+ :header_params => header_params,
2403
+ :query_params => query_params,
2404
+ :form_params => form_params,
2405
+ :body => post_body,
2406
+ :auth_names => auth_names,
2407
+ :return_type => return_type
2408
+ )
2409
+
2410
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2411
+ if @api_client.config.debugging
2412
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_user_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2413
+ end
2414
+ return data, status_code, headers
2415
+ end
2416
+
2417
+ # Get user tweets
2418
+ # Get latest tweets from a specific user.
2419
+ # @param username [String]
2420
+ # @param [Hash] opts the optional parameters
2421
+ # @option opts [String] :cursor
2422
+ # @return [Object]
2423
+ def twitter_get_user_tweets(username, opts = {})
2424
+ data, _status_code, _headers = twitter_get_user_tweets_with_http_info(username, opts)
2425
+ data
2426
+ end
2427
+
2428
+ # Get user tweets
2429
+ # Get latest tweets from a specific user.
2430
+ # @param username [String]
2431
+ # @param [Hash] opts the optional parameters
2432
+ # @option opts [String] :cursor
2433
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
2434
+ def twitter_get_user_tweets_with_http_info(username, opts = {})
2435
+ if @api_client.config.debugging
2436
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_get_user_tweets ...'
2437
+ end
2438
+ # verify the required parameter 'username' is set
2439
+ if @api_client.config.client_side_validation && username.nil?
2440
+ fail ArgumentError, "Missing the required parameter 'username' when calling TwitterApi.twitter_get_user_tweets"
2441
+ end
2442
+ # resource path
2443
+ local_var_path = '/v1/twitter/users/{username}/latest_tweets'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
2444
+
2445
+ # query parameters
2446
+ query_params = opts[:query_params] || {}
2447
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2448
+
2449
+ # header parameters
2450
+ header_params = opts[:header_params] || {}
2451
+ # HTTP header 'Accept' (if needed)
2452
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2453
+
2454
+ # form parameters
2455
+ form_params = opts[:form_params] || {}
2456
+
2457
+ # http body (model)
2458
+ post_body = opts[:debug_body]
2459
+
2460
+ # return_type
2461
+ return_type = opts[:debug_return_type] || 'Object'
2462
+
2463
+ # auth_names
2464
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2465
+
2466
+ new_options = opts.merge(
2467
+ :operation => :"TwitterApi.twitter_get_user_tweets",
2468
+ :header_params => header_params,
2469
+ :query_params => query_params,
2470
+ :form_params => form_params,
2471
+ :body => post_body,
2472
+ :auth_names => auth_names,
2473
+ :return_type => return_type
2474
+ )
2475
+
2476
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2477
+ if @api_client.config.debugging
2478
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_get_user_tweets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2479
+ end
2480
+ return data, status_code, headers
2481
+ end
2482
+
2483
+ # List billing logs
2484
+ # List billing activity logs for the authenticated API key's monitors.
2485
+ # @param [Hash] opts the optional parameters
2486
+ # @option opts [String] :monitor_id
2487
+ # @option opts [Integer] :page (default to 1)
2488
+ # @option opts [Integer] :page_size (default to 20)
2489
+ # @return [BillingLogListResponse]
2490
+ def twitter_list_billing_logs(opts = {})
2491
+ data, _status_code, _headers = twitter_list_billing_logs_with_http_info(opts)
2492
+ data
2493
+ end
2494
+
2495
+ # List billing logs
2496
+ # List billing activity logs for the authenticated API key&#39;s monitors.
2497
+ # @param [Hash] opts the optional parameters
2498
+ # @option opts [String] :monitor_id
2499
+ # @option opts [Integer] :page (default to 1)
2500
+ # @option opts [Integer] :page_size (default to 20)
2501
+ # @return [Array<(BillingLogListResponse, Integer, Hash)>] BillingLogListResponse data, response status code and response headers
2502
+ def twitter_list_billing_logs_with_http_info(opts = {})
2503
+ if @api_client.config.debugging
2504
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_list_billing_logs ...'
2505
+ end
2506
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
2507
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling TwitterApi.twitter_list_billing_logs, must be greater than or equal to 1.'
2508
+ end
2509
+
2510
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
2511
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TwitterApi.twitter_list_billing_logs, must be smaller than or equal to 100.'
2512
+ end
2513
+
2514
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
2515
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TwitterApi.twitter_list_billing_logs, must be greater than or equal to 1.'
2516
+ end
2517
+
2518
+ # resource path
2519
+ local_var_path = '/v1/twitter/stream/billing-logs'
2520
+
2521
+ # query parameters
2522
+ query_params = opts[:query_params] || {}
2523
+ query_params[:'monitor_id'] = opts[:'monitor_id'] if !opts[:'monitor_id'].nil?
2524
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
2525
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
2526
+
2527
+ # header parameters
2528
+ header_params = opts[:header_params] || {}
2529
+ # HTTP header 'Accept' (if needed)
2530
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2531
+
2532
+ # form parameters
2533
+ form_params = opts[:form_params] || {}
2534
+
2535
+ # http body (model)
2536
+ post_body = opts[:debug_body]
2537
+
2538
+ # return_type
2539
+ return_type = opts[:debug_return_type] || 'BillingLogListResponse'
2540
+
2541
+ # auth_names
2542
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2543
+
2544
+ new_options = opts.merge(
2545
+ :operation => :"TwitterApi.twitter_list_billing_logs",
2546
+ :header_params => header_params,
2547
+ :query_params => query_params,
2548
+ :form_params => form_params,
2549
+ :body => post_body,
2550
+ :auth_names => auth_names,
2551
+ :return_type => return_type
2552
+ )
2553
+
2554
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2555
+ if @api_client.config.debugging
2556
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_list_billing_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2557
+ end
2558
+ return data, status_code, headers
2559
+ end
2560
+
2561
+ # List delivery logs for a filter rule
2562
+ # List tweet delivery logs for a specific filter rule.
2563
+ # @param rule_id [String]
2564
+ # @param [Hash] opts the optional parameters
2565
+ # @option opts [String] :delivery_status
2566
+ # @option opts [String] :author_username
2567
+ # @option opts [Integer] :page (default to 1)
2568
+ # @option opts [Integer] :page_size (default to 20)
2569
+ # @option opts [String] :sort (default to 'desc')
2570
+ # @return [FilterRuleDeliveryLogListResponse]
2571
+ def twitter_list_delivery_logs_for_a_filter_rule(rule_id, opts = {})
2572
+ data, _status_code, _headers = twitter_list_delivery_logs_for_a_filter_rule_with_http_info(rule_id, opts)
2573
+ data
2574
+ end
2575
+
2576
+ # List delivery logs for a filter rule
2577
+ # List tweet delivery logs for a specific filter rule.
2578
+ # @param rule_id [String]
2579
+ # @param [Hash] opts the optional parameters
2580
+ # @option opts [String] :delivery_status
2581
+ # @option opts [String] :author_username
2582
+ # @option opts [Integer] :page (default to 1)
2583
+ # @option opts [Integer] :page_size (default to 20)
2584
+ # @option opts [String] :sort (default to 'desc')
2585
+ # @return [Array<(FilterRuleDeliveryLogListResponse, Integer, Hash)>] FilterRuleDeliveryLogListResponse data, response status code and response headers
2586
+ def twitter_list_delivery_logs_for_a_filter_rule_with_http_info(rule_id, opts = {})
2587
+ if @api_client.config.debugging
2588
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_list_delivery_logs_for_a_filter_rule ...'
2589
+ end
2590
+ # verify the required parameter 'rule_id' is set
2591
+ if @api_client.config.client_side_validation && rule_id.nil?
2592
+ fail ArgumentError, "Missing the required parameter 'rule_id' when calling TwitterApi.twitter_list_delivery_logs_for_a_filter_rule"
2593
+ end
2594
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
2595
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling TwitterApi.twitter_list_delivery_logs_for_a_filter_rule, must be greater than or equal to 1.'
2596
+ end
2597
+
2598
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
2599
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TwitterApi.twitter_list_delivery_logs_for_a_filter_rule, must be smaller than or equal to 100.'
2600
+ end
2601
+
2602
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
2603
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TwitterApi.twitter_list_delivery_logs_for_a_filter_rule, must be greater than or equal to 1.'
2604
+ end
2605
+
2606
+ allowable_values = ["asc", "desc"]
2607
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
2608
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
2609
+ end
2610
+ # resource path
2611
+ local_var_path = '/v1/twitter/stream/filter-rules/{rule_id}/logs'.sub('{' + 'rule_id' + '}', CGI.escape(rule_id.to_s))
2612
+
2613
+ # query parameters
2614
+ query_params = opts[:query_params] || {}
2615
+ query_params[:'delivery_status'] = opts[:'delivery_status'] if !opts[:'delivery_status'].nil?
2616
+ query_params[:'author_username'] = opts[:'author_username'] if !opts[:'author_username'].nil?
2617
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
2618
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
2619
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
2620
+
2621
+ # header parameters
2622
+ header_params = opts[:header_params] || {}
2623
+ # HTTP header 'Accept' (if needed)
2624
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2625
+
2626
+ # form parameters
2627
+ form_params = opts[:form_params] || {}
2628
+
2629
+ # http body (model)
2630
+ post_body = opts[:debug_body]
2631
+
2632
+ # return_type
2633
+ return_type = opts[:debug_return_type] || 'FilterRuleDeliveryLogListResponse'
2634
+
2635
+ # auth_names
2636
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2637
+
2638
+ new_options = opts.merge(
2639
+ :operation => :"TwitterApi.twitter_list_delivery_logs_for_a_filter_rule",
2640
+ :header_params => header_params,
2641
+ :query_params => query_params,
2642
+ :form_params => form_params,
2643
+ :body => post_body,
2644
+ :auth_names => auth_names,
2645
+ :return_type => return_type
2646
+ )
2647
+
2648
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2649
+ if @api_client.config.debugging
2650
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_list_delivery_logs_for_a_filter_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2651
+ end
2652
+ return data, status_code, headers
2653
+ end
2654
+
2655
+ # List filter rules
2656
+ # List all filter rules for the authenticated API key.
2657
+ # @param [Hash] opts the optional parameters
2658
+ # @option opts [String] :status
2659
+ # @option opts [Integer] :page (default to 1)
2660
+ # @option opts [Integer] :page_size (default to 20)
2661
+ # @return [FilterRuleListResponse]
2662
+ def twitter_list_filter_rules(opts = {})
2663
+ data, _status_code, _headers = twitter_list_filter_rules_with_http_info(opts)
2664
+ data
2665
+ end
2666
+
2667
+ # List filter rules
2668
+ # List all filter rules for the authenticated API key.
2669
+ # @param [Hash] opts the optional parameters
2670
+ # @option opts [String] :status
2671
+ # @option opts [Integer] :page (default to 1)
2672
+ # @option opts [Integer] :page_size (default to 20)
2673
+ # @return [Array<(FilterRuleListResponse, Integer, Hash)>] FilterRuleListResponse data, response status code and response headers
2674
+ def twitter_list_filter_rules_with_http_info(opts = {})
2675
+ if @api_client.config.debugging
2676
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_list_filter_rules ...'
2677
+ end
2678
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
2679
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling TwitterApi.twitter_list_filter_rules, must be greater than or equal to 1.'
2680
+ end
2681
+
2682
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
2683
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TwitterApi.twitter_list_filter_rules, must be smaller than or equal to 100.'
2684
+ end
2685
+
2686
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
2687
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TwitterApi.twitter_list_filter_rules, must be greater than or equal to 1.'
2688
+ end
2689
+
2690
+ # resource path
2691
+ local_var_path = '/v1/twitter/stream/filter-rules'
2692
+
2693
+ # query parameters
2694
+ query_params = opts[:query_params] || {}
2695
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
2696
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
2697
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
2698
+
2699
+ # header parameters
2700
+ header_params = opts[:header_params] || {}
2701
+ # HTTP header 'Accept' (if needed)
2702
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2703
+
2704
+ # form parameters
2705
+ form_params = opts[:form_params] || {}
2706
+
2707
+ # http body (model)
2708
+ post_body = opts[:debug_body]
2709
+
2710
+ # return_type
2711
+ return_type = opts[:debug_return_type] || 'FilterRuleListResponse'
2712
+
2713
+ # auth_names
2714
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2715
+
2716
+ new_options = opts.merge(
2717
+ :operation => :"TwitterApi.twitter_list_filter_rules",
2718
+ :header_params => header_params,
2719
+ :query_params => query_params,
2720
+ :form_params => form_params,
2721
+ :body => post_body,
2722
+ :auth_names => auth_names,
2723
+ :return_type => return_type
2724
+ )
2725
+
2726
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2727
+ if @api_client.config.debugging
2728
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_list_filter_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2729
+ end
2730
+ return data, status_code, headers
2731
+ end
2732
+
2733
+ # List stream monitors
2734
+ # List all stream monitors for the authenticated API key.
2735
+ # @param [Hash] opts the optional parameters
2736
+ # @option opts [String] :status
2737
+ # @option opts [Integer] :page (default to 1)
2738
+ # @option opts [Integer] :page_size (default to 20)
2739
+ # @return [StreamMonitorListResponse]
2740
+ def twitter_list_stream_monitors(opts = {})
2741
+ data, _status_code, _headers = twitter_list_stream_monitors_with_http_info(opts)
2742
+ data
2743
+ end
2744
+
2745
+ # List stream monitors
2746
+ # List all stream monitors for the authenticated API key.
2747
+ # @param [Hash] opts the optional parameters
2748
+ # @option opts [String] :status
2749
+ # @option opts [Integer] :page (default to 1)
2750
+ # @option opts [Integer] :page_size (default to 20)
2751
+ # @return [Array<(StreamMonitorListResponse, Integer, Hash)>] StreamMonitorListResponse data, response status code and response headers
2752
+ def twitter_list_stream_monitors_with_http_info(opts = {})
2753
+ if @api_client.config.debugging
2754
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_list_stream_monitors ...'
2755
+ end
2756
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
2757
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling TwitterApi.twitter_list_stream_monitors, must be greater than or equal to 1.'
2758
+ end
2759
+
2760
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
2761
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TwitterApi.twitter_list_stream_monitors, must be smaller than or equal to 100.'
2762
+ end
2763
+
2764
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
2765
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TwitterApi.twitter_list_stream_monitors, must be greater than or equal to 1.'
2766
+ end
2767
+
2768
+ # resource path
2769
+ local_var_path = '/v1/twitter/stream/monitors'
2770
+
2771
+ # query parameters
2772
+ query_params = opts[:query_params] || {}
2773
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
2774
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
2775
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
2776
+
2777
+ # header parameters
2778
+ header_params = opts[:header_params] || {}
2779
+ # HTTP header 'Accept' (if needed)
2780
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2781
+
2782
+ # form parameters
2783
+ form_params = opts[:form_params] || {}
2784
+
2785
+ # http body (model)
2786
+ post_body = opts[:debug_body]
2787
+
2788
+ # return_type
2789
+ return_type = opts[:debug_return_type] || 'StreamMonitorListResponse'
2790
+
2791
+ # auth_names
2792
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2793
+
2794
+ new_options = opts.merge(
2795
+ :operation => :"TwitterApi.twitter_list_stream_monitors",
2796
+ :header_params => header_params,
2797
+ :query_params => query_params,
2798
+ :form_params => form_params,
2799
+ :body => post_body,
2800
+ :auth_names => auth_names,
2801
+ :return_type => return_type
2802
+ )
2803
+
2804
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2805
+ if @api_client.config.debugging
2806
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_list_stream_monitors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2807
+ end
2808
+ return data, status_code, headers
2809
+ end
2810
+
2811
+ # List tweet delivery logs
2812
+ # List tweet delivery logs for the authenticated API key's monitors.
2813
+ # @param [Hash] opts the optional parameters
2814
+ # @option opts [String] :monitor_id
2815
+ # @option opts [String] :author_username
2816
+ # @option opts [String] :delivery_status
2817
+ # @option opts [Integer] :page (default to 1)
2818
+ # @option opts [Integer] :page_size (default to 20)
2819
+ # @option opts [String] :sort (default to 'desc')
2820
+ # @return [TweetDeliveryLogListResponse]
2821
+ def twitter_list_tweet_delivery_logs(opts = {})
2822
+ data, _status_code, _headers = twitter_list_tweet_delivery_logs_with_http_info(opts)
2823
+ data
2824
+ end
2825
+
2826
+ # List tweet delivery logs
2827
+ # List tweet delivery logs for the authenticated API key&#39;s monitors.
2828
+ # @param [Hash] opts the optional parameters
2829
+ # @option opts [String] :monitor_id
2830
+ # @option opts [String] :author_username
2831
+ # @option opts [String] :delivery_status
2832
+ # @option opts [Integer] :page (default to 1)
2833
+ # @option opts [Integer] :page_size (default to 20)
2834
+ # @option opts [String] :sort (default to 'desc')
2835
+ # @return [Array<(TweetDeliveryLogListResponse, Integer, Hash)>] TweetDeliveryLogListResponse data, response status code and response headers
2836
+ def twitter_list_tweet_delivery_logs_with_http_info(opts = {})
2837
+ if @api_client.config.debugging
2838
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_list_tweet_delivery_logs ...'
2839
+ end
2840
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
2841
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling TwitterApi.twitter_list_tweet_delivery_logs, must be greater than or equal to 1.'
2842
+ end
2843
+
2844
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
2845
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TwitterApi.twitter_list_tweet_delivery_logs, must be smaller than or equal to 100.'
2846
+ end
2847
+
2848
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
2849
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TwitterApi.twitter_list_tweet_delivery_logs, must be greater than or equal to 1.'
2850
+ end
2851
+
2852
+ allowable_values = ["asc", "desc"]
2853
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
2854
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
2855
+ end
2856
+ # resource path
2857
+ local_var_path = '/v1/twitter/stream/logs'
2858
+
2859
+ # query parameters
2860
+ query_params = opts[:query_params] || {}
2861
+ query_params[:'monitor_id'] = opts[:'monitor_id'] if !opts[:'monitor_id'].nil?
2862
+ query_params[:'author_username'] = opts[:'author_username'] if !opts[:'author_username'].nil?
2863
+ query_params[:'delivery_status'] = opts[:'delivery_status'] if !opts[:'delivery_status'].nil?
2864
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
2865
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
2866
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
2867
+
2868
+ # header parameters
2869
+ header_params = opts[:header_params] || {}
2870
+ # HTTP header 'Accept' (if needed)
2871
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2872
+
2873
+ # form parameters
2874
+ form_params = opts[:form_params] || {}
2875
+
2876
+ # http body (model)
2877
+ post_body = opts[:debug_body]
2878
+
2879
+ # return_type
2880
+ return_type = opts[:debug_return_type] || 'TweetDeliveryLogListResponse'
2881
+
2882
+ # auth_names
2883
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2884
+
2885
+ new_options = opts.merge(
2886
+ :operation => :"TwitterApi.twitter_list_tweet_delivery_logs",
2887
+ :header_params => header_params,
2888
+ :query_params => query_params,
2889
+ :form_params => form_params,
2890
+ :body => post_body,
2891
+ :auth_names => auth_names,
2892
+ :return_type => return_type
2893
+ )
2894
+
2895
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2896
+ if @api_client.config.debugging
2897
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_list_tweet_delivery_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2898
+ end
2899
+ return data, status_code, headers
2900
+ end
2901
+
2902
+ # List webhooks
2903
+ # List all webhook-configured monitors for the authenticated API key.
2904
+ # @param [Hash] opts the optional parameters
2905
+ # @option opts [String] :monitor_id
2906
+ # @return [WebhookListResponse]
2907
+ def twitter_list_webhooks(opts = {})
2908
+ data, _status_code, _headers = twitter_list_webhooks_with_http_info(opts)
2909
+ data
2910
+ end
2911
+
2912
+ # List webhooks
2913
+ # List all webhook-configured monitors for the authenticated API key.
2914
+ # @param [Hash] opts the optional parameters
2915
+ # @option opts [String] :monitor_id
2916
+ # @return [Array<(WebhookListResponse, Integer, Hash)>] WebhookListResponse data, response status code and response headers
2917
+ def twitter_list_webhooks_with_http_info(opts = {})
2918
+ if @api_client.config.debugging
2919
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_list_webhooks ...'
2920
+ end
2921
+ # resource path
2922
+ local_var_path = '/v1/twitter/stream/webhooks'
2923
+
2924
+ # query parameters
2925
+ query_params = opts[:query_params] || {}
2926
+ query_params[:'monitor_id'] = opts[:'monitor_id'] if !opts[:'monitor_id'].nil?
2927
+
2928
+ # header parameters
2929
+ header_params = opts[:header_params] || {}
2930
+ # HTTP header 'Accept' (if needed)
2931
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2932
+
2933
+ # form parameters
2934
+ form_params = opts[:form_params] || {}
2935
+
2936
+ # http body (model)
2937
+ post_body = opts[:debug_body]
2938
+
2939
+ # return_type
2940
+ return_type = opts[:debug_return_type] || 'WebhookListResponse'
2941
+
2942
+ # auth_names
2943
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2944
+
2945
+ new_options = opts.merge(
2946
+ :operation => :"TwitterApi.twitter_list_webhooks",
2947
+ :header_params => header_params,
2948
+ :query_params => query_params,
2949
+ :form_params => form_params,
2950
+ :body => post_body,
2951
+ :auth_names => auth_names,
2952
+ :return_type => return_type
2953
+ )
2954
+
2955
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2956
+ if @api_client.config.debugging
2957
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_list_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2958
+ end
2959
+ return data, status_code, headers
2960
+ end
2961
+
2962
+ # Remove webhook from monitor
2963
+ # Remove webhook configuration from a monitor. webhook_id is the monitor_id.
2964
+ # @param webhook_id [String]
2965
+ # @param [Hash] opts the optional parameters
2966
+ # @return [nil]
2967
+ def twitter_remove_webhook_from_monitor(webhook_id, opts = {})
2968
+ twitter_remove_webhook_from_monitor_with_http_info(webhook_id, opts)
2969
+ nil
2970
+ end
2971
+
2972
+ # Remove webhook from monitor
2973
+ # Remove webhook configuration from a monitor. webhook_id is the monitor_id.
2974
+ # @param webhook_id [String]
2975
+ # @param [Hash] opts the optional parameters
2976
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
2977
+ def twitter_remove_webhook_from_monitor_with_http_info(webhook_id, opts = {})
2978
+ if @api_client.config.debugging
2979
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_remove_webhook_from_monitor ...'
2980
+ end
2981
+ # verify the required parameter 'webhook_id' is set
2982
+ if @api_client.config.client_side_validation && webhook_id.nil?
2983
+ fail ArgumentError, "Missing the required parameter 'webhook_id' when calling TwitterApi.twitter_remove_webhook_from_monitor"
2984
+ end
2985
+ # resource path
2986
+ local_var_path = '/v1/twitter/stream/webhooks/{webhook_id}'.sub('{' + 'webhook_id' + '}', CGI.escape(webhook_id.to_s))
2987
+
2988
+ # query parameters
2989
+ query_params = opts[:query_params] || {}
2990
+
2991
+ # header parameters
2992
+ header_params = opts[:header_params] || {}
2993
+ # HTTP header 'Accept' (if needed)
2994
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2995
+
2996
+ # form parameters
2997
+ form_params = opts[:form_params] || {}
2998
+
2999
+ # http body (model)
3000
+ post_body = opts[:debug_body]
3001
+
3002
+ # return_type
3003
+ return_type = opts[:debug_return_type]
3004
+
3005
+ # auth_names
3006
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
3007
+
3008
+ new_options = opts.merge(
3009
+ :operation => :"TwitterApi.twitter_remove_webhook_from_monitor",
3010
+ :header_params => header_params,
3011
+ :query_params => query_params,
3012
+ :form_params => form_params,
3013
+ :body => post_body,
3014
+ :auth_names => auth_names,
3015
+ :return_type => return_type
3016
+ )
3017
+
3018
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
3019
+ if @api_client.config.debugging
3020
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_remove_webhook_from_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3021
+ end
3022
+ return data, status_code, headers
3023
+ end
3024
+
3025
+ # Search communities
3026
+ # Search for communities by query.
3027
+ # @param query [String]
3028
+ # @param [Hash] opts the optional parameters
3029
+ # @option opts [String] :cursor
3030
+ # @return [Object]
3031
+ def twitter_search_communities(query, opts = {})
3032
+ data, _status_code, _headers = twitter_search_communities_with_http_info(query, opts)
3033
+ data
3034
+ end
3035
+
3036
+ # Search communities
3037
+ # Search for communities by query.
3038
+ # @param query [String]
3039
+ # @param [Hash] opts the optional parameters
3040
+ # @option opts [String] :cursor
3041
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
3042
+ def twitter_search_communities_with_http_info(query, opts = {})
3043
+ if @api_client.config.debugging
3044
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_search_communities ...'
3045
+ end
3046
+ # verify the required parameter 'query' is set
3047
+ if @api_client.config.client_side_validation && query.nil?
3048
+ fail ArgumentError, "Missing the required parameter 'query' when calling TwitterApi.twitter_search_communities"
3049
+ end
3050
+ # resource path
3051
+ local_var_path = '/v1/twitter/communities/search'
3052
+
3053
+ # query parameters
3054
+ query_params = opts[:query_params] || {}
3055
+ query_params[:'query'] = query
3056
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
3057
+
3058
+ # header parameters
3059
+ header_params = opts[:header_params] || {}
3060
+ # HTTP header 'Accept' (if needed)
3061
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3062
+
3063
+ # form parameters
3064
+ form_params = opts[:form_params] || {}
3065
+
3066
+ # http body (model)
3067
+ post_body = opts[:debug_body]
3068
+
3069
+ # return_type
3070
+ return_type = opts[:debug_return_type] || 'Object'
3071
+
3072
+ # auth_names
3073
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
3074
+
3075
+ new_options = opts.merge(
3076
+ :operation => :"TwitterApi.twitter_search_communities",
3077
+ :header_params => header_params,
3078
+ :query_params => query_params,
3079
+ :form_params => form_params,
3080
+ :body => post_body,
3081
+ :auth_names => auth_names,
3082
+ :return_type => return_type
3083
+ )
3084
+
3085
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3086
+ if @api_client.config.debugging
3087
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_search_communities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3088
+ end
3089
+ return data, status_code, headers
3090
+ end
3091
+
3092
+ # Search list tweets
3093
+ # Search tweets within a specific list.
3094
+ # @param list_id [String]
3095
+ # @param query [String]
3096
+ # @param [Hash] opts the optional parameters
3097
+ # @option opts [String] :cursor
3098
+ # @return [Object]
3099
+ def twitter_search_list_tweets(list_id, query, opts = {})
3100
+ data, _status_code, _headers = twitter_search_list_tweets_with_http_info(list_id, query, opts)
3101
+ data
3102
+ end
3103
+
3104
+ # Search list tweets
3105
+ # Search tweets within a specific list.
3106
+ # @param list_id [String]
3107
+ # @param query [String]
3108
+ # @param [Hash] opts the optional parameters
3109
+ # @option opts [String] :cursor
3110
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
3111
+ def twitter_search_list_tweets_with_http_info(list_id, query, opts = {})
3112
+ if @api_client.config.debugging
3113
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_search_list_tweets ...'
3114
+ end
3115
+ # verify the required parameter 'list_id' is set
3116
+ if @api_client.config.client_side_validation && list_id.nil?
3117
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling TwitterApi.twitter_search_list_tweets"
3118
+ end
3119
+ # verify the required parameter 'query' is set
3120
+ if @api_client.config.client_side_validation && query.nil?
3121
+ fail ArgumentError, "Missing the required parameter 'query' when calling TwitterApi.twitter_search_list_tweets"
3122
+ end
3123
+ # resource path
3124
+ local_var_path = '/v1/twitter/lists/{list_id}/search_tweets'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
3125
+
3126
+ # query parameters
3127
+ query_params = opts[:query_params] || {}
3128
+ query_params[:'query'] = query
3129
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
3130
+
3131
+ # header parameters
3132
+ header_params = opts[:header_params] || {}
3133
+ # HTTP header 'Accept' (if needed)
3134
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3135
+
3136
+ # form parameters
3137
+ form_params = opts[:form_params] || {}
3138
+
3139
+ # http body (model)
3140
+ post_body = opts[:debug_body]
3141
+
3142
+ # return_type
3143
+ return_type = opts[:debug_return_type] || 'Object'
3144
+
3145
+ # auth_names
3146
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
3147
+
3148
+ new_options = opts.merge(
3149
+ :operation => :"TwitterApi.twitter_search_list_tweets",
3150
+ :header_params => header_params,
3151
+ :query_params => query_params,
3152
+ :form_params => form_params,
3153
+ :body => post_body,
3154
+ :auth_names => auth_names,
3155
+ :return_type => return_type
3156
+ )
3157
+
3158
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3159
+ if @api_client.config.debugging
3160
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_search_list_tweets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3161
+ end
3162
+ return data, status_code, headers
3163
+ end
3164
+
3165
+ # Search places
3166
+ # Search for places by query or coordinates.
3167
+ # @param [Hash] opts the optional parameters
3168
+ # @option opts [String] :query
3169
+ # @option opts [Float] :lat
3170
+ # @option opts [Float] :long
3171
+ # @return [Object]
3172
+ def twitter_search_places(opts = {})
3173
+ data, _status_code, _headers = twitter_search_places_with_http_info(opts)
3174
+ data
3175
+ end
3176
+
3177
+ # Search places
3178
+ # Search for places by query or coordinates.
3179
+ # @param [Hash] opts the optional parameters
3180
+ # @option opts [String] :query
3181
+ # @option opts [Float] :lat
3182
+ # @option opts [Float] :long
3183
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
3184
+ def twitter_search_places_with_http_info(opts = {})
3185
+ if @api_client.config.debugging
3186
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_search_places ...'
3187
+ end
3188
+ # resource path
3189
+ local_var_path = '/v1/twitter/geo/search'
3190
+
3191
+ # query parameters
3192
+ query_params = opts[:query_params] || {}
3193
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
3194
+ query_params[:'lat'] = opts[:'lat'] if !opts[:'lat'].nil?
3195
+ query_params[:'long'] = opts[:'long'] if !opts[:'long'].nil?
3196
+
3197
+ # header parameters
3198
+ header_params = opts[:header_params] || {}
3199
+ # HTTP header 'Accept' (if needed)
3200
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3201
+
3202
+ # form parameters
3203
+ form_params = opts[:form_params] || {}
3204
+
3205
+ # http body (model)
3206
+ post_body = opts[:debug_body]
3207
+
3208
+ # return_type
3209
+ return_type = opts[:debug_return_type] || 'Object'
3210
+
3211
+ # auth_names
3212
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
3213
+
3214
+ new_options = opts.merge(
3215
+ :operation => :"TwitterApi.twitter_search_places",
3216
+ :header_params => header_params,
3217
+ :query_params => query_params,
3218
+ :form_params => form_params,
3219
+ :body => post_body,
3220
+ :auth_names => auth_names,
3221
+ :return_type => return_type
3222
+ )
3223
+
3224
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3225
+ if @api_client.config.debugging
3226
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_search_places\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3227
+ end
3228
+ return data, status_code, headers
3229
+ end
3230
+
3231
+ # Search users
3232
+ # Search for users by query.
3233
+ # @param query [String]
3234
+ # @param [Hash] opts the optional parameters
3235
+ # @option opts [String] :cursor
3236
+ # @return [Object]
3237
+ def twitter_search_users(query, opts = {})
3238
+ data, _status_code, _headers = twitter_search_users_with_http_info(query, opts)
3239
+ data
3240
+ end
3241
+
3242
+ # Search users
3243
+ # Search for users by query.
3244
+ # @param query [String]
3245
+ # @param [Hash] opts the optional parameters
3246
+ # @option opts [String] :cursor
3247
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
3248
+ def twitter_search_users_with_http_info(query, opts = {})
3249
+ if @api_client.config.debugging
3250
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_search_users ...'
3251
+ end
3252
+ # verify the required parameter 'query' is set
3253
+ if @api_client.config.client_side_validation && query.nil?
3254
+ fail ArgumentError, "Missing the required parameter 'query' when calling TwitterApi.twitter_search_users"
3255
+ end
3256
+ # resource path
3257
+ local_var_path = '/v1/twitter/users/search_users'
3258
+
3259
+ # query parameters
3260
+ query_params = opts[:query_params] || {}
3261
+ query_params[:'query'] = query
3262
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
3263
+
3264
+ # header parameters
3265
+ header_params = opts[:header_params] || {}
3266
+ # HTTP header 'Accept' (if needed)
3267
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3268
+
3269
+ # form parameters
3270
+ form_params = opts[:form_params] || {}
3271
+
3272
+ # http body (model)
3273
+ post_body = opts[:debug_body]
3274
+
3275
+ # return_type
3276
+ return_type = opts[:debug_return_type] || 'Object'
3277
+
3278
+ # auth_names
3279
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
3280
+
3281
+ new_options = opts.merge(
3282
+ :operation => :"TwitterApi.twitter_search_users",
3283
+ :header_params => header_params,
3284
+ :query_params => query_params,
3285
+ :form_params => form_params,
3286
+ :body => post_body,
3287
+ :auth_names => auth_names,
3288
+ :return_type => return_type
3289
+ )
3290
+
3291
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3292
+ if @api_client.config.debugging
3293
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_search_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3294
+ end
3295
+ return data, status_code, headers
3296
+ end
3297
+
3298
+ # Test webhook delivery
3299
+ # Send a test payload to a monitor's webhook URL. The test payload has type=\"test\" instead of type=\"tweet\". Makes a synchronous HTTP POST and returns the delivery result.
3300
+ # @param webhook_test_request [WebhookTestRequest]
3301
+ # @param [Hash] opts the optional parameters
3302
+ # @return [WebhookTestResponse]
3303
+ def twitter_test_webhook_delivery(webhook_test_request, opts = {})
3304
+ data, _status_code, _headers = twitter_test_webhook_delivery_with_http_info(webhook_test_request, opts)
3305
+ data
3306
+ end
3307
+
3308
+ # Test webhook delivery
3309
+ # Send a test payload to a monitor&#39;s webhook URL. The test payload has type&#x3D;\&quot;test\&quot; instead of type&#x3D;\&quot;tweet\&quot;. Makes a synchronous HTTP POST and returns the delivery result.
3310
+ # @param webhook_test_request [WebhookTestRequest]
3311
+ # @param [Hash] opts the optional parameters
3312
+ # @return [Array<(WebhookTestResponse, Integer, Hash)>] WebhookTestResponse data, response status code and response headers
3313
+ def twitter_test_webhook_delivery_with_http_info(webhook_test_request, opts = {})
3314
+ if @api_client.config.debugging
3315
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_test_webhook_delivery ...'
3316
+ end
3317
+ # verify the required parameter 'webhook_test_request' is set
3318
+ if @api_client.config.client_side_validation && webhook_test_request.nil?
3319
+ fail ArgumentError, "Missing the required parameter 'webhook_test_request' when calling TwitterApi.twitter_test_webhook_delivery"
3320
+ end
3321
+ # resource path
3322
+ local_var_path = '/v1/twitter/stream/webhooks/test'
3323
+
3324
+ # query parameters
3325
+ query_params = opts[:query_params] || {}
3326
+
3327
+ # header parameters
3328
+ header_params = opts[:header_params] || {}
3329
+ # HTTP header 'Accept' (if needed)
3330
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3331
+ # HTTP header 'Content-Type'
3332
+ content_type = @api_client.select_header_content_type(['application/json'])
3333
+ if !content_type.nil?
3334
+ header_params['Content-Type'] = content_type
3335
+ end
3336
+
3337
+ # form parameters
3338
+ form_params = opts[:form_params] || {}
3339
+
3340
+ # http body (model)
3341
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_test_request)
3342
+
3343
+ # return_type
3344
+ return_type = opts[:debug_return_type] || 'WebhookTestResponse'
3345
+
3346
+ # auth_names
3347
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
3348
+
3349
+ new_options = opts.merge(
3350
+ :operation => :"TwitterApi.twitter_test_webhook_delivery",
3351
+ :header_params => header_params,
3352
+ :query_params => query_params,
3353
+ :form_params => form_params,
3354
+ :body => post_body,
3355
+ :auth_names => auth_names,
3356
+ :return_type => return_type
3357
+ )
3358
+
3359
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
3360
+ if @api_client.config.debugging
3361
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_test_webhook_delivery\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3362
+ end
3363
+ return data, status_code, headers
3364
+ end
3365
+
3366
+ # Twitter scraper health check
3367
+ # Check health of the Twitter scraper service. Accepts ``HEAD`` so external uptime checkers (UptimeRobot uses HEAD by default for HTTP monitors) don't get a 405 Method Not Allowed.
3368
+ # @param [Hash] opts the optional parameters
3369
+ # @return [Object]
3370
+ def twitter_twitter_scraper_health_check(opts = {})
3371
+ data, _status_code, _headers = twitter_twitter_scraper_health_check_with_http_info(opts)
3372
+ data
3373
+ end
3374
+
3375
+ # Twitter scraper health check
3376
+ # Check health of the Twitter scraper service. Accepts &#x60;&#x60;HEAD&#x60;&#x60; so external uptime checkers (UptimeRobot uses HEAD by default for HTTP monitors) don&#39;t get a 405 Method Not Allowed.
3377
+ # @param [Hash] opts the optional parameters
3378
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
3379
+ def twitter_twitter_scraper_health_check_with_http_info(opts = {})
3380
+ if @api_client.config.debugging
3381
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_twitter_scraper_health_check ...'
3382
+ end
3383
+ # resource path
3384
+ local_var_path = '/v1/twitter/health'
3385
+
3386
+ # query parameters
3387
+ query_params = opts[:query_params] || {}
3388
+
3389
+ # header parameters
3390
+ header_params = opts[:header_params] || {}
3391
+ # HTTP header 'Accept' (if needed)
3392
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3393
+
3394
+ # form parameters
3395
+ form_params = opts[:form_params] || {}
3396
+
3397
+ # http body (model)
3398
+ post_body = opts[:debug_body]
3399
+
3400
+ # return_type
3401
+ return_type = opts[:debug_return_type] || 'Object'
3402
+
3403
+ # auth_names
3404
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
3405
+
3406
+ new_options = opts.merge(
3407
+ :operation => :"TwitterApi.twitter_twitter_scraper_health_check",
3408
+ :header_params => header_params,
3409
+ :query_params => query_params,
3410
+ :form_params => form_params,
3411
+ :body => post_body,
3412
+ :auth_names => auth_names,
3413
+ :return_type => return_type
3414
+ )
3415
+
3416
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3417
+ if @api_client.config.debugging
3418
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_twitter_scraper_health_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3419
+ end
3420
+ return data, status_code, headers
3421
+ end
3422
+
3423
+ # Twitter scraper health check
3424
+ # Check health of the Twitter scraper service. Accepts ``HEAD`` so external uptime checkers (UptimeRobot uses HEAD by default for HTTP monitors) don't get a 405 Method Not Allowed.
3425
+ # @param [Hash] opts the optional parameters
3426
+ # @return [Object]
3427
+ def twitter_twitter_scraper_health_check_head(opts = {})
3428
+ data, _status_code, _headers = twitter_twitter_scraper_health_check_head_with_http_info(opts)
3429
+ data
3430
+ end
3431
+
3432
+ # Twitter scraper health check
3433
+ # Check health of the Twitter scraper service. Accepts &#x60;&#x60;HEAD&#x60;&#x60; so external uptime checkers (UptimeRobot uses HEAD by default for HTTP monitors) don&#39;t get a 405 Method Not Allowed.
3434
+ # @param [Hash] opts the optional parameters
3435
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
3436
+ def twitter_twitter_scraper_health_check_head_with_http_info(opts = {})
3437
+ if @api_client.config.debugging
3438
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_twitter_scraper_health_check_head ...'
3439
+ end
3440
+ # resource path
3441
+ local_var_path = '/v1/twitter/health'
3442
+
3443
+ # query parameters
3444
+ query_params = opts[:query_params] || {}
3445
+
3446
+ # header parameters
3447
+ header_params = opts[:header_params] || {}
3448
+ # HTTP header 'Accept' (if needed)
3449
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3450
+
3451
+ # form parameters
3452
+ form_params = opts[:form_params] || {}
3453
+
3454
+ # http body (model)
3455
+ post_body = opts[:debug_body]
3456
+
3457
+ # return_type
3458
+ return_type = opts[:debug_return_type] || 'Object'
3459
+
3460
+ # auth_names
3461
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
3462
+
3463
+ new_options = opts.merge(
3464
+ :operation => :"TwitterApi.twitter_twitter_scraper_health_check_head",
3465
+ :header_params => header_params,
3466
+ :query_params => query_params,
3467
+ :form_params => form_params,
3468
+ :body => post_body,
3469
+ :auth_names => auth_names,
3470
+ :return_type => return_type
3471
+ )
3472
+
3473
+ data, status_code, headers = @api_client.call_api(:HEAD, local_var_path, new_options)
3474
+ if @api_client.config.debugging
3475
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_twitter_scraper_health_check_head\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3476
+ end
3477
+ return data, status_code, headers
3478
+ end
3479
+
3480
+ # Update filter rule
3481
+ # Partially update a filter rule. Setting status='active' on a paused rule performs a credit check.
3482
+ # @param rule_id [String]
3483
+ # @param filter_rule_update [FilterRuleUpdate]
3484
+ # @param [Hash] opts the optional parameters
3485
+ # @return [FilterRuleResponse]
3486
+ def twitter_update_filter_rule(rule_id, filter_rule_update, opts = {})
3487
+ data, _status_code, _headers = twitter_update_filter_rule_with_http_info(rule_id, filter_rule_update, opts)
3488
+ data
3489
+ end
3490
+
3491
+ # Update filter rule
3492
+ # Partially update a filter rule. Setting status&#x3D;&#39;active&#39; on a paused rule performs a credit check.
3493
+ # @param rule_id [String]
3494
+ # @param filter_rule_update [FilterRuleUpdate]
3495
+ # @param [Hash] opts the optional parameters
3496
+ # @return [Array<(FilterRuleResponse, Integer, Hash)>] FilterRuleResponse data, response status code and response headers
3497
+ def twitter_update_filter_rule_with_http_info(rule_id, filter_rule_update, opts = {})
3498
+ if @api_client.config.debugging
3499
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_update_filter_rule ...'
3500
+ end
3501
+ # verify the required parameter 'rule_id' is set
3502
+ if @api_client.config.client_side_validation && rule_id.nil?
3503
+ fail ArgumentError, "Missing the required parameter 'rule_id' when calling TwitterApi.twitter_update_filter_rule"
3504
+ end
3505
+ # verify the required parameter 'filter_rule_update' is set
3506
+ if @api_client.config.client_side_validation && filter_rule_update.nil?
3507
+ fail ArgumentError, "Missing the required parameter 'filter_rule_update' when calling TwitterApi.twitter_update_filter_rule"
3508
+ end
3509
+ # resource path
3510
+ local_var_path = '/v1/twitter/stream/filter-rules/{rule_id}'.sub('{' + 'rule_id' + '}', CGI.escape(rule_id.to_s))
3511
+
3512
+ # query parameters
3513
+ query_params = opts[:query_params] || {}
3514
+
3515
+ # header parameters
3516
+ header_params = opts[:header_params] || {}
3517
+ # HTTP header 'Accept' (if needed)
3518
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3519
+ # HTTP header 'Content-Type'
3520
+ content_type = @api_client.select_header_content_type(['application/json'])
3521
+ if !content_type.nil?
3522
+ header_params['Content-Type'] = content_type
3523
+ end
3524
+
3525
+ # form parameters
3526
+ form_params = opts[:form_params] || {}
3527
+
3528
+ # http body (model)
3529
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(filter_rule_update)
3530
+
3531
+ # return_type
3532
+ return_type = opts[:debug_return_type] || 'FilterRuleResponse'
3533
+
3534
+ # auth_names
3535
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
3536
+
3537
+ new_options = opts.merge(
3538
+ :operation => :"TwitterApi.twitter_update_filter_rule",
3539
+ :header_params => header_params,
3540
+ :query_params => query_params,
3541
+ :form_params => form_params,
3542
+ :body => post_body,
3543
+ :auth_names => auth_names,
3544
+ :return_type => return_type
3545
+ )
3546
+
3547
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
3548
+ if @api_client.config.debugging
3549
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_update_filter_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3550
+ end
3551
+ return data, status_code, headers
3552
+ end
3553
+
3554
+ # Update stream monitor
3555
+ # Partially update a stream monitor.
3556
+ # @param monitor_id [String]
3557
+ # @param stream_monitor_update [StreamMonitorUpdate]
3558
+ # @param [Hash] opts the optional parameters
3559
+ # @return [StreamMonitorResponse]
3560
+ def twitter_update_stream_monitor(monitor_id, stream_monitor_update, opts = {})
3561
+ data, _status_code, _headers = twitter_update_stream_monitor_with_http_info(monitor_id, stream_monitor_update, opts)
3562
+ data
3563
+ end
3564
+
3565
+ # Update stream monitor
3566
+ # Partially update a stream monitor.
3567
+ # @param monitor_id [String]
3568
+ # @param stream_monitor_update [StreamMonitorUpdate]
3569
+ # @param [Hash] opts the optional parameters
3570
+ # @return [Array<(StreamMonitorResponse, Integer, Hash)>] StreamMonitorResponse data, response status code and response headers
3571
+ def twitter_update_stream_monitor_with_http_info(monitor_id, stream_monitor_update, opts = {})
3572
+ if @api_client.config.debugging
3573
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_update_stream_monitor ...'
3574
+ end
3575
+ # verify the required parameter 'monitor_id' is set
3576
+ if @api_client.config.client_side_validation && monitor_id.nil?
3577
+ fail ArgumentError, "Missing the required parameter 'monitor_id' when calling TwitterApi.twitter_update_stream_monitor"
3578
+ end
3579
+ # verify the required parameter 'stream_monitor_update' is set
3580
+ if @api_client.config.client_side_validation && stream_monitor_update.nil?
3581
+ fail ArgumentError, "Missing the required parameter 'stream_monitor_update' when calling TwitterApi.twitter_update_stream_monitor"
3582
+ end
3583
+ # resource path
3584
+ local_var_path = '/v1/twitter/stream/monitors/{monitor_id}'.sub('{' + 'monitor_id' + '}', CGI.escape(monitor_id.to_s))
3585
+
3586
+ # query parameters
3587
+ query_params = opts[:query_params] || {}
3588
+
3589
+ # header parameters
3590
+ header_params = opts[:header_params] || {}
3591
+ # HTTP header 'Accept' (if needed)
3592
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3593
+ # HTTP header 'Content-Type'
3594
+ content_type = @api_client.select_header_content_type(['application/json'])
3595
+ if !content_type.nil?
3596
+ header_params['Content-Type'] = content_type
3597
+ end
3598
+
3599
+ # form parameters
3600
+ form_params = opts[:form_params] || {}
3601
+
3602
+ # http body (model)
3603
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(stream_monitor_update)
3604
+
3605
+ # return_type
3606
+ return_type = opts[:debug_return_type] || 'StreamMonitorResponse'
3607
+
3608
+ # auth_names
3609
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
3610
+
3611
+ new_options = opts.merge(
3612
+ :operation => :"TwitterApi.twitter_update_stream_monitor",
3613
+ :header_params => header_params,
3614
+ :query_params => query_params,
3615
+ :form_params => form_params,
3616
+ :body => post_body,
3617
+ :auth_names => auth_names,
3618
+ :return_type => return_type
3619
+ )
3620
+
3621
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
3622
+ if @api_client.config.debugging
3623
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_update_stream_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3624
+ end
3625
+ return data, status_code, headers
3626
+ end
3627
+
3628
+ # Validate search query
3629
+ # Validate a Twitter search query string. Performs basic structural validation without making a live Twitter request. Returns valid=True if the query passes syntax checks.
3630
+ # @param filter_rule_validate_request [FilterRuleValidateRequest]
3631
+ # @param [Hash] opts the optional parameters
3632
+ # @return [FilterRuleValidateResponse]
3633
+ def twitter_validate_search_query(filter_rule_validate_request, opts = {})
3634
+ data, _status_code, _headers = twitter_validate_search_query_with_http_info(filter_rule_validate_request, opts)
3635
+ data
3636
+ end
3637
+
3638
+ # Validate search query
3639
+ # Validate a Twitter search query string. Performs basic structural validation without making a live Twitter request. Returns valid&#x3D;True if the query passes syntax checks.
3640
+ # @param filter_rule_validate_request [FilterRuleValidateRequest]
3641
+ # @param [Hash] opts the optional parameters
3642
+ # @return [Array<(FilterRuleValidateResponse, Integer, Hash)>] FilterRuleValidateResponse data, response status code and response headers
3643
+ def twitter_validate_search_query_with_http_info(filter_rule_validate_request, opts = {})
3644
+ if @api_client.config.debugging
3645
+ @api_client.config.logger.debug 'Calling API: TwitterApi.twitter_validate_search_query ...'
3646
+ end
3647
+ # verify the required parameter 'filter_rule_validate_request' is set
3648
+ if @api_client.config.client_side_validation && filter_rule_validate_request.nil?
3649
+ fail ArgumentError, "Missing the required parameter 'filter_rule_validate_request' when calling TwitterApi.twitter_validate_search_query"
3650
+ end
3651
+ # resource path
3652
+ local_var_path = '/v1/twitter/stream/filter-rules/validate'
3653
+
3654
+ # query parameters
3655
+ query_params = opts[:query_params] || {}
3656
+
3657
+ # header parameters
3658
+ header_params = opts[:header_params] || {}
3659
+ # HTTP header 'Accept' (if needed)
3660
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3661
+ # HTTP header 'Content-Type'
3662
+ content_type = @api_client.select_header_content_type(['application/json'])
3663
+ if !content_type.nil?
3664
+ header_params['Content-Type'] = content_type
3665
+ end
3666
+
3667
+ # form parameters
3668
+ form_params = opts[:form_params] || {}
3669
+
3670
+ # http body (model)
3671
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(filter_rule_validate_request)
3672
+
3673
+ # return_type
3674
+ return_type = opts[:debug_return_type] || 'FilterRuleValidateResponse'
3675
+
3676
+ # auth_names
3677
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
3678
+
3679
+ new_options = opts.merge(
3680
+ :operation => :"TwitterApi.twitter_validate_search_query",
3681
+ :header_params => header_params,
3682
+ :query_params => query_params,
3683
+ :form_params => form_params,
3684
+ :body => post_body,
3685
+ :auth_names => auth_names,
3686
+ :return_type => return_type
3687
+ )
3688
+
3689
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
3690
+ if @api_client.config.debugging
3691
+ @api_client.config.logger.debug "API called: TwitterApi#twitter_validate_search_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3692
+ end
3693
+ return data, status_code, headers
3694
+ end
3695
+ end
3696
+ end