Class: Zernio::TwitterEngagementApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zernio-sdk/api/twitter_engagement_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TwitterEngagementApi

Returns a new instance of TwitterEngagementApi.



19
20
21
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#bookmark_post(bookmark_post_request, opts = {}) ⇒ BookmarkPost200Response

Bookmark a tweet Bookmark a tweet by ID. Requires the bookmark.write OAuth scope. Rate limit: 50 requests per 15-min window.

Parameters:

  • bookmark_post_request (BookmarkPostRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 27

def bookmark_post(bookmark_post_request, opts = {})
  data, _status_code, _headers = bookmark_post_with_http_info(bookmark_post_request, opts)
  data
end

#bookmark_post_with_http_info(bookmark_post_request, opts = {}) ⇒ Array<(BookmarkPost200Response, Integer, Hash)>

Bookmark a tweet Bookmark a tweet by ID. Requires the bookmark.write OAuth scope. Rate limit: 50 requests per 15-min window.

Parameters:

  • bookmark_post_request (BookmarkPostRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BookmarkPost200Response, Integer, Hash)>)

    BookmarkPost200Response data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 37

def bookmark_post_with_http_info(bookmark_post_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TwitterEngagementApi.bookmark_post ...'
  end
  # verify the required parameter 'bookmark_post_request' is set
  if @api_client.config.client_side_validation && bookmark_post_request.nil?
    fail ArgumentError, "Missing the required parameter 'bookmark_post_request' when calling TwitterEngagementApi.bookmark_post"
  end
  # resource path
  local_var_path = '/v1/twitter/bookmark'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(bookmark_post_request)

  # return_type
  return_type = opts[:debug_return_type] || 'BookmarkPost200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"TwitterEngagementApi.bookmark_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TwitterEngagementApi#bookmark_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#follow_user(follow_user_request, opts = {}) ⇒ FollowUser200Response

Follow a user Follow a user on X/Twitter. Requires the follows.write OAuth scope. For protected accounts, a follow request is sent instead (pending_follow will be true).

Parameters:

  • follow_user_request (FollowUserRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



95
96
97
98
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 95

def follow_user(follow_user_request, opts = {})
  data, _status_code, _headers = follow_user_with_http_info(follow_user_request, opts)
  data
end

#follow_user_with_http_info(follow_user_request, opts = {}) ⇒ Array<(FollowUser200Response, Integer, Hash)>

Follow a user Follow a user on X/Twitter. Requires the follows.write OAuth scope. For protected accounts, a follow request is sent instead (pending_follow will be true).

Parameters:

  • follow_user_request (FollowUserRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(FollowUser200Response, Integer, Hash)>)

    FollowUser200Response data, response status code and response headers



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 105

def follow_user_with_http_info(follow_user_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TwitterEngagementApi.follow_user ...'
  end
  # verify the required parameter 'follow_user_request' is set
  if @api_client.config.client_side_validation && follow_user_request.nil?
    fail ArgumentError, "Missing the required parameter 'follow_user_request' when calling TwitterEngagementApi.follow_user"
  end
  # resource path
  local_var_path = '/v1/twitter/follow'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(follow_user_request)

  # return_type
  return_type = opts[:debug_return_type] || 'FollowUser200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"TwitterEngagementApi.follow_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TwitterEngagementApi#follow_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_bookmark(account_id, tweet_id, opts = {}) ⇒ RemoveBookmark200Response

Remove bookmark Remove a bookmark from a tweet.

Parameters:

  • account_id (String)
  • tweet_id (String)

    The ID of the tweet to unbookmark

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



164
165
166
167
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 164

def remove_bookmark(, tweet_id, opts = {})
  data, _status_code, _headers = remove_bookmark_with_http_info(, tweet_id, opts)
  data
end

#remove_bookmark_with_http_info(account_id, tweet_id, opts = {}) ⇒ Array<(RemoveBookmark200Response, Integer, Hash)>

Remove bookmark Remove a bookmark from a tweet.

Parameters:

  • account_id (String)
  • tweet_id (String)

    The ID of the tweet to unbookmark

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RemoveBookmark200Response, Integer, Hash)>)

    RemoveBookmark200Response data, response status code and response headers



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 175

def remove_bookmark_with_http_info(, tweet_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TwitterEngagementApi.remove_bookmark ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling TwitterEngagementApi.remove_bookmark"
  end
  # verify the required parameter 'tweet_id' is set
  if @api_client.config.client_side_validation && tweet_id.nil?
    fail ArgumentError, "Missing the required parameter 'tweet_id' when calling TwitterEngagementApi.remove_bookmark"
  end
  # resource path
  local_var_path = '/v1/twitter/bookmark'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'tweetId'] = tweet_id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RemoveBookmark200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"TwitterEngagementApi.remove_bookmark",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TwitterEngagementApi#remove_bookmark\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retweet_post(retweet_post_request, opts = {}) ⇒ RetweetPost200Response

Retweet a post Retweet (repost) a tweet by ID. Rate limit: 50 requests per 15-min window. Shares the 300/3hr creation limit with tweet creation.

Parameters:

  • retweet_post_request (RetweetPostRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



234
235
236
237
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 234

def retweet_post(retweet_post_request, opts = {})
  data, _status_code, _headers = retweet_post_with_http_info(retweet_post_request, opts)
  data
end

#retweet_post_with_http_info(retweet_post_request, opts = {}) ⇒ Array<(RetweetPost200Response, Integer, Hash)>

Retweet a post Retweet (repost) a tweet by ID. Rate limit: 50 requests per 15-min window. Shares the 300/3hr creation limit with tweet creation.

Parameters:

  • retweet_post_request (RetweetPostRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RetweetPost200Response, Integer, Hash)>)

    RetweetPost200Response data, response status code and response headers



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 244

def retweet_post_with_http_info(retweet_post_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TwitterEngagementApi.retweet_post ...'
  end
  # verify the required parameter 'retweet_post_request' is set
  if @api_client.config.client_side_validation && retweet_post_request.nil?
    fail ArgumentError, "Missing the required parameter 'retweet_post_request' when calling TwitterEngagementApi.retweet_post"
  end
  # resource path
  local_var_path = '/v1/twitter/retweet'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(retweet_post_request)

  # return_type
  return_type = opts[:debug_return_type] || 'RetweetPost200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"TwitterEngagementApi.retweet_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TwitterEngagementApi#retweet_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_tweets(account_id, query, opts = {}) ⇒ SearchTweets200Response

Search recent tweets Search public tweets from the last 7 days matching an X search query, e.g. to discover tweets to reply to. The query string is passed through to X unchanged and supports X's search operators (from:user, -is:retweet, is:reply, lang:en, \"exact phrase\", conversation_id:123, boolean OR, ...). Note that standalone operators like is: / has: / lang: must be combined with a keyword or from: clause. To reply to a found tweet, pass its id as the twitter platform entry's platformSpecificData.replyToTweetId when creating a post. Rate limit: 300 requests per 15-min window per connected account.

Parameters:

  • account_id (String)

    The social account ID

  • query (String)

    X search query, max 512 characters. Operators are passed through unchanged; X rejects malformed queries with a 400.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Results per page. X requires a minimum of 10; values below 10 are rejected. (default to 10)

  • :since_id (String)

    Only return tweets with an ID greater than (more recent than) this numeric tweet ID. Non-numeric values are rejected with 400.

  • :until_id (String)

    Only return tweets with an ID less than (older than) this numeric tweet ID. Non-numeric values are rejected with 400.

  • :start_time (Time)

    Oldest UTC timestamp (ISO 8601, inclusive), within the last 7 days

  • :end_time (Time)

    Newest UTC timestamp (ISO 8601, exclusive), within the last 7 days

  • :cursor (String)

    Pagination cursor from a previous response

  • :sort_order (String) — default: default to 'recency'

Returns:



310
311
312
313
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 310

def search_tweets(, query, opts = {})
  data, _status_code, _headers = search_tweets_with_http_info(, query, opts)
  data
end

#search_tweets_with_http_info(account_id, query, opts = {}) ⇒ Array<(SearchTweets200Response, Integer, Hash)>

Search recent tweets Search public tweets from the last 7 days matching an X search query, e.g. to discover tweets to reply to. The query string is passed through to X unchanged and supports X's search operators (`from:user`, `-is:retweet`, `is:reply`, `lang:en`, `&quot;exact phrase&quot;`, `conversation_id:123`, boolean `OR`, ...). Note that standalone operators like `is:` / `has:` / `lang:` must be combined with a keyword or `from:` clause. To reply to a found tweet, pass its `id` as the twitter platform entry's `platformSpecificData.replyToTweetId` when creating a post. Rate limit: 300 requests per 15-min window per connected account.

Parameters:

  • account_id (String)

    The social account ID

  • query (String)

    X search query, max 512 characters. Operators are passed through unchanged; X rejects malformed queries with a 400.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Results per page. X requires a minimum of 10; values below 10 are rejected. (default to 10)

  • :since_id (String)

    Only return tweets with an ID greater than (more recent than) this numeric tweet ID. Non-numeric values are rejected with 400.

  • :until_id (String)

    Only return tweets with an ID less than (older than) this numeric tweet ID. Non-numeric values are rejected with 400.

  • :start_time (Time)

    Oldest UTC timestamp (ISO 8601, inclusive), within the last 7 days

  • :end_time (Time)

    Newest UTC timestamp (ISO 8601, exclusive), within the last 7 days

  • :cursor (String)

    Pagination cursor from a previous response

  • :sort_order (String) — default: default to 'recency'

Returns:

  • (Array<(SearchTweets200Response, Integer, Hash)>)

    SearchTweets200Response data, response status code and response headers



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 328

def search_tweets_with_http_info(, query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TwitterEngagementApi.search_tweets ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling TwitterEngagementApi.search_tweets"
  end
  # verify the required parameter 'query' is set
  if @api_client.config.client_side_validation && query.nil?
    fail ArgumentError, "Missing the required parameter 'query' when calling TwitterEngagementApi.search_tweets"
  end
  if @api_client.config.client_side_validation && query.to_s.length > 512
    fail ArgumentError, 'invalid value for "query" when calling TwitterEngagementApi.search_tweets, the character length must be smaller than or equal to 512.'
  end

  if @api_client.config.client_side_validation && query.to_s.length < 1
    fail ArgumentError, 'invalid value for "query" when calling TwitterEngagementApi.search_tweets, the character length must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TwitterEngagementApi.search_tweets, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 10
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TwitterEngagementApi.search_tweets, must be greater than or equal to 10.'
  end

  pattern = Regexp.new(/^[0-9]{1,19}$/)
  if @api_client.config.client_side_validation && !opts[:'since_id'].nil? && opts[:'since_id'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"since_id\"]' when calling TwitterEngagementApi.search_tweets, must conform to the pattern #{pattern}."
  end

  pattern = Regexp.new(/^[0-9]{1,19}$/)
  if @api_client.config.client_side_validation && !opts[:'until_id'].nil? && opts[:'until_id'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"until_id\"]' when calling TwitterEngagementApi.search_tweets, must conform to the pattern #{pattern}."
  end

  allowable_values = ["recency", "relevancy"]
  if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order'])
    fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/twitter/search'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'query'] = query
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sinceId'] = opts[:'since_id'] if !opts[:'since_id'].nil?
  query_params[:'untilId'] = opts[:'until_id'] if !opts[:'until_id'].nil?
  query_params[:'startTime'] = opts[:'start_time'] if !opts[:'start_time'].nil?
  query_params[:'endTime'] = opts[:'end_time'] if !opts[:'end_time'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SearchTweets200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"TwitterEngagementApi.search_tweets",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TwitterEngagementApi#search_tweets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#undo_retweet(account_id, tweet_id, opts = {}) ⇒ UndoRetweet200Response

Undo retweet Undo a retweet (un-repost a tweet).

Parameters:

  • account_id (String)
  • tweet_id (String)

    The ID of the original tweet to un-retweet

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



425
426
427
428
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 425

def undo_retweet(, tweet_id, opts = {})
  data, _status_code, _headers = undo_retweet_with_http_info(, tweet_id, opts)
  data
end

#undo_retweet_with_http_info(account_id, tweet_id, opts = {}) ⇒ Array<(UndoRetweet200Response, Integer, Hash)>

Undo retweet Undo a retweet (un-repost a tweet).

Parameters:

  • account_id (String)
  • tweet_id (String)

    The ID of the original tweet to un-retweet

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(UndoRetweet200Response, Integer, Hash)>)

    UndoRetweet200Response data, response status code and response headers



436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 436

def undo_retweet_with_http_info(, tweet_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TwitterEngagementApi.undo_retweet ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling TwitterEngagementApi.undo_retweet"
  end
  # verify the required parameter 'tweet_id' is set
  if @api_client.config.client_side_validation && tweet_id.nil?
    fail ArgumentError, "Missing the required parameter 'tweet_id' when calling TwitterEngagementApi.undo_retweet"
  end
  # resource path
  local_var_path = '/v1/twitter/retweet'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'tweetId'] = tweet_id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UndoRetweet200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"TwitterEngagementApi.undo_retweet",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TwitterEngagementApi#undo_retweet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unfollow_user(account_id, target_user_id, opts = {}) ⇒ UnfollowUser200Response

Unfollow a user Unfollow a user on X/Twitter.

Parameters:

  • account_id (String)
  • target_user_id (String)

    The Twitter ID of the user to unfollow

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



496
497
498
499
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 496

def unfollow_user(, target_user_id, opts = {})
  data, _status_code, _headers = unfollow_user_with_http_info(, target_user_id, opts)
  data
end

#unfollow_user_with_http_info(account_id, target_user_id, opts = {}) ⇒ Array<(UnfollowUser200Response, Integer, Hash)>

Unfollow a user Unfollow a user on X/Twitter.

Parameters:

  • account_id (String)
  • target_user_id (String)

    The Twitter ID of the user to unfollow

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(UnfollowUser200Response, Integer, Hash)>)

    UnfollowUser200Response data, response status code and response headers



507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
# File 'lib/zernio-sdk/api/twitter_engagement_api.rb', line 507

def unfollow_user_with_http_info(, target_user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TwitterEngagementApi.unfollow_user ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling TwitterEngagementApi.unfollow_user"
  end
  # verify the required parameter 'target_user_id' is set
  if @api_client.config.client_side_validation && target_user_id.nil?
    fail ArgumentError, "Missing the required parameter 'target_user_id' when calling TwitterEngagementApi.unfollow_user"
  end
  # resource path
  local_var_path = '/v1/twitter/follow'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'targetUserId'] = target_user_id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UnfollowUser200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"TwitterEngagementApi.unfollow_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TwitterEngagementApi#unfollow_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end