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,2029 @@
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 TikTokApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # General search
23
+ # General TikTok search — video results from the Top feed.
24
+ # @param query [String] Search keyword
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :region (default to 'US')
27
+ # @option opts [Integer] :count (default to 20)
28
+ # @option opts [String] :cursor Composite pagination cursor (offset.search_id) from a prior page's pagination.cursor
29
+ # @return [Object]
30
+ def tiktok_general_search(query, opts = {})
31
+ data, _status_code, _headers = tiktok_general_search_with_http_info(query, opts)
32
+ data
33
+ end
34
+
35
+ # General search
36
+ # General TikTok search — video results from the Top feed.
37
+ # @param query [String] Search keyword
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :region (default to 'US')
40
+ # @option opts [Integer] :count (default to 20)
41
+ # @option opts [String] :cursor Composite pagination cursor (offset.search_id) from a prior page's pagination.cursor
42
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
43
+ def tiktok_general_search_with_http_info(query, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_general_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 TikTokApi.tiktok_general_search"
50
+ end
51
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
52
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_general_search, must be smaller than or equal to 50.'
53
+ end
54
+
55
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
56
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_general_search, must be greater than or equal to 1.'
57
+ end
58
+
59
+ # resource path
60
+ local_var_path = '/v1/tiktok/search'
61
+
62
+ # query parameters
63
+ query_params = opts[:query_params] || {}
64
+ query_params[:'query'] = query
65
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
66
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
67
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
68
+
69
+ # header parameters
70
+ header_params = opts[:header_params] || {}
71
+ # HTTP header 'Accept' (if needed)
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
73
+
74
+ # form parameters
75
+ form_params = opts[:form_params] || {}
76
+
77
+ # http body (model)
78
+ post_body = opts[:debug_body]
79
+
80
+ # return_type
81
+ return_type = opts[:debug_return_type] || 'Object'
82
+
83
+ # auth_names
84
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
85
+
86
+ new_options = opts.merge(
87
+ :operation => :"TikTokApi.tiktok_general_search",
88
+ :header_params => header_params,
89
+ :query_params => query_params,
90
+ :form_params => form_params,
91
+ :body => post_body,
92
+ :auth_names => auth_names,
93
+ :return_type => return_type
94
+ )
95
+
96
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
97
+ if @api_client.config.debugging
98
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_general_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
99
+ end
100
+ return data, status_code, headers
101
+ end
102
+
103
+ # Get comment replies
104
+ # Get replies to a TikTok comment (best-effort).
105
+ # @param comment_id [String]
106
+ # @param video_id [String] Parent video id
107
+ # @param [Hash] opts the optional parameters
108
+ # @option opts [String] :region (default to 'US')
109
+ # @option opts [Integer] :count (default to 20)
110
+ # @option opts [String] :cursor Pagination cursor from a prior page&#39;s pagination.cursor
111
+ # @return [Object]
112
+ def tiktok_get_comment_replies(comment_id, video_id, opts = {})
113
+ data, _status_code, _headers = tiktok_get_comment_replies_with_http_info(comment_id, video_id, opts)
114
+ data
115
+ end
116
+
117
+ # Get comment replies
118
+ # Get replies to a TikTok comment (best-effort).
119
+ # @param comment_id [String]
120
+ # @param video_id [String] Parent video id
121
+ # @param [Hash] opts the optional parameters
122
+ # @option opts [String] :region (default to 'US')
123
+ # @option opts [Integer] :count (default to 20)
124
+ # @option opts [String] :cursor Pagination cursor from a prior page&#39;s pagination.cursor
125
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
126
+ def tiktok_get_comment_replies_with_http_info(comment_id, video_id, opts = {})
127
+ if @api_client.config.debugging
128
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_comment_replies ...'
129
+ end
130
+ # verify the required parameter 'comment_id' is set
131
+ if @api_client.config.client_side_validation && comment_id.nil?
132
+ fail ArgumentError, "Missing the required parameter 'comment_id' when calling TikTokApi.tiktok_get_comment_replies"
133
+ end
134
+ # verify the required parameter 'video_id' is set
135
+ if @api_client.config.client_side_validation && video_id.nil?
136
+ fail ArgumentError, "Missing the required parameter 'video_id' when calling TikTokApi.tiktok_get_comment_replies"
137
+ end
138
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
139
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_comment_replies, must be smaller than or equal to 50.'
140
+ end
141
+
142
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
143
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_comment_replies, must be greater than or equal to 1.'
144
+ end
145
+
146
+ # resource path
147
+ local_var_path = '/v1/tiktok/comments/{comment_id}/replies'.sub('{' + 'comment_id' + '}', CGI.escape(comment_id.to_s))
148
+
149
+ # query parameters
150
+ query_params = opts[:query_params] || {}
151
+ query_params[:'video_id'] = video_id
152
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
153
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
154
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
155
+
156
+ # header parameters
157
+ header_params = opts[:header_params] || {}
158
+ # HTTP header 'Accept' (if needed)
159
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
160
+
161
+ # form parameters
162
+ form_params = opts[:form_params] || {}
163
+
164
+ # http body (model)
165
+ post_body = opts[:debug_body]
166
+
167
+ # return_type
168
+ return_type = opts[:debug_return_type] || 'Object'
169
+
170
+ # auth_names
171
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
172
+
173
+ new_options = opts.merge(
174
+ :operation => :"TikTokApi.tiktok_get_comment_replies",
175
+ :header_params => header_params,
176
+ :query_params => query_params,
177
+ :form_params => form_params,
178
+ :body => post_body,
179
+ :auth_names => auth_names,
180
+ :return_type => return_type
181
+ )
182
+
183
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
184
+ if @api_client.config.debugging
185
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_comment_replies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
186
+ end
187
+ return data, status_code, headers
188
+ end
189
+
190
+ # Get comments
191
+ # Get top-level comments on a TikTok video.
192
+ # @param video_id [String]
193
+ # @param [Hash] opts the optional parameters
194
+ # @option opts [String] :region (default to 'US')
195
+ # @option opts [Integer] :count (default to 20)
196
+ # @option opts [String] :cursor Pagination cursor from a prior page&#39;s pagination.cursor
197
+ # @return [Object]
198
+ def tiktok_get_comments(video_id, opts = {})
199
+ data, _status_code, _headers = tiktok_get_comments_with_http_info(video_id, opts)
200
+ data
201
+ end
202
+
203
+ # Get comments
204
+ # Get top-level comments on a TikTok video.
205
+ # @param video_id [String]
206
+ # @param [Hash] opts the optional parameters
207
+ # @option opts [String] :region (default to 'US')
208
+ # @option opts [Integer] :count (default to 20)
209
+ # @option opts [String] :cursor Pagination cursor from a prior page&#39;s pagination.cursor
210
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
211
+ def tiktok_get_comments_with_http_info(video_id, opts = {})
212
+ if @api_client.config.debugging
213
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_comments ...'
214
+ end
215
+ # verify the required parameter 'video_id' is set
216
+ if @api_client.config.client_side_validation && video_id.nil?
217
+ fail ArgumentError, "Missing the required parameter 'video_id' when calling TikTokApi.tiktok_get_comments"
218
+ end
219
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
220
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_comments, must be smaller than or equal to 50.'
221
+ end
222
+
223
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
224
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_comments, must be greater than or equal to 1.'
225
+ end
226
+
227
+ # resource path
228
+ local_var_path = '/v1/tiktok/videos/{video_id}/comments'.sub('{' + 'video_id' + '}', CGI.escape(video_id.to_s))
229
+
230
+ # query parameters
231
+ query_params = opts[:query_params] || {}
232
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
233
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
234
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
235
+
236
+ # header parameters
237
+ header_params = opts[:header_params] || {}
238
+ # HTTP header 'Accept' (if needed)
239
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
240
+
241
+ # form parameters
242
+ form_params = opts[:form_params] || {}
243
+
244
+ # http body (model)
245
+ post_body = opts[:debug_body]
246
+
247
+ # return_type
248
+ return_type = opts[:debug_return_type] || 'Object'
249
+
250
+ # auth_names
251
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
252
+
253
+ new_options = opts.merge(
254
+ :operation => :"TikTokApi.tiktok_get_comments",
255
+ :header_params => header_params,
256
+ :query_params => query_params,
257
+ :form_params => form_params,
258
+ :body => post_body,
259
+ :auth_names => auth_names,
260
+ :return_type => return_type
261
+ )
262
+
263
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
264
+ if @api_client.config.debugging
265
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
266
+ end
267
+ return data, status_code, headers
268
+ end
269
+
270
+ # Get followers (deprecated)
271
+ # DEPRECATED — TikTok followers require an authenticated account session. Returns HTTP 410.
272
+ # @param username [String]
273
+ # @param [Hash] opts the optional parameters
274
+ # @option opts [String] :region (default to 'US')
275
+ # @option opts [Integer] :count (default to 30)
276
+ # @return [Object]
277
+ def tiktok_get_followers_deprecated(username, opts = {})
278
+ data, _status_code, _headers = tiktok_get_followers_deprecated_with_http_info(username, opts)
279
+ data
280
+ end
281
+
282
+ # Get followers (deprecated)
283
+ # DEPRECATED — TikTok followers require an authenticated account session. Returns HTTP 410.
284
+ # @param username [String]
285
+ # @param [Hash] opts the optional parameters
286
+ # @option opts [String] :region (default to 'US')
287
+ # @option opts [Integer] :count (default to 30)
288
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
289
+ def tiktok_get_followers_deprecated_with_http_info(username, opts = {})
290
+ if @api_client.config.debugging
291
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_followers_deprecated ...'
292
+ end
293
+ # verify the required parameter 'username' is set
294
+ if @api_client.config.client_side_validation && username.nil?
295
+ fail ArgumentError, "Missing the required parameter 'username' when calling TikTokApi.tiktok_get_followers_deprecated"
296
+ end
297
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
298
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_followers_deprecated, must be smaller than or equal to 50.'
299
+ end
300
+
301
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
302
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_followers_deprecated, must be greater than or equal to 1.'
303
+ end
304
+
305
+ # resource path
306
+ local_var_path = '/v1/tiktok/users/{username}/followers'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
307
+
308
+ # query parameters
309
+ query_params = opts[:query_params] || {}
310
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
311
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
312
+
313
+ # header parameters
314
+ header_params = opts[:header_params] || {}
315
+ # HTTP header 'Accept' (if needed)
316
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
317
+
318
+ # form parameters
319
+ form_params = opts[:form_params] || {}
320
+
321
+ # http body (model)
322
+ post_body = opts[:debug_body]
323
+
324
+ # return_type
325
+ return_type = opts[:debug_return_type] || 'Object'
326
+
327
+ # auth_names
328
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
329
+
330
+ new_options = opts.merge(
331
+ :operation => :"TikTokApi.tiktok_get_followers_deprecated",
332
+ :header_params => header_params,
333
+ :query_params => query_params,
334
+ :form_params => form_params,
335
+ :body => post_body,
336
+ :auth_names => auth_names,
337
+ :return_type => return_type
338
+ )
339
+
340
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
341
+ if @api_client.config.debugging
342
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_followers_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
343
+ end
344
+ return data, status_code, headers
345
+ end
346
+
347
+ # Get following (deprecated)
348
+ # DEPRECATED — TikTok following requires an authenticated account session. Returns HTTP 410.
349
+ # @param username [String]
350
+ # @param [Hash] opts the optional parameters
351
+ # @option opts [String] :region (default to 'US')
352
+ # @option opts [Integer] :count (default to 30)
353
+ # @return [Object]
354
+ def tiktok_get_following_deprecated(username, opts = {})
355
+ data, _status_code, _headers = tiktok_get_following_deprecated_with_http_info(username, opts)
356
+ data
357
+ end
358
+
359
+ # Get following (deprecated)
360
+ # DEPRECATED — TikTok following requires an authenticated account session. Returns HTTP 410.
361
+ # @param username [String]
362
+ # @param [Hash] opts the optional parameters
363
+ # @option opts [String] :region (default to 'US')
364
+ # @option opts [Integer] :count (default to 30)
365
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
366
+ def tiktok_get_following_deprecated_with_http_info(username, opts = {})
367
+ if @api_client.config.debugging
368
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_following_deprecated ...'
369
+ end
370
+ # verify the required parameter 'username' is set
371
+ if @api_client.config.client_side_validation && username.nil?
372
+ fail ArgumentError, "Missing the required parameter 'username' when calling TikTokApi.tiktok_get_following_deprecated"
373
+ end
374
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
375
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_following_deprecated, must be smaller than or equal to 50.'
376
+ end
377
+
378
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
379
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_following_deprecated, must be greater than or equal to 1.'
380
+ end
381
+
382
+ # resource path
383
+ local_var_path = '/v1/tiktok/users/{username}/following'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
384
+
385
+ # query parameters
386
+ query_params = opts[:query_params] || {}
387
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
388
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
389
+
390
+ # header parameters
391
+ header_params = opts[:header_params] || {}
392
+ # HTTP header 'Accept' (if needed)
393
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
394
+
395
+ # form parameters
396
+ form_params = opts[:form_params] || {}
397
+
398
+ # http body (model)
399
+ post_body = opts[:debug_body]
400
+
401
+ # return_type
402
+ return_type = opts[:debug_return_type] || 'Object'
403
+
404
+ # auth_names
405
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
406
+
407
+ new_options = opts.merge(
408
+ :operation => :"TikTokApi.tiktok_get_following_deprecated",
409
+ :header_params => header_params,
410
+ :query_params => query_params,
411
+ :form_params => form_params,
412
+ :body => post_body,
413
+ :auth_names => auth_names,
414
+ :return_type => return_type
415
+ )
416
+
417
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
418
+ if @api_client.config.debugging
419
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_following_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
420
+ end
421
+ return data, status_code, headers
422
+ end
423
+
424
+ # Get hashtag detail
425
+ # Get TikTok hashtag/challenge detail.
426
+ # @param name [String]
427
+ # @param [Hash] opts the optional parameters
428
+ # @option opts [String] :region (default to 'US')
429
+ # @return [Object]
430
+ def tiktok_get_hashtag_detail(name, opts = {})
431
+ data, _status_code, _headers = tiktok_get_hashtag_detail_with_http_info(name, opts)
432
+ data
433
+ end
434
+
435
+ # Get hashtag detail
436
+ # Get TikTok hashtag/challenge detail.
437
+ # @param name [String]
438
+ # @param [Hash] opts the optional parameters
439
+ # @option opts [String] :region (default to 'US')
440
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
441
+ def tiktok_get_hashtag_detail_with_http_info(name, opts = {})
442
+ if @api_client.config.debugging
443
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_hashtag_detail ...'
444
+ end
445
+ # verify the required parameter 'name' is set
446
+ if @api_client.config.client_side_validation && name.nil?
447
+ fail ArgumentError, "Missing the required parameter 'name' when calling TikTokApi.tiktok_get_hashtag_detail"
448
+ end
449
+ # resource path
450
+ local_var_path = '/v1/tiktok/hashtags/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))
451
+
452
+ # query parameters
453
+ query_params = opts[:query_params] || {}
454
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
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] || 'Object'
469
+
470
+ # auth_names
471
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
472
+
473
+ new_options = opts.merge(
474
+ :operation => :"TikTokApi.tiktok_get_hashtag_detail",
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(:GET, local_var_path, new_options)
484
+ if @api_client.config.debugging
485
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_hashtag_detail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
486
+ end
487
+ return data, status_code, headers
488
+ end
489
+
490
+ # Get hashtag videos
491
+ # Get videos tagged with a TikTok hashtag.
492
+ # @param name [String]
493
+ # @param [Hash] opts the optional parameters
494
+ # @option opts [String] :region (default to 'US')
495
+ # @option opts [Integer] :count (default to 30)
496
+ # @option opts [String] :cursor Pagination cursor from a prior page&#39;s pagination.cursor
497
+ # @return [Object]
498
+ def tiktok_get_hashtag_videos(name, opts = {})
499
+ data, _status_code, _headers = tiktok_get_hashtag_videos_with_http_info(name, opts)
500
+ data
501
+ end
502
+
503
+ # Get hashtag videos
504
+ # Get videos tagged with a TikTok hashtag.
505
+ # @param name [String]
506
+ # @param [Hash] opts the optional parameters
507
+ # @option opts [String] :region (default to 'US')
508
+ # @option opts [Integer] :count (default to 30)
509
+ # @option opts [String] :cursor Pagination cursor from a prior page&#39;s pagination.cursor
510
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
511
+ def tiktok_get_hashtag_videos_with_http_info(name, opts = {})
512
+ if @api_client.config.debugging
513
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_hashtag_videos ...'
514
+ end
515
+ # verify the required parameter 'name' is set
516
+ if @api_client.config.client_side_validation && name.nil?
517
+ fail ArgumentError, "Missing the required parameter 'name' when calling TikTokApi.tiktok_get_hashtag_videos"
518
+ end
519
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
520
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_hashtag_videos, must be smaller than or equal to 50.'
521
+ end
522
+
523
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
524
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_hashtag_videos, must be greater than or equal to 1.'
525
+ end
526
+
527
+ # resource path
528
+ local_var_path = '/v1/tiktok/hashtags/{name}/videos'.sub('{' + 'name' + '}', CGI.escape(name.to_s))
529
+
530
+ # query parameters
531
+ query_params = opts[:query_params] || {}
532
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
533
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
534
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
535
+
536
+ # header parameters
537
+ header_params = opts[:header_params] || {}
538
+ # HTTP header 'Accept' (if needed)
539
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
540
+
541
+ # form parameters
542
+ form_params = opts[:form_params] || {}
543
+
544
+ # http body (model)
545
+ post_body = opts[:debug_body]
546
+
547
+ # return_type
548
+ return_type = opts[:debug_return_type] || 'Object'
549
+
550
+ # auth_names
551
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
552
+
553
+ new_options = opts.merge(
554
+ :operation => :"TikTokApi.tiktok_get_hashtag_videos",
555
+ :header_params => header_params,
556
+ :query_params => query_params,
557
+ :form_params => form_params,
558
+ :body => post_body,
559
+ :auth_names => auth_names,
560
+ :return_type => return_type
561
+ )
562
+
563
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
564
+ if @api_client.config.debugging
565
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_hashtag_videos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
566
+ end
567
+ return data, status_code, headers
568
+ end
569
+
570
+ # Get liked videos (deprecated)
571
+ # DEPRECATED — TikTok liked videos require an authenticated account session. Returns HTTP 410.
572
+ # @param username [String]
573
+ # @param [Hash] opts the optional parameters
574
+ # @option opts [String] :region (default to 'US')
575
+ # @option opts [Integer] :count (default to 30)
576
+ # @return [Object]
577
+ def tiktok_get_liked_videos_deprecated(username, opts = {})
578
+ data, _status_code, _headers = tiktok_get_liked_videos_deprecated_with_http_info(username, opts)
579
+ data
580
+ end
581
+
582
+ # Get liked videos (deprecated)
583
+ # DEPRECATED — TikTok liked videos require an authenticated account session. Returns HTTP 410.
584
+ # @param username [String]
585
+ # @param [Hash] opts the optional parameters
586
+ # @option opts [String] :region (default to 'US')
587
+ # @option opts [Integer] :count (default to 30)
588
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
589
+ def tiktok_get_liked_videos_deprecated_with_http_info(username, opts = {})
590
+ if @api_client.config.debugging
591
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_liked_videos_deprecated ...'
592
+ end
593
+ # verify the required parameter 'username' is set
594
+ if @api_client.config.client_side_validation && username.nil?
595
+ fail ArgumentError, "Missing the required parameter 'username' when calling TikTokApi.tiktok_get_liked_videos_deprecated"
596
+ end
597
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
598
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_liked_videos_deprecated, must be smaller than or equal to 50.'
599
+ end
600
+
601
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
602
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_liked_videos_deprecated, must be greater than or equal to 1.'
603
+ end
604
+
605
+ # resource path
606
+ local_var_path = '/v1/tiktok/users/{username}/liked'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
607
+
608
+ # query parameters
609
+ query_params = opts[:query_params] || {}
610
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
611
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
612
+
613
+ # header parameters
614
+ header_params = opts[:header_params] || {}
615
+ # HTTP header 'Accept' (if needed)
616
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
617
+
618
+ # form parameters
619
+ form_params = opts[:form_params] || {}
620
+
621
+ # http body (model)
622
+ post_body = opts[:debug_body]
623
+
624
+ # return_type
625
+ return_type = opts[:debug_return_type] || 'Object'
626
+
627
+ # auth_names
628
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
629
+
630
+ new_options = opts.merge(
631
+ :operation => :"TikTokApi.tiktok_get_liked_videos_deprecated",
632
+ :header_params => header_params,
633
+ :query_params => query_params,
634
+ :form_params => form_params,
635
+ :body => post_body,
636
+ :auth_names => auth_names,
637
+ :return_type => return_type
638
+ )
639
+
640
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
641
+ if @api_client.config.debugging
642
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_liked_videos_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
643
+ end
644
+ return data, status_code, headers
645
+ end
646
+
647
+ # Get music/sound detail
648
+ # Get TikTok sound/music detail.
649
+ # @param music_id [String]
650
+ # @param [Hash] opts the optional parameters
651
+ # @option opts [String] :region (default to 'US')
652
+ # @return [Object]
653
+ def tiktok_get_music_sound_detail(music_id, opts = {})
654
+ data, _status_code, _headers = tiktok_get_music_sound_detail_with_http_info(music_id, opts)
655
+ data
656
+ end
657
+
658
+ # Get music/sound detail
659
+ # Get TikTok sound/music detail.
660
+ # @param music_id [String]
661
+ # @param [Hash] opts the optional parameters
662
+ # @option opts [String] :region (default to 'US')
663
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
664
+ def tiktok_get_music_sound_detail_with_http_info(music_id, opts = {})
665
+ if @api_client.config.debugging
666
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_music_sound_detail ...'
667
+ end
668
+ # verify the required parameter 'music_id' is set
669
+ if @api_client.config.client_side_validation && music_id.nil?
670
+ fail ArgumentError, "Missing the required parameter 'music_id' when calling TikTokApi.tiktok_get_music_sound_detail"
671
+ end
672
+ # resource path
673
+ local_var_path = '/v1/tiktok/music/{music_id}'.sub('{' + 'music_id' + '}', CGI.escape(music_id.to_s))
674
+
675
+ # query parameters
676
+ query_params = opts[:query_params] || {}
677
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
678
+
679
+ # header parameters
680
+ header_params = opts[:header_params] || {}
681
+ # HTTP header 'Accept' (if needed)
682
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
683
+
684
+ # form parameters
685
+ form_params = opts[:form_params] || {}
686
+
687
+ # http body (model)
688
+ post_body = opts[:debug_body]
689
+
690
+ # return_type
691
+ return_type = opts[:debug_return_type] || 'Object'
692
+
693
+ # auth_names
694
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
695
+
696
+ new_options = opts.merge(
697
+ :operation => :"TikTokApi.tiktok_get_music_sound_detail",
698
+ :header_params => header_params,
699
+ :query_params => query_params,
700
+ :form_params => form_params,
701
+ :body => post_body,
702
+ :auth_names => auth_names,
703
+ :return_type => return_type
704
+ )
705
+
706
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
707
+ if @api_client.config.debugging
708
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_music_sound_detail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
709
+ end
710
+ return data, status_code, headers
711
+ end
712
+
713
+ # Get music videos
714
+ # Get videos using a given TikTok sound.
715
+ # @param music_id [String]
716
+ # @param [Hash] opts the optional parameters
717
+ # @option opts [String] :region (default to 'US')
718
+ # @option opts [Integer] :count (default to 30)
719
+ # @option opts [String] :cursor Pagination cursor from a prior page&#39;s pagination.cursor
720
+ # @return [Object]
721
+ def tiktok_get_music_videos(music_id, opts = {})
722
+ data, _status_code, _headers = tiktok_get_music_videos_with_http_info(music_id, opts)
723
+ data
724
+ end
725
+
726
+ # Get music videos
727
+ # Get videos using a given TikTok sound.
728
+ # @param music_id [String]
729
+ # @param [Hash] opts the optional parameters
730
+ # @option opts [String] :region (default to 'US')
731
+ # @option opts [Integer] :count (default to 30)
732
+ # @option opts [String] :cursor Pagination cursor from a prior page&#39;s pagination.cursor
733
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
734
+ def tiktok_get_music_videos_with_http_info(music_id, opts = {})
735
+ if @api_client.config.debugging
736
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_music_videos ...'
737
+ end
738
+ # verify the required parameter 'music_id' is set
739
+ if @api_client.config.client_side_validation && music_id.nil?
740
+ fail ArgumentError, "Missing the required parameter 'music_id' when calling TikTokApi.tiktok_get_music_videos"
741
+ end
742
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
743
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_music_videos, must be smaller than or equal to 50.'
744
+ end
745
+
746
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
747
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_music_videos, must be greater than or equal to 1.'
748
+ end
749
+
750
+ # resource path
751
+ local_var_path = '/v1/tiktok/music/{music_id}/videos'.sub('{' + 'music_id' + '}', CGI.escape(music_id.to_s))
752
+
753
+ # query parameters
754
+ query_params = opts[:query_params] || {}
755
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
756
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
757
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
758
+
759
+ # header parameters
760
+ header_params = opts[:header_params] || {}
761
+ # HTTP header 'Accept' (if needed)
762
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
763
+
764
+ # form parameters
765
+ form_params = opts[:form_params] || {}
766
+
767
+ # http body (model)
768
+ post_body = opts[:debug_body]
769
+
770
+ # return_type
771
+ return_type = opts[:debug_return_type] || 'Object'
772
+
773
+ # auth_names
774
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
775
+
776
+ new_options = opts.merge(
777
+ :operation => :"TikTokApi.tiktok_get_music_videos",
778
+ :header_params => header_params,
779
+ :query_params => query_params,
780
+ :form_params => form_params,
781
+ :body => post_body,
782
+ :auth_names => auth_names,
783
+ :return_type => return_type
784
+ )
785
+
786
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
787
+ if @api_client.config.debugging
788
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_music_videos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
789
+ end
790
+ return data, status_code, headers
791
+ end
792
+
793
+ # Get oEmbed metadata
794
+ # Get cheap unauthenticated oEmbed metadata for a TikTok URL.
795
+ # @param url [String] Full TikTok video or profile URL
796
+ # @param [Hash] opts the optional parameters
797
+ # @option opts [String] :region (default to 'US')
798
+ # @return [Object]
799
+ def tiktok_get_oembed_metadata(url, opts = {})
800
+ data, _status_code, _headers = tiktok_get_oembed_metadata_with_http_info(url, opts)
801
+ data
802
+ end
803
+
804
+ # Get oEmbed metadata
805
+ # Get cheap unauthenticated oEmbed metadata for a TikTok URL.
806
+ # @param url [String] Full TikTok video or profile URL
807
+ # @param [Hash] opts the optional parameters
808
+ # @option opts [String] :region (default to 'US')
809
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
810
+ def tiktok_get_oembed_metadata_with_http_info(url, opts = {})
811
+ if @api_client.config.debugging
812
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_oembed_metadata ...'
813
+ end
814
+ # verify the required parameter 'url' is set
815
+ if @api_client.config.client_side_validation && url.nil?
816
+ fail ArgumentError, "Missing the required parameter 'url' when calling TikTokApi.tiktok_get_oembed_metadata"
817
+ end
818
+ # resource path
819
+ local_var_path = '/v1/tiktok/oembed'
820
+
821
+ # query parameters
822
+ query_params = opts[:query_params] || {}
823
+ query_params[:'url'] = url
824
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
825
+
826
+ # header parameters
827
+ header_params = opts[:header_params] || {}
828
+ # HTTP header 'Accept' (if needed)
829
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
830
+
831
+ # form parameters
832
+ form_params = opts[:form_params] || {}
833
+
834
+ # http body (model)
835
+ post_body = opts[:debug_body]
836
+
837
+ # return_type
838
+ return_type = opts[:debug_return_type] || 'Object'
839
+
840
+ # auth_names
841
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
842
+
843
+ new_options = opts.merge(
844
+ :operation => :"TikTokApi.tiktok_get_oembed_metadata",
845
+ :header_params => header_params,
846
+ :query_params => query_params,
847
+ :form_params => form_params,
848
+ :body => post_body,
849
+ :auth_names => auth_names,
850
+ :return_type => return_type
851
+ )
852
+
853
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
854
+ if @api_client.config.debugging
855
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_oembed_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
856
+ end
857
+ return data, status_code, headers
858
+ end
859
+
860
+ # Get related videos
861
+ # Get TikTok's related videos for a given video.
862
+ # @param video_id [String]
863
+ # @param [Hash] opts the optional parameters
864
+ # @option opts [String] :region (default to 'US')
865
+ # @option opts [Integer] :count (default to 16)
866
+ # @return [Object]
867
+ def tiktok_get_related_videos(video_id, opts = {})
868
+ data, _status_code, _headers = tiktok_get_related_videos_with_http_info(video_id, opts)
869
+ data
870
+ end
871
+
872
+ # Get related videos
873
+ # Get TikTok&#39;s related videos for a given video.
874
+ # @param video_id [String]
875
+ # @param [Hash] opts the optional parameters
876
+ # @option opts [String] :region (default to 'US')
877
+ # @option opts [Integer] :count (default to 16)
878
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
879
+ def tiktok_get_related_videos_with_http_info(video_id, opts = {})
880
+ if @api_client.config.debugging
881
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_related_videos ...'
882
+ end
883
+ # verify the required parameter 'video_id' is set
884
+ if @api_client.config.client_side_validation && video_id.nil?
885
+ fail ArgumentError, "Missing the required parameter 'video_id' when calling TikTokApi.tiktok_get_related_videos"
886
+ end
887
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
888
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_related_videos, must be smaller than or equal to 50.'
889
+ end
890
+
891
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
892
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_related_videos, must be greater than or equal to 1.'
893
+ end
894
+
895
+ # resource path
896
+ local_var_path = '/v1/tiktok/videos/{video_id}/related'.sub('{' + 'video_id' + '}', CGI.escape(video_id.to_s))
897
+
898
+ # query parameters
899
+ query_params = opts[:query_params] || {}
900
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
901
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
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] || 'Object'
916
+
917
+ # auth_names
918
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
919
+
920
+ new_options = opts.merge(
921
+ :operation => :"TikTokApi.tiktok_get_related_videos",
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: TikTokApi#tiktok_get_related_videos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
933
+ end
934
+ return data, status_code, headers
935
+ end
936
+
937
+ # Get reposts
938
+ # Get videos a TikTok user has reposted.
939
+ # @param username [String]
940
+ # @param [Hash] opts the optional parameters
941
+ # @option opts [String] :region (default to 'US')
942
+ # @option opts [Integer] :count (default to 30)
943
+ # @return [Object]
944
+ def tiktok_get_reposts(username, opts = {})
945
+ data, _status_code, _headers = tiktok_get_reposts_with_http_info(username, opts)
946
+ data
947
+ end
948
+
949
+ # Get reposts
950
+ # Get videos a TikTok user has reposted.
951
+ # @param username [String]
952
+ # @param [Hash] opts the optional parameters
953
+ # @option opts [String] :region (default to 'US')
954
+ # @option opts [Integer] :count (default to 30)
955
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
956
+ def tiktok_get_reposts_with_http_info(username, opts = {})
957
+ if @api_client.config.debugging
958
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_reposts ...'
959
+ end
960
+ # verify the required parameter 'username' is set
961
+ if @api_client.config.client_side_validation && username.nil?
962
+ fail ArgumentError, "Missing the required parameter 'username' when calling TikTokApi.tiktok_get_reposts"
963
+ end
964
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
965
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_reposts, must be smaller than or equal to 50.'
966
+ end
967
+
968
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
969
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_reposts, must be greater than or equal to 1.'
970
+ end
971
+
972
+ # resource path
973
+ local_var_path = '/v1/tiktok/users/{username}/reposts'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
974
+
975
+ # query parameters
976
+ query_params = opts[:query_params] || {}
977
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
978
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
979
+
980
+ # header parameters
981
+ header_params = opts[:header_params] || {}
982
+ # HTTP header 'Accept' (if needed)
983
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
984
+
985
+ # form parameters
986
+ form_params = opts[:form_params] || {}
987
+
988
+ # http body (model)
989
+ post_body = opts[:debug_body]
990
+
991
+ # return_type
992
+ return_type = opts[:debug_return_type] || 'Object'
993
+
994
+ # auth_names
995
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
996
+
997
+ new_options = opts.merge(
998
+ :operation => :"TikTokApi.tiktok_get_reposts",
999
+ :header_params => header_params,
1000
+ :query_params => query_params,
1001
+ :form_params => form_params,
1002
+ :body => post_body,
1003
+ :auth_names => auth_names,
1004
+ :return_type => return_type
1005
+ )
1006
+
1007
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1008
+ if @api_client.config.debugging
1009
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_reposts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1010
+ end
1011
+ return data, status_code, headers
1012
+ end
1013
+
1014
+ # Get transcript
1015
+ # Get subtitle/caption tracks for a TikTok video.
1016
+ # @param video_id [String]
1017
+ # @param [Hash] opts the optional parameters
1018
+ # @option opts [String] :region (default to 'US')
1019
+ # @return [Object]
1020
+ def tiktok_get_transcript(video_id, opts = {})
1021
+ data, _status_code, _headers = tiktok_get_transcript_with_http_info(video_id, opts)
1022
+ data
1023
+ end
1024
+
1025
+ # Get transcript
1026
+ # Get subtitle/caption tracks for a TikTok video.
1027
+ # @param video_id [String]
1028
+ # @param [Hash] opts the optional parameters
1029
+ # @option opts [String] :region (default to 'US')
1030
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1031
+ def tiktok_get_transcript_with_http_info(video_id, opts = {})
1032
+ if @api_client.config.debugging
1033
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_transcript ...'
1034
+ end
1035
+ # verify the required parameter 'video_id' is set
1036
+ if @api_client.config.client_side_validation && video_id.nil?
1037
+ fail ArgumentError, "Missing the required parameter 'video_id' when calling TikTokApi.tiktok_get_transcript"
1038
+ end
1039
+ # resource path
1040
+ local_var_path = '/v1/tiktok/videos/{video_id}/transcript'.sub('{' + 'video_id' + '}', CGI.escape(video_id.to_s))
1041
+
1042
+ # query parameters
1043
+ query_params = opts[:query_params] || {}
1044
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
1045
+
1046
+ # header parameters
1047
+ header_params = opts[:header_params] || {}
1048
+ # HTTP header 'Accept' (if needed)
1049
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1050
+
1051
+ # form parameters
1052
+ form_params = opts[:form_params] || {}
1053
+
1054
+ # http body (model)
1055
+ post_body = opts[:debug_body]
1056
+
1057
+ # return_type
1058
+ return_type = opts[:debug_return_type] || 'Object'
1059
+
1060
+ # auth_names
1061
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1062
+
1063
+ new_options = opts.merge(
1064
+ :operation => :"TikTokApi.tiktok_get_transcript",
1065
+ :header_params => header_params,
1066
+ :query_params => query_params,
1067
+ :form_params => form_params,
1068
+ :body => post_body,
1069
+ :auth_names => auth_names,
1070
+ :return_type => return_type
1071
+ )
1072
+
1073
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1074
+ if @api_client.config.debugging
1075
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_transcript\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1076
+ end
1077
+ return data, status_code, headers
1078
+ end
1079
+
1080
+ # Get user profile
1081
+ # Get a TikTok user's full profile.
1082
+ # @param username [String]
1083
+ # @param [Hash] opts the optional parameters
1084
+ # @option opts [String] :region Content region (ISO 3166-1 alpha-2) (default to 'US')
1085
+ # @return [Object]
1086
+ def tiktok_get_user_profile(username, opts = {})
1087
+ data, _status_code, _headers = tiktok_get_user_profile_with_http_info(username, opts)
1088
+ data
1089
+ end
1090
+
1091
+ # Get user profile
1092
+ # Get a TikTok user&#39;s full profile.
1093
+ # @param username [String]
1094
+ # @param [Hash] opts the optional parameters
1095
+ # @option opts [String] :region Content region (ISO 3166-1 alpha-2) (default to 'US')
1096
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1097
+ def tiktok_get_user_profile_with_http_info(username, opts = {})
1098
+ if @api_client.config.debugging
1099
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_user_profile ...'
1100
+ end
1101
+ # verify the required parameter 'username' is set
1102
+ if @api_client.config.client_side_validation && username.nil?
1103
+ fail ArgumentError, "Missing the required parameter 'username' when calling TikTokApi.tiktok_get_user_profile"
1104
+ end
1105
+ # resource path
1106
+ local_var_path = '/v1/tiktok/users/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
1107
+
1108
+ # query parameters
1109
+ query_params = opts[:query_params] || {}
1110
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
1111
+
1112
+ # header parameters
1113
+ header_params = opts[:header_params] || {}
1114
+ # HTTP header 'Accept' (if needed)
1115
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1116
+
1117
+ # form parameters
1118
+ form_params = opts[:form_params] || {}
1119
+
1120
+ # http body (model)
1121
+ post_body = opts[:debug_body]
1122
+
1123
+ # return_type
1124
+ return_type = opts[:debug_return_type] || 'Object'
1125
+
1126
+ # auth_names
1127
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1128
+
1129
+ new_options = opts.merge(
1130
+ :operation => :"TikTokApi.tiktok_get_user_profile",
1131
+ :header_params => header_params,
1132
+ :query_params => query_params,
1133
+ :form_params => form_params,
1134
+ :body => post_body,
1135
+ :auth_names => auth_names,
1136
+ :return_type => return_type
1137
+ )
1138
+
1139
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1140
+ if @api_client.config.debugging
1141
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_user_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1142
+ end
1143
+ return data, status_code, headers
1144
+ end
1145
+
1146
+ # Get user videos
1147
+ # Get a TikTok user's posted videos.
1148
+ # @param username [String]
1149
+ # @param [Hash] opts the optional parameters
1150
+ # @option opts [String] :region (default to 'US')
1151
+ # @option opts [Integer] :count (default to 30)
1152
+ # @option opts [String] :cursor Pagination cursor from a prior page&#39;s &#x60;pagination.cursor&#x60; (signer path only).
1153
+ # @return [Object]
1154
+ def tiktok_get_user_videos(username, opts = {})
1155
+ data, _status_code, _headers = tiktok_get_user_videos_with_http_info(username, opts)
1156
+ data
1157
+ end
1158
+
1159
+ # Get user videos
1160
+ # Get a TikTok user&#39;s posted videos.
1161
+ # @param username [String]
1162
+ # @param [Hash] opts the optional parameters
1163
+ # @option opts [String] :region (default to 'US')
1164
+ # @option opts [Integer] :count (default to 30)
1165
+ # @option opts [String] :cursor Pagination cursor from a prior page&#39;s &#x60;pagination.cursor&#x60; (signer path only).
1166
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1167
+ def tiktok_get_user_videos_with_http_info(username, opts = {})
1168
+ if @api_client.config.debugging
1169
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_user_videos ...'
1170
+ end
1171
+ # verify the required parameter 'username' is set
1172
+ if @api_client.config.client_side_validation && username.nil?
1173
+ fail ArgumentError, "Missing the required parameter 'username' when calling TikTokApi.tiktok_get_user_videos"
1174
+ end
1175
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
1176
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_user_videos, must be smaller than or equal to 50.'
1177
+ end
1178
+
1179
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
1180
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_get_user_videos, must be greater than or equal to 1.'
1181
+ end
1182
+
1183
+ # resource path
1184
+ local_var_path = '/v1/tiktok/users/{username}/videos'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
1185
+
1186
+ # query parameters
1187
+ query_params = opts[:query_params] || {}
1188
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
1189
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
1190
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1191
+
1192
+ # header parameters
1193
+ header_params = opts[:header_params] || {}
1194
+ # HTTP header 'Accept' (if needed)
1195
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1196
+
1197
+ # form parameters
1198
+ form_params = opts[:form_params] || {}
1199
+
1200
+ # http body (model)
1201
+ post_body = opts[:debug_body]
1202
+
1203
+ # return_type
1204
+ return_type = opts[:debug_return_type] || 'Object'
1205
+
1206
+ # auth_names
1207
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1208
+
1209
+ new_options = opts.merge(
1210
+ :operation => :"TikTokApi.tiktok_get_user_videos",
1211
+ :header_params => header_params,
1212
+ :query_params => query_params,
1213
+ :form_params => form_params,
1214
+ :body => post_body,
1215
+ :auth_names => auth_names,
1216
+ :return_type => return_type
1217
+ )
1218
+
1219
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1220
+ if @api_client.config.debugging
1221
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_user_videos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1222
+ end
1223
+ return data, status_code, headers
1224
+ end
1225
+
1226
+ # Get video detail
1227
+ # Get full metadata for a single TikTok video/post.
1228
+ # @param video_id [String]
1229
+ # @param [Hash] opts the optional parameters
1230
+ # @option opts [String] :region (default to 'US')
1231
+ # @option opts [String] :username Author handle (skips oEmbed lookup)
1232
+ # @return [Object]
1233
+ def tiktok_get_video_detail(video_id, opts = {})
1234
+ data, _status_code, _headers = tiktok_get_video_detail_with_http_info(video_id, opts)
1235
+ data
1236
+ end
1237
+
1238
+ # Get video detail
1239
+ # Get full metadata for a single TikTok video/post.
1240
+ # @param video_id [String]
1241
+ # @param [Hash] opts the optional parameters
1242
+ # @option opts [String] :region (default to 'US')
1243
+ # @option opts [String] :username Author handle (skips oEmbed lookup)
1244
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1245
+ def tiktok_get_video_detail_with_http_info(video_id, opts = {})
1246
+ if @api_client.config.debugging
1247
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_get_video_detail ...'
1248
+ end
1249
+ # verify the required parameter 'video_id' is set
1250
+ if @api_client.config.client_side_validation && video_id.nil?
1251
+ fail ArgumentError, "Missing the required parameter 'video_id' when calling TikTokApi.tiktok_get_video_detail"
1252
+ end
1253
+ # resource path
1254
+ local_var_path = '/v1/tiktok/videos/{video_id}'.sub('{' + 'video_id' + '}', CGI.escape(video_id.to_s))
1255
+
1256
+ # query parameters
1257
+ query_params = opts[:query_params] || {}
1258
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
1259
+ query_params[:'username'] = opts[:'username'] if !opts[:'username'].nil?
1260
+
1261
+ # header parameters
1262
+ header_params = opts[:header_params] || {}
1263
+ # HTTP header 'Accept' (if needed)
1264
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1265
+
1266
+ # form parameters
1267
+ form_params = opts[:form_params] || {}
1268
+
1269
+ # http body (model)
1270
+ post_body = opts[:debug_body]
1271
+
1272
+ # return_type
1273
+ return_type = opts[:debug_return_type] || 'Object'
1274
+
1275
+ # auth_names
1276
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1277
+
1278
+ new_options = opts.merge(
1279
+ :operation => :"TikTokApi.tiktok_get_video_detail",
1280
+ :header_params => header_params,
1281
+ :query_params => query_params,
1282
+ :form_params => form_params,
1283
+ :body => post_body,
1284
+ :auth_names => auth_names,
1285
+ :return_type => return_type
1286
+ )
1287
+
1288
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1289
+ if @api_client.config.debugging
1290
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_get_video_detail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1291
+ end
1292
+ return data, status_code, headers
1293
+ end
1294
+
1295
+ # Health check
1296
+ # Check health of the TikTok scraper service.
1297
+ # @param [Hash] opts the optional parameters
1298
+ # @return [Object]
1299
+ def tiktok_health_check(opts = {})
1300
+ data, _status_code, _headers = tiktok_health_check_with_http_info(opts)
1301
+ data
1302
+ end
1303
+
1304
+ # Health check
1305
+ # Check health of the TikTok scraper service.
1306
+ # @param [Hash] opts the optional parameters
1307
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1308
+ def tiktok_health_check_with_http_info(opts = {})
1309
+ if @api_client.config.debugging
1310
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_health_check ...'
1311
+ end
1312
+ # resource path
1313
+ local_var_path = '/v1/tiktok/health'
1314
+
1315
+ # query parameters
1316
+ query_params = opts[:query_params] || {}
1317
+
1318
+ # header parameters
1319
+ header_params = opts[:header_params] || {}
1320
+ # HTTP header 'Accept' (if needed)
1321
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1322
+
1323
+ # form parameters
1324
+ form_params = opts[:form_params] || {}
1325
+
1326
+ # http body (model)
1327
+ post_body = opts[:debug_body]
1328
+
1329
+ # return_type
1330
+ return_type = opts[:debug_return_type] || 'Object'
1331
+
1332
+ # auth_names
1333
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1334
+
1335
+ new_options = opts.merge(
1336
+ :operation => :"TikTokApi.tiktok_health_check",
1337
+ :header_params => header_params,
1338
+ :query_params => query_params,
1339
+ :form_params => form_params,
1340
+ :body => post_body,
1341
+ :auth_names => auth_names,
1342
+ :return_type => return_type
1343
+ )
1344
+
1345
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1346
+ if @api_client.config.debugging
1347
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_health_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1348
+ end
1349
+ return data, status_code, headers
1350
+ end
1351
+
1352
+ # Health check
1353
+ # Check health of the TikTok scraper service.
1354
+ # @param [Hash] opts the optional parameters
1355
+ # @return [Object]
1356
+ def tiktok_health_check_head(opts = {})
1357
+ data, _status_code, _headers = tiktok_health_check_head_with_http_info(opts)
1358
+ data
1359
+ end
1360
+
1361
+ # Health check
1362
+ # Check health of the TikTok scraper service.
1363
+ # @param [Hash] opts the optional parameters
1364
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1365
+ def tiktok_health_check_head_with_http_info(opts = {})
1366
+ if @api_client.config.debugging
1367
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_health_check_head ...'
1368
+ end
1369
+ # resource path
1370
+ local_var_path = '/v1/tiktok/health'
1371
+
1372
+ # query parameters
1373
+ query_params = opts[:query_params] || {}
1374
+
1375
+ # header parameters
1376
+ header_params = opts[:header_params] || {}
1377
+ # HTTP header 'Accept' (if needed)
1378
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1379
+
1380
+ # form parameters
1381
+ form_params = opts[:form_params] || {}
1382
+
1383
+ # http body (model)
1384
+ post_body = opts[:debug_body]
1385
+
1386
+ # return_type
1387
+ return_type = opts[:debug_return_type] || 'Object'
1388
+
1389
+ # auth_names
1390
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1391
+
1392
+ new_options = opts.merge(
1393
+ :operation => :"TikTokApi.tiktok_health_check_head",
1394
+ :header_params => header_params,
1395
+ :query_params => query_params,
1396
+ :form_params => form_params,
1397
+ :body => post_body,
1398
+ :auth_names => auth_names,
1399
+ :return_type => return_type
1400
+ )
1401
+
1402
+ data, status_code, headers = @api_client.call_api(:HEAD, local_var_path, new_options)
1403
+ if @api_client.config.debugging
1404
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_health_check_head\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1405
+ end
1406
+ return data, status_code, headers
1407
+ end
1408
+
1409
+ # List regions
1410
+ # List supported TikTok content regions.
1411
+ # @param [Hash] opts the optional parameters
1412
+ # @return [Object]
1413
+ def tiktok_list_regions(opts = {})
1414
+ data, _status_code, _headers = tiktok_list_regions_with_http_info(opts)
1415
+ data
1416
+ end
1417
+
1418
+ # List regions
1419
+ # List supported TikTok content regions.
1420
+ # @param [Hash] opts the optional parameters
1421
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1422
+ def tiktok_list_regions_with_http_info(opts = {})
1423
+ if @api_client.config.debugging
1424
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_list_regions ...'
1425
+ end
1426
+ # resource path
1427
+ local_var_path = '/v1/tiktok/regions'
1428
+
1429
+ # query parameters
1430
+ query_params = opts[:query_params] || {}
1431
+
1432
+ # header parameters
1433
+ header_params = opts[:header_params] || {}
1434
+ # HTTP header 'Accept' (if needed)
1435
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1436
+
1437
+ # form parameters
1438
+ form_params = opts[:form_params] || {}
1439
+
1440
+ # http body (model)
1441
+ post_body = opts[:debug_body]
1442
+
1443
+ # return_type
1444
+ return_type = opts[:debug_return_type] || 'Object'
1445
+
1446
+ # auth_names
1447
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1448
+
1449
+ new_options = opts.merge(
1450
+ :operation => :"TikTokApi.tiktok_list_regions",
1451
+ :header_params => header_params,
1452
+ :query_params => query_params,
1453
+ :form_params => form_params,
1454
+ :body => post_body,
1455
+ :auth_names => auth_names,
1456
+ :return_type => return_type
1457
+ )
1458
+
1459
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1460
+ if @api_client.config.debugging
1461
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_list_regions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1462
+ end
1463
+ return data, status_code, headers
1464
+ end
1465
+
1466
+ # Search hashtags
1467
+ # Search TikTok hashtags by keyword.
1468
+ # @param query [String] Search keyword
1469
+ # @param [Hash] opts the optional parameters
1470
+ # @option opts [String] :region (default to 'US')
1471
+ # @option opts [Integer] :count (default to 20)
1472
+ # @option opts [String] :cursor Composite pagination cursor (offset.search_id) from a prior page&#39;s pagination.cursor
1473
+ # @return [Object]
1474
+ def tiktok_search_hashtags(query, opts = {})
1475
+ data, _status_code, _headers = tiktok_search_hashtags_with_http_info(query, opts)
1476
+ data
1477
+ end
1478
+
1479
+ # Search hashtags
1480
+ # Search TikTok hashtags by keyword.
1481
+ # @param query [String] Search keyword
1482
+ # @param [Hash] opts the optional parameters
1483
+ # @option opts [String] :region (default to 'US')
1484
+ # @option opts [Integer] :count (default to 20)
1485
+ # @option opts [String] :cursor Composite pagination cursor (offset.search_id) from a prior page&#39;s pagination.cursor
1486
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1487
+ def tiktok_search_hashtags_with_http_info(query, opts = {})
1488
+ if @api_client.config.debugging
1489
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_search_hashtags ...'
1490
+ end
1491
+ # verify the required parameter 'query' is set
1492
+ if @api_client.config.client_side_validation && query.nil?
1493
+ fail ArgumentError, "Missing the required parameter 'query' when calling TikTokApi.tiktok_search_hashtags"
1494
+ end
1495
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
1496
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_search_hashtags, must be smaller than or equal to 50.'
1497
+ end
1498
+
1499
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
1500
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_search_hashtags, must be greater than or equal to 1.'
1501
+ end
1502
+
1503
+ # resource path
1504
+ local_var_path = '/v1/tiktok/search/hashtags'
1505
+
1506
+ # query parameters
1507
+ query_params = opts[:query_params] || {}
1508
+ query_params[:'query'] = query
1509
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
1510
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
1511
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1512
+
1513
+ # header parameters
1514
+ header_params = opts[:header_params] || {}
1515
+ # HTTP header 'Accept' (if needed)
1516
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1517
+
1518
+ # form parameters
1519
+ form_params = opts[:form_params] || {}
1520
+
1521
+ # http body (model)
1522
+ post_body = opts[:debug_body]
1523
+
1524
+ # return_type
1525
+ return_type = opts[:debug_return_type] || 'Object'
1526
+
1527
+ # auth_names
1528
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1529
+
1530
+ new_options = opts.merge(
1531
+ :operation => :"TikTokApi.tiktok_search_hashtags",
1532
+ :header_params => header_params,
1533
+ :query_params => query_params,
1534
+ :form_params => form_params,
1535
+ :body => post_body,
1536
+ :auth_names => auth_names,
1537
+ :return_type => return_type
1538
+ )
1539
+
1540
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1541
+ if @api_client.config.debugging
1542
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_search_hashtags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1543
+ end
1544
+ return data, status_code, headers
1545
+ end
1546
+
1547
+ # Search the TikTok Ad Library
1548
+ # Search TikTok's Commercial Content Library (ad transparency) by keyword or advertiser.
1549
+ # @param [Hash] opts the optional parameters
1550
+ # @option opts [String] :query Keyword (ignored when advertiser_id is set) (default to '')
1551
+ # @option opts [String] :advertiser_id Advertiser business id(s) for advertiser search (default to '')
1552
+ # @option opts [String] :region EU region code (the Ad Library is EU-only) (default to 'DE')
1553
+ # @option opts [Integer] :days (default to 30)
1554
+ # @option opts [String] :sort (default to 'last_shown_date,desc')
1555
+ # @option opts [Integer] :offset (default to 0)
1556
+ # @option opts [String] :search_id (default to '')
1557
+ # @option opts [Integer] :count (default to 20)
1558
+ # @return [Object]
1559
+ def tiktok_search_the_tiktok_ad_library(opts = {})
1560
+ data, _status_code, _headers = tiktok_search_the_tiktok_ad_library_with_http_info(opts)
1561
+ data
1562
+ end
1563
+
1564
+ # Search the TikTok Ad Library
1565
+ # Search TikTok&#39;s Commercial Content Library (ad transparency) by keyword or advertiser.
1566
+ # @param [Hash] opts the optional parameters
1567
+ # @option opts [String] :query Keyword (ignored when advertiser_id is set) (default to '')
1568
+ # @option opts [String] :advertiser_id Advertiser business id(s) for advertiser search (default to '')
1569
+ # @option opts [String] :region EU region code (the Ad Library is EU-only) (default to 'DE')
1570
+ # @option opts [Integer] :days (default to 30)
1571
+ # @option opts [String] :sort (default to 'last_shown_date,desc')
1572
+ # @option opts [Integer] :offset (default to 0)
1573
+ # @option opts [String] :search_id (default to '')
1574
+ # @option opts [Integer] :count (default to 20)
1575
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1576
+ def tiktok_search_the_tiktok_ad_library_with_http_info(opts = {})
1577
+ if @api_client.config.debugging
1578
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_search_the_tiktok_ad_library ...'
1579
+ end
1580
+ if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] > 365
1581
+ fail ArgumentError, 'invalid value for "opts[:"days"]" when calling TikTokApi.tiktok_search_the_tiktok_ad_library, must be smaller than or equal to 365.'
1582
+ end
1583
+
1584
+ if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] < 1
1585
+ fail ArgumentError, 'invalid value for "opts[:"days"]" when calling TikTokApi.tiktok_search_the_tiktok_ad_library, must be greater than or equal to 1.'
1586
+ end
1587
+
1588
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
1589
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling TikTokApi.tiktok_search_the_tiktok_ad_library, must be greater than or equal to 0.'
1590
+ end
1591
+
1592
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
1593
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_search_the_tiktok_ad_library, must be smaller than or equal to 50.'
1594
+ end
1595
+
1596
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
1597
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_search_the_tiktok_ad_library, must be greater than or equal to 1.'
1598
+ end
1599
+
1600
+ # resource path
1601
+ local_var_path = '/v1/tiktok/ads/search'
1602
+
1603
+ # query parameters
1604
+ query_params = opts[:query_params] || {}
1605
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
1606
+ query_params[:'advertiser_id'] = opts[:'advertiser_id'] if !opts[:'advertiser_id'].nil?
1607
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
1608
+ query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
1609
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
1610
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1611
+ query_params[:'search_id'] = opts[:'search_id'] if !opts[:'search_id'].nil?
1612
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
1613
+
1614
+ # header parameters
1615
+ header_params = opts[:header_params] || {}
1616
+ # HTTP header 'Accept' (if needed)
1617
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1618
+
1619
+ # form parameters
1620
+ form_params = opts[:form_params] || {}
1621
+
1622
+ # http body (model)
1623
+ post_body = opts[:debug_body]
1624
+
1625
+ # return_type
1626
+ return_type = opts[:debug_return_type] || 'Object'
1627
+
1628
+ # auth_names
1629
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1630
+
1631
+ new_options = opts.merge(
1632
+ :operation => :"TikTokApi.tiktok_search_the_tiktok_ad_library",
1633
+ :header_params => header_params,
1634
+ :query_params => query_params,
1635
+ :form_params => form_params,
1636
+ :body => post_body,
1637
+ :auth_names => auth_names,
1638
+ :return_type => return_type
1639
+ )
1640
+
1641
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1642
+ if @api_client.config.debugging
1643
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_search_the_tiktok_ad_library\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1644
+ end
1645
+ return data, status_code, headers
1646
+ end
1647
+
1648
+ # Search users
1649
+ # Search TikTok users by keyword.
1650
+ # @param query [String] Search keyword
1651
+ # @param [Hash] opts the optional parameters
1652
+ # @option opts [String] :region (default to 'US')
1653
+ # @option opts [Integer] :count (default to 20)
1654
+ # @option opts [String] :cursor Composite pagination cursor (offset.search_id) from a prior page&#39;s pagination.cursor
1655
+ # @return [Object]
1656
+ def tiktok_search_users(query, opts = {})
1657
+ data, _status_code, _headers = tiktok_search_users_with_http_info(query, opts)
1658
+ data
1659
+ end
1660
+
1661
+ # Search users
1662
+ # Search TikTok users by keyword.
1663
+ # @param query [String] Search keyword
1664
+ # @param [Hash] opts the optional parameters
1665
+ # @option opts [String] :region (default to 'US')
1666
+ # @option opts [Integer] :count (default to 20)
1667
+ # @option opts [String] :cursor Composite pagination cursor (offset.search_id) from a prior page&#39;s pagination.cursor
1668
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1669
+ def tiktok_search_users_with_http_info(query, opts = {})
1670
+ if @api_client.config.debugging
1671
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_search_users ...'
1672
+ end
1673
+ # verify the required parameter 'query' is set
1674
+ if @api_client.config.client_side_validation && query.nil?
1675
+ fail ArgumentError, "Missing the required parameter 'query' when calling TikTokApi.tiktok_search_users"
1676
+ end
1677
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
1678
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_search_users, must be smaller than or equal to 50.'
1679
+ end
1680
+
1681
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
1682
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_search_users, must be greater than or equal to 1.'
1683
+ end
1684
+
1685
+ # resource path
1686
+ local_var_path = '/v1/tiktok/search/users'
1687
+
1688
+ # query parameters
1689
+ query_params = opts[:query_params] || {}
1690
+ query_params[:'query'] = query
1691
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
1692
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
1693
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1694
+
1695
+ # header parameters
1696
+ header_params = opts[:header_params] || {}
1697
+ # HTTP header 'Accept' (if needed)
1698
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1699
+
1700
+ # form parameters
1701
+ form_params = opts[:form_params] || {}
1702
+
1703
+ # http body (model)
1704
+ post_body = opts[:debug_body]
1705
+
1706
+ # return_type
1707
+ return_type = opts[:debug_return_type] || 'Object'
1708
+
1709
+ # auth_names
1710
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1711
+
1712
+ new_options = opts.merge(
1713
+ :operation => :"TikTokApi.tiktok_search_users",
1714
+ :header_params => header_params,
1715
+ :query_params => query_params,
1716
+ :form_params => form_params,
1717
+ :body => post_body,
1718
+ :auth_names => auth_names,
1719
+ :return_type => return_type
1720
+ )
1721
+
1722
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1723
+ if @api_client.config.debugging
1724
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_search_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1725
+ end
1726
+ return data, status_code, headers
1727
+ end
1728
+
1729
+ # Search videos
1730
+ # Search TikTok videos by keyword.
1731
+ # @param query [String] Search keyword
1732
+ # @param [Hash] opts the optional parameters
1733
+ # @option opts [String] :region (default to 'US')
1734
+ # @option opts [Integer] :count (default to 20)
1735
+ # @option opts [String] :cursor Composite pagination cursor (offset.search_id) from a prior page&#39;s pagination.cursor
1736
+ # @return [Object]
1737
+ def tiktok_search_videos(query, opts = {})
1738
+ data, _status_code, _headers = tiktok_search_videos_with_http_info(query, opts)
1739
+ data
1740
+ end
1741
+
1742
+ # Search videos
1743
+ # Search TikTok videos by keyword.
1744
+ # @param query [String] Search keyword
1745
+ # @param [Hash] opts the optional parameters
1746
+ # @option opts [String] :region (default to 'US')
1747
+ # @option opts [Integer] :count (default to 20)
1748
+ # @option opts [String] :cursor Composite pagination cursor (offset.search_id) from a prior page&#39;s pagination.cursor
1749
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1750
+ def tiktok_search_videos_with_http_info(query, opts = {})
1751
+ if @api_client.config.debugging
1752
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_search_videos ...'
1753
+ end
1754
+ # verify the required parameter 'query' is set
1755
+ if @api_client.config.client_side_validation && query.nil?
1756
+ fail ArgumentError, "Missing the required parameter 'query' when calling TikTokApi.tiktok_search_videos"
1757
+ end
1758
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
1759
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_search_videos, must be smaller than or equal to 50.'
1760
+ end
1761
+
1762
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
1763
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_search_videos, must be greater than or equal to 1.'
1764
+ end
1765
+
1766
+ # resource path
1767
+ local_var_path = '/v1/tiktok/search/videos'
1768
+
1769
+ # query parameters
1770
+ query_params = opts[:query_params] || {}
1771
+ query_params[:'query'] = query
1772
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
1773
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
1774
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1775
+
1776
+ # header parameters
1777
+ header_params = opts[:header_params] || {}
1778
+ # HTTP header 'Accept' (if needed)
1779
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1780
+
1781
+ # form parameters
1782
+ form_params = opts[:form_params] || {}
1783
+
1784
+ # http body (model)
1785
+ post_body = opts[:debug_body]
1786
+
1787
+ # return_type
1788
+ return_type = opts[:debug_return_type] || 'Object'
1789
+
1790
+ # auth_names
1791
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1792
+
1793
+ new_options = opts.merge(
1794
+ :operation => :"TikTokApi.tiktok_search_videos",
1795
+ :header_params => header_params,
1796
+ :query_params => query_params,
1797
+ :form_params => form_params,
1798
+ :body => post_body,
1799
+ :auth_names => auth_names,
1800
+ :return_type => return_type
1801
+ )
1802
+
1803
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1804
+ if @api_client.config.debugging
1805
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_search_videos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1806
+ end
1807
+ return data, status_code, headers
1808
+ end
1809
+
1810
+ # Trending hashtags
1811
+ # Get trending hashtags (mobile Discover surface — view_count + creators).
1812
+ # @param [Hash] opts the optional parameters
1813
+ # @option opts [String] :region (default to 'US')
1814
+ # @option opts [Integer] :period (default to 7)
1815
+ # @option opts [Integer] :count (default to 20)
1816
+ # @return [Object]
1817
+ def tiktok_trending_hashtags(opts = {})
1818
+ data, _status_code, _headers = tiktok_trending_hashtags_with_http_info(opts)
1819
+ data
1820
+ end
1821
+
1822
+ # Trending hashtags
1823
+ # Get trending hashtags (mobile Discover surface — view_count + creators).
1824
+ # @param [Hash] opts the optional parameters
1825
+ # @option opts [String] :region (default to 'US')
1826
+ # @option opts [Integer] :period (default to 7)
1827
+ # @option opts [Integer] :count (default to 20)
1828
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1829
+ def tiktok_trending_hashtags_with_http_info(opts = {})
1830
+ if @api_client.config.debugging
1831
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_trending_hashtags ...'
1832
+ end
1833
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
1834
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_trending_hashtags, must be smaller than or equal to 50.'
1835
+ end
1836
+
1837
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
1838
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_trending_hashtags, must be greater than or equal to 1.'
1839
+ end
1840
+
1841
+ # resource path
1842
+ local_var_path = '/v1/tiktok/trending/hashtags'
1843
+
1844
+ # query parameters
1845
+ query_params = opts[:query_params] || {}
1846
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
1847
+ query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil?
1848
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
1849
+
1850
+ # header parameters
1851
+ header_params = opts[:header_params] || {}
1852
+ # HTTP header 'Accept' (if needed)
1853
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1854
+
1855
+ # form parameters
1856
+ form_params = opts[:form_params] || {}
1857
+
1858
+ # http body (model)
1859
+ post_body = opts[:debug_body]
1860
+
1861
+ # return_type
1862
+ return_type = opts[:debug_return_type] || 'Object'
1863
+
1864
+ # auth_names
1865
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1866
+
1867
+ new_options = opts.merge(
1868
+ :operation => :"TikTokApi.tiktok_trending_hashtags",
1869
+ :header_params => header_params,
1870
+ :query_params => query_params,
1871
+ :form_params => form_params,
1872
+ :body => post_body,
1873
+ :auth_names => auth_names,
1874
+ :return_type => return_type
1875
+ )
1876
+
1877
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1878
+ if @api_client.config.debugging
1879
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_trending_hashtags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1880
+ end
1881
+ return data, status_code, headers
1882
+ end
1883
+
1884
+ # Trending songs
1885
+ # Get trending songs/sounds (mobile hot-music feed — ranked by usage).
1886
+ # @param [Hash] opts the optional parameters
1887
+ # @option opts [String] :region (default to 'US')
1888
+ # @option opts [Integer] :period (default to 7)
1889
+ # @option opts [Integer] :count (default to 20)
1890
+ # @return [Object]
1891
+ def tiktok_trending_songs(opts = {})
1892
+ data, _status_code, _headers = tiktok_trending_songs_with_http_info(opts)
1893
+ data
1894
+ end
1895
+
1896
+ # Trending songs
1897
+ # Get trending songs/sounds (mobile hot-music feed — ranked by usage).
1898
+ # @param [Hash] opts the optional parameters
1899
+ # @option opts [String] :region (default to 'US')
1900
+ # @option opts [Integer] :period (default to 7)
1901
+ # @option opts [Integer] :count (default to 20)
1902
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1903
+ def tiktok_trending_songs_with_http_info(opts = {})
1904
+ if @api_client.config.debugging
1905
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_trending_songs ...'
1906
+ end
1907
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
1908
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_trending_songs, must be smaller than or equal to 50.'
1909
+ end
1910
+
1911
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
1912
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_trending_songs, must be greater than or equal to 1.'
1913
+ end
1914
+
1915
+ # resource path
1916
+ local_var_path = '/v1/tiktok/trending/songs'
1917
+
1918
+ # query parameters
1919
+ query_params = opts[:query_params] || {}
1920
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
1921
+ query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil?
1922
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
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 => :"TikTokApi.tiktok_trending_songs",
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: TikTokApi#tiktok_trending_songs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1954
+ end
1955
+ return data, status_code, headers
1956
+ end
1957
+
1958
+ # Trending videos
1959
+ # Get trending videos from the TikTok Explore feed.
1960
+ # @param [Hash] opts the optional parameters
1961
+ # @option opts [String] :region (default to 'US')
1962
+ # @option opts [Integer] :count (default to 20)
1963
+ # @return [Object]
1964
+ def tiktok_trending_videos(opts = {})
1965
+ data, _status_code, _headers = tiktok_trending_videos_with_http_info(opts)
1966
+ data
1967
+ end
1968
+
1969
+ # Trending videos
1970
+ # Get trending videos from the TikTok Explore feed.
1971
+ # @param [Hash] opts the optional parameters
1972
+ # @option opts [String] :region (default to 'US')
1973
+ # @option opts [Integer] :count (default to 20)
1974
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1975
+ def tiktok_trending_videos_with_http_info(opts = {})
1976
+ if @api_client.config.debugging
1977
+ @api_client.config.logger.debug 'Calling API: TikTokApi.tiktok_trending_videos ...'
1978
+ end
1979
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
1980
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_trending_videos, must be smaller than or equal to 50.'
1981
+ end
1982
+
1983
+ if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
1984
+ fail ArgumentError, 'invalid value for "opts[:"count"]" when calling TikTokApi.tiktok_trending_videos, must be greater than or equal to 1.'
1985
+ end
1986
+
1987
+ # resource path
1988
+ local_var_path = '/v1/tiktok/trending/videos'
1989
+
1990
+ # query parameters
1991
+ query_params = opts[:query_params] || {}
1992
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
1993
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
1994
+
1995
+ # header parameters
1996
+ header_params = opts[:header_params] || {}
1997
+ # HTTP header 'Accept' (if needed)
1998
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1999
+
2000
+ # form parameters
2001
+ form_params = opts[:form_params] || {}
2002
+
2003
+ # http body (model)
2004
+ post_body = opts[:debug_body]
2005
+
2006
+ # return_type
2007
+ return_type = opts[:debug_return_type] || 'Object'
2008
+
2009
+ # auth_names
2010
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
2011
+
2012
+ new_options = opts.merge(
2013
+ :operation => :"TikTokApi.tiktok_trending_videos",
2014
+ :header_params => header_params,
2015
+ :query_params => query_params,
2016
+ :form_params => form_params,
2017
+ :body => post_body,
2018
+ :auth_names => auth_names,
2019
+ :return_type => return_type
2020
+ )
2021
+
2022
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2023
+ if @api_client.config.debugging
2024
+ @api_client.config.logger.debug "API called: TikTokApi#tiktok_trending_videos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2025
+ end
2026
+ return data, status_code, headers
2027
+ end
2028
+ end
2029
+ end