Class: HubSpotSDK::Resources::Conversations::CustomChannels::ChannelAccounts
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Conversations::CustomChannels::ChannelAccounts
- Defined in:
- lib/hubspot_sdk/resources/conversations/custom_channels/channel_accounts.rb
Instance Method Summary collapse
-
#create(channel_id, authorized:, inbox_id:, name:, delivery_identifier: nil, request_options: {}) ⇒ HubSpotSDK::Models::Conversations::PublicChannelAccount
Create a new account for a channel.
-
#initialize(client:) ⇒ ChannelAccounts
constructor
private
A new instance of ChannelAccounts.
-
#list(channel_id, after: nil, archived: nil, default_page_length: nil, delivery_identifier_type: nil, delivery_identifier_value: nil, limit: nil, sort: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Conversations::PublicChannelAccount>
Some parameter documentations has been truncated, see Models::Conversations::CustomChannels::ChannelAccountListParams for more details.
-
#update(channel_account_id, channel_id:, authorized: nil, name: nil, request_options: {}) ⇒ HubSpotSDK::Models::Conversations::PublicChannelAccount
This API is used to update the name of the channel account and it’s isAuthorized status.
-
#update_staging_token(account_token, channel_id:, account_name: nil, delivery_identifier: nil, request_options: {}) ⇒ HubSpotSDK::Models::Conversations::PublicChannelAccountStagingToken
Update a channel account staging token’s account name and delivery identifier.
Constructor Details
#initialize(client:) ⇒ ChannelAccounts
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 ChannelAccounts.
162 163 164 |
# File 'lib/hubspot_sdk/resources/conversations/custom_channels/channel_accounts.rb', line 162 def initialize(client:) @client = client end |
Instance Method Details
#create(channel_id, authorized:, inbox_id:, name:, delivery_identifier: nil, request_options: {}) ⇒ HubSpotSDK::Models::Conversations::PublicChannelAccount
Create a new account for a channel. Multiple accounts can communicate over a single channel using different delivery identifiers.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/hubspot_sdk/resources/conversations/custom_channels/channel_accounts.rb', line 23 def create(channel_id, params) parsed, = HubSpotSDK::Conversations::CustomChannels::ChannelAccountCreateParams.dump_request(params) @client.request( method: :post, path: ["conversations/custom-channels/2026-03/%1$s/channel-accounts", channel_id], body: parsed, model: HubSpotSDK::Conversations::PublicChannelAccount, options: ) end |
#list(channel_id, after: nil, archived: nil, default_page_length: nil, delivery_identifier_type: nil, delivery_identifier_value: nil, limit: nil, sort: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Conversations::PublicChannelAccount>
Some parameter documentations has been truncated, see Models::Conversations::CustomChannels::ChannelAccountListParams for more details.
Retrieve a list of accounts for a custom channel.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/hubspot_sdk/resources/conversations/custom_channels/channel_accounts.rb', line 102 def list(channel_id, params = {}) parsed, = HubSpotSDK::Conversations::CustomChannels::ChannelAccountListParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["conversations/custom-channels/2026-03/%1$s/channel-accounts", channel_id], query: query.transform_keys( default_page_length: "defaultPageLength", delivery_identifier_type: "deliveryIdentifierType", delivery_identifier_value: "deliveryIdentifierValue" ), page: HubSpotSDK::Internal::Page, model: HubSpotSDK::Conversations::PublicChannelAccount, options: ) end |
#update(channel_account_id, channel_id:, authorized: nil, name: nil, request_options: {}) ⇒ HubSpotSDK::Models::Conversations::PublicChannelAccount
This API is used to update the name of the channel account and it’s isAuthorized status. Setting to isAuthorized flag to False disables the channel account.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/hubspot_sdk/resources/conversations/custom_channels/channel_accounts.rb', line 53 def update(channel_account_id, params) parsed, = HubSpotSDK::Conversations::CustomChannels::ChannelAccountUpdateParams.dump_request(params) channel_id = parsed.delete(:channel_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :patch, path: [ "conversations/custom-channels/2026-03/%1$s/channel-accounts/%2$s", channel_id, channel_account_id ], body: parsed, model: HubSpotSDK::Conversations::PublicChannelAccount, options: ) end |
#update_staging_token(account_token, channel_id:, account_name: nil, delivery_identifier: nil, request_options: {}) ⇒ HubSpotSDK::Models::Conversations::PublicChannelAccountStagingToken
Update a channel account staging token’s account name and delivery identifier. This information will be applied to the channel account created from this staging token. This is used for public apps.
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/hubspot_sdk/resources/conversations/custom_channels/channel_accounts.rb', line 139 def update_staging_token(account_token, params) parsed, = HubSpotSDK::Conversations::CustomChannels::ChannelAccountUpdateStagingTokenParams.dump_request(params) channel_id = parsed.delete(:channel_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :patch, path: [ "conversations/custom-channels/2026-03/%1$s/channel-account-staging-tokens/%2$s", channel_id, account_token ], body: parsed, model: HubSpotSDK::Conversations::PublicChannelAccountStagingToken, options: ) end |