Class: Onlyfans::Resources::Settings::BlockedCountries

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ BlockedCountries

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

Parameters:



59
60
61
# File 'lib/onlyfans/resources/settings/blocked_countries.rb', line 59

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(account, request_options: {}) ⇒ Onlyfans::Models::Settings::BlockedCountryRetrieveResponse

Returns the countries blocked from viewing the account.

Parameters:

Returns:

See Also:



18
19
20
21
22
23
24
25
# File 'lib/onlyfans/resources/settings/blocked_countries.rb', line 18

def retrieve(, params = {})
  @client.request(
    method: :get,
    path: ["api/%1$s/settings/blocked-countries", ],
    model: Onlyfans::Models::Settings::BlockedCountryRetrieveResponse,
    options: params[:request_options]
  )
end

#update(account, blocked_countries:, blocked_states: nil, request_options: {}) ⇒ Onlyfans::Models::Settings::BlockedCountryUpdateResponse

Some parameter documentations has been truncated, see Models::Settings::BlockedCountryUpdateParams for more details.

Updates the countries blocked from viewing the account.

Parameters:

  • account (String)

    The Account ID

  • blocked_countries (Array<String>)

    List of all ISO 3166-1 alpha-2 country codes to block including existing ones. I

  • blocked_states (Array<String>)

    Blocked states payload forwarded to OnlyFans. Defaults to an empty array.

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

Returns:

See Also:



45
46
47
48
49
50
51
52
53
54
# File 'lib/onlyfans/resources/settings/blocked_countries.rb', line 45

def update(, params)
  parsed, options = Onlyfans::Settings::BlockedCountryUpdateParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["api/%1$s/settings/blocked-countries", ],
    body: parsed,
    model: Onlyfans::Models::Settings::BlockedCountryUpdateResponse,
    options: options
  )
end