Class: Onlyfans::Resources::Bundles

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/bundles.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Bundles

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 Bundles.

Parameters:



83
84
85
# File 'lib/onlyfans/resources/bundles.rb', line 83

def initialize(client:)
  @client = client
end

Instance Method Details

#create(account, discount:, duration:, request_options: {}) ⇒ Onlyfans::Models::BundleCreateResponse

Create a new bundle for the account.

Parameters:

Returns:

See Also:



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/onlyfans/resources/bundles.rb', line 21

def create(, params)
  parsed, options = Onlyfans::BundleCreateParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :post,
    path: ["api/%1$s/bundles", ],
    query: query,
    model: Onlyfans::Models::BundleCreateResponse,
    options: options
  )
end

#delete(bundle_id, account:, request_options: {}) ⇒ Onlyfans::Models::BundleDeleteResponse

Delete a bundle for the account.

Parameters:

  • bundle_id (String)

    The ID of the bundle to delete.

  • account (String)

    The Account ID

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/onlyfans/resources/bundles.rb', line 66

def delete(bundle_id, params)
  parsed, options = Onlyfans::BundleDeleteParams.dump_request(params)
   =
    parsed.delete(:account) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["api/%1$s/bundles/%2$s", , bundle_id],
    model: Onlyfans::Models::BundleDeleteResponse,
    options: options
  )
end

#list(account, request_options: {}) ⇒ Onlyfans::Models::BundleListResponse

List all bundles for the account.

Parameters:

Returns:

See Also:



44
45
46
47
48
49
50
51
# File 'lib/onlyfans/resources/bundles.rb', line 44

def list(, params = {})
  @client.request(
    method: :get,
    path: ["api/%1$s/bundles", ],
    model: Onlyfans::Models::BundleListResponse,
    options: params[:request_options]
  )
end