Class: Repull::ConversationsApi
- Inherits:
-
Object
- Object
- Repull::ConversationsApi
- Defined in:
- lib/repull/api/conversations_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_conversation(id, opts = {}) ⇒ ConversationDetail
Get conversation detail Returns one thread (the same shape as the list-row ‘Conversation`) plus expanded `host` (from `airbnb_hosts` for the thread’s ‘host_id`) and `guest` (resolved via the thread’s ‘reservation_id`, with up to 50 contacts) blocks.
-
#get_conversation_with_http_info(id, opts = {}) ⇒ Array<(ConversationDetail, Integer, Hash)>
Get conversation detail Returns one thread (the same shape as the list-row `Conversation`) plus expanded `host` (from `airbnb_hosts` for the thread's `host_id`) and `guest` (resolved via the thread's `reservation_id`, with up to 50 contacts) blocks.
-
#initialize(api_client = ApiClient.default) ⇒ ConversationsApi
constructor
A new instance of ConversationsApi.
-
#list_conversation_messages(id, opts = {}) ⇒ MessageListResponse
List messages in a conversation Cursor-paginated messages within one thread.
-
#list_conversation_messages_with_http_info(id, opts = {}) ⇒ Array<(MessageListResponse, Integer, Hash)>
List messages in a conversation Cursor-paginated messages within one thread.
-
#list_conversations(opts = {}) ⇒ ConversationListResponse
List conversations Cursor-paginated list of message threads owned by the workspace.
-
#list_conversations_with_http_info(opts = {}) ⇒ Array<(ConversationListResponse, Integer, Hash)>
List conversations Cursor-paginated list of message threads owned by the workspace.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ConversationsApi
Returns a new instance of ConversationsApi.
19 20 21 |
# File 'lib/repull/api/conversations_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/repull/api/conversations_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_conversation(id, opts = {}) ⇒ ConversationDetail
Get conversation detail Returns one thread (the same shape as the list-row ‘Conversation`) plus expanded `host` (from `airbnb_hosts` for the thread’s ‘host_id`) and `guest` (resolved via the thread’s ‘reservation_id`, with up to 50 contacts) blocks.
28 29 30 31 |
# File 'lib/repull/api/conversations_api.rb', line 28 def get_conversation(id, opts = {}) data, _status_code, _headers = get_conversation_with_http_info(id, opts) data end |
#get_conversation_with_http_info(id, opts = {}) ⇒ Array<(ConversationDetail, Integer, Hash)>
Get conversation detail Returns one thread (the same shape as the list-row `Conversation`) plus expanded `host` (from `airbnb_hosts` for the thread's `host_id`) and `guest` (resolved via the thread's `reservation_id`, with up to 50 contacts) blocks.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/repull/api/conversations_api.rb', line 39 def get_conversation_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConversationsApi.get_conversation ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ConversationsApi.get_conversation" end # resource path local_var_path = '/v1/conversations/{id}'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ConversationDetail' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ConversationsApi.get_conversation", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConversationsApi#get_conversation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_conversation_messages(id, opts = {}) ⇒ MessageListResponse
List messages in a conversation Cursor-paginated messages within one thread. Defaults to newest-first (‘?order=desc`); pass `?order=asc` for chronological replay. Use `pagination.nextCursor` from one response as the `cursor` query param of the next request.
97 98 99 100 |
# File 'lib/repull/api/conversations_api.rb', line 97 def (id, opts = {}) data, _status_code, _headers = (id, opts) data end |
#list_conversation_messages_with_http_info(id, opts = {}) ⇒ Array<(MessageListResponse, Integer, Hash)>
List messages in a conversation Cursor-paginated messages within one thread. Defaults to newest-first (`?order=desc`); pass `?order=asc` for chronological replay. Use `pagination.nextCursor` from one response as the `cursor` query param of the next request.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/repull/api/conversations_api.rb', line 111 def (id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConversationsApi.list_conversation_messages ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ConversationsApi.list_conversation_messages" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConversationsApi.list_conversation_messages, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConversationsApi.list_conversation_messages, must be greater than or equal to 1.' end allowable_values = ["asc", "desc"] if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order']) fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/conversations/{id}/messages'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'MessageListResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ConversationsApi.list_conversation_messages", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConversationsApi#list_conversation_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_conversations(opts = {}) ⇒ ConversationListResponse
List conversations Cursor-paginated list of message threads owned by the workspace. Backed by main vanio’s ‘/api/threads/list` which keyset-paginates against `(last_message_at, id)` for constant per-page cost. Use `pagination.nextCursor` from one response as the `cursor` query param of the next request. Filters: `platform` (`airbnb`|`booking`|`vrbo`|`website`|`email`), `status` (`open`|`archived` — `archived` is a stable no-op until the bit lands on `message_threads`).
184 185 186 187 |
# File 'lib/repull/api/conversations_api.rb', line 184 def list_conversations(opts = {}) data, _status_code, _headers = list_conversations_with_http_info(opts) data end |
#list_conversations_with_http_info(opts = {}) ⇒ Array<(ConversationListResponse, Integer, Hash)>
List conversations Cursor-paginated list of message threads owned by the workspace. Backed by main vanio's `/api/threads/list` which keyset-paginates against `(last_message_at, id)` for constant per-page cost. Use `pagination.nextCursor` from one response as the `cursor` query param of the next request. Filters: `platform` (`airbnb`|`booking`|`vrbo`|`website`|`email`), `status` (`open`|`archived` — `archived` is a stable no-op until the bit lands on `message_threads`).
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/repull/api/conversations_api.rb', line 198 def list_conversations_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConversationsApi.list_conversations ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConversationsApi.list_conversations, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConversationsApi.list_conversations, must be greater than or equal to 1.' end allowable_values = ["airbnb", "booking", "vrbo", "website", "email"] if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform']) fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}" end allowable_values = ["open", "archived"] if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/conversations' # query parameters query_params = opts[:query_params] || {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ConversationListResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ConversationsApi.list_conversations", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConversationsApi#list_conversations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |