Class: XTwitterScraper::Resources::Subscribe

Inherits:
Object
  • Object
show all
Defined in:
lib/x_twitter_scraper/resources/subscribe.rb,
sig/x_twitter_scraper/resources/subscribe.rbs

Overview

Subscription, billing, and credits

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Subscribe

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Subscribe.

Parameters:



33
34
35
# File 'lib/x_twitter_scraper/resources/subscribe.rb', line 33

def initialize(client:)
  @client = client
end

Instance Method Details

#create(tier: nil, request_options: {}) ⇒ XTwitterScraper::Models::SubscribeCreateResponse

Create a subscription checkout or billing-management URL only after the user confirms. The request never completes payment by itself.

Parameters:

Returns:

See Also:



19
20
21
22
23
24
25
26
27
28
# File 'lib/x_twitter_scraper/resources/subscribe.rb', line 19

def create(params = {})
  parsed, options = XTwitterScraper::SubscribeCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "subscribe",
    body: parsed,
    model: XTwitterScraper::Models::SubscribeCreateResponse,
    options: options
  )
end