Class: Onlyfans::Resources::Notifications
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Notifications
- Defined in:
- lib/onlyfans/resources/notifications.rb,
lib/onlyfans/resources/notifications/tabs_order.rb
Overview
Endpoints for managingr account notifications
Defined Under Namespace
Classes: TabsOrder
Instance Attribute Summary collapse
-
#tabs_order ⇒ Onlyfans::Resources::Notifications::TabsOrder
readonly
Endpoints for managingr account notifications.
Instance Method Summary collapse
-
#get_counts(account, request_options: {}) ⇒ Onlyfans::Models::NotificationGetCountsResponse
Get a quick overview of all unread notification types.
-
#initialize(client:) ⇒ Notifications
constructor
private
A new instance of Notifications.
-
#list(account, from_id: nil, limit: nil, skip_users: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::NotificationListResponse
Some parameter documentations has been truncated, see Models::NotificationListParams for more details.
-
#mark_all_as_read(account, request_options: {}) ⇒ Onlyfans::Models::NotificationMarkAllAsReadResponse
Mark all notifications of this account as read.
-
#search_users(account, query:, request_options: {}) ⇒ Onlyfans::Models::NotificationSearchUsersResponse
Search users that have appeared in your notifications.
Constructor Details
#initialize(client:) ⇒ Notifications
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 Notifications.
113 114 115 116 |
# File 'lib/onlyfans/resources/notifications.rb', line 113 def initialize(client:) @client = client @tabs_order = Onlyfans::Resources::Notifications::TabsOrder.new(client: client) end |
Instance Attribute Details
#tabs_order ⇒ Onlyfans::Resources::Notifications::TabsOrder (readonly)
Endpoints for managingr account notifications
9 10 11 |
# File 'lib/onlyfans/resources/notifications.rb', line 9 def tabs_order @tabs_order end |
Instance Method Details
#get_counts(account, request_options: {}) ⇒ Onlyfans::Models::NotificationGetCountsResponse
Get a quick overview of all unread notification types
56 57 58 59 60 61 62 63 |
# File 'lib/onlyfans/resources/notifications.rb', line 56 def get_counts(account, params = {}) @client.request( method: :get, path: ["api/%1$s/notifications/counts", account], model: Onlyfans::Models::NotificationGetCountsResponse, options: params[:request_options] ) end |
#list(account, from_id: nil, limit: nil, skip_users: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::NotificationListResponse
Some parameter documentations has been truncated, see Models::NotificationListParams for more details.
List all notifications for the account
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/onlyfans/resources/notifications.rb', line 33 def list(account, params = {}) parsed, = Onlyfans::NotificationListParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/notifications", account], query: query, model: Onlyfans::Models::NotificationListResponse, options: ) end |
#mark_all_as_read(account, request_options: {}) ⇒ Onlyfans::Models::NotificationMarkAllAsReadResponse
Mark all notifications of this account as read
76 77 78 79 80 81 82 83 |
# File 'lib/onlyfans/resources/notifications.rb', line 76 def mark_all_as_read(account, params = {}) @client.request( method: :post, path: ["api/%1$s/notifications/mark-all-as-read", account], model: Onlyfans::Models::NotificationMarkAllAsReadResponse, options: params[:request_options] ) end |
#search_users(account, query:, request_options: {}) ⇒ Onlyfans::Models::NotificationSearchUsersResponse
Search users that have appeared in your notifications
98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/onlyfans/resources/notifications.rb', line 98 def search_users(account, params) parsed, = Onlyfans::NotificationSearchUsersParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/notifications/search-users", account], query: query, model: Onlyfans::Models::NotificationSearchUsersResponse, options: ) end |