Class: WhopSDK::Resources::Reactions
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Reactions
- Defined in:
- lib/whop_sdk/resources/reactions.rb
Instance Method Summary collapse
-
#create(resource_id: , emoji: nil, request_options: {}) ⇒ WhopSDK::Models::Reaction
Some parameter documentations has been truncated, see Models::ReactionCreateParams for more details.
-
#initialize(client:) ⇒ Reactions
constructor
private
A new instance of Reactions.
-
#list(resource_id: , after: nil, before: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ReactionListResponse>
Lists reactions for a post or a message.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Reaction
Retrieves a reaction.
Constructor Details
#initialize(client:) ⇒ Reactions
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 Reactions.
99 100 101 |
# File 'lib/whop_sdk/resources/reactions.rb', line 99 def initialize(client:) @client = client end |
Instance Method Details
#create(resource_id: , emoji: nil, request_options: {}) ⇒ WhopSDK::Models::Reaction
Some parameter documentations has been truncated, see Models::ReactionCreateParams for more details.
Creates a new reaction
Required permissions:
-
‘chat:read`
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/whop_sdk/resources/reactions.rb', line 26 def create(params) parsed, = WhopSDK::ReactionCreateParams.dump_request(params) @client.request( method: :post, path: "reactions", body: parsed, model: WhopSDK::Reaction, options: ) end |
#list(resource_id: , after: nil, before: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ReactionListResponse>
Lists reactions for a post or a message
Required permissions:
-
‘chat:read`
84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/whop_sdk/resources/reactions.rb', line 84 def list(params) parsed, = WhopSDK::ReactionListParams.dump_request(params) @client.request( method: :get, path: "reactions", query: parsed, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::ReactionListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Reaction
Retrieves a reaction
Required permissions:
-
‘chat:read`
52 53 54 55 56 57 58 59 |
# File 'lib/whop_sdk/resources/reactions.rb', line 52 def retrieve(id, params = {}) @client.request( method: :get, path: ["reactions/%1$s", id], model: WhopSDK::Reaction, options: params[:request_options] ) end |