Class: WhopSDK::Resources::SupportChannels
- Inherits:
-
Object
- Object
- WhopSDK::Resources::SupportChannels
- Defined in:
- lib/whop_sdk/resources/support_channels.rb
Instance Method Summary collapse
-
#create(company_id: , user_id: , request_options: {}) ⇒ WhopSDK::Models::SupportChannel
Create a new support channel for a user in a company.
-
#initialize(client:) ⇒ SupportChannels
constructor
private
A new instance of SupportChannels.
-
#list(company_id: , after: nil, before: nil, direction: nil, first: nil, last: nil, open_: nil, order: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::SupportChannelListResponse>
Some parameter documentations has been truncated, see Models::SupportChannelListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::SupportChannel
Retrieves a support channel.
Constructor Details
#initialize(client:) ⇒ SupportChannels
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 SupportChannels.
105 106 107 |
# File 'lib/whop_sdk/resources/support_channels.rb', line 105 def initialize(client:) @client = client end |
Instance Method Details
#create(company_id: , user_id: , request_options: {}) ⇒ WhopSDK::Models::SupportChannel
Create a new support channel for a user in a company. If one already exists, it will return the existing one.
Required permissions:
-
‘support_chat:create`
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/whop_sdk/resources/support_channels.rb', line 24 def create(params) parsed, = WhopSDK::SupportChannelCreateParams.dump_request(params) @client.request( method: :post, path: "support_channels", body: parsed, model: WhopSDK::SupportChannel, options: ) end |
#list(company_id: , after: nil, before: nil, direction: nil, first: nil, last: nil, open_: nil, order: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::SupportChannelListResponse>
Some parameter documentations has been truncated, see Models::SupportChannelListParams for more details.
Lists chat channels inside a company
Required permissions:
-
‘support_chat:read`
90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/whop_sdk/resources/support_channels.rb', line 90 def list(params) parsed, = WhopSDK::SupportChannelListParams.dump_request(params) @client.request( method: :get, path: "support_channels", query: parsed.transform_keys(open_: "open"), page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::SupportChannelListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::SupportChannel
Retrieves a support channel
Required permissions:
-
‘support_chat:read`
49 50 51 52 53 54 55 56 |
# File 'lib/whop_sdk/resources/support_channels.rb', line 49 def retrieve(id, params = {}) @client.request( method: :get, path: ["support_channels/%1$s", id], model: WhopSDK::SupportChannel, options: params[:request_options] ) end |