Class: ContextIO::Threads

Inherits:
Object
  • Object
show all
Includes:
CallHelpers
Defined in:
lib/context_io/account/threads.rb

Constant Summary collapse

THREADS_READERS =
%I(gmail_thread_id email_message_ids person_info messages)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CallHelpers

#build_url, #call_api_return_new_object, #call_api_return_updated_object, #delete, #get_request, #parse_response, #return_post_api_call_made, #success?, #validate_params

Methods included from CollectionHelper

#collection_return, #contact_collection_return

Constructor Details

#initialize(parent:, identifier: nil, response: nil, status: nil, success: nil, api_call_made: nil) ⇒ Threads

Returns a new instance of Threads.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/context_io/account/threads.rb', line 12

def initialize(parent:,
               identifier: nil,
               response: nil,
               status: nil,
               success: nil,
               api_call_made: nil)
  @parent = parent
  @connection = parent.connection
  @thread_id = identifier
  @response = response
  @status = status
  @success = success
  @api_call_made = api_call_made
end

Instance Attribute Details

#api_call_madeObject (readonly)

Returns the value of attribute api_call_made.



10
11
12
# File 'lib/context_io/account/threads.rb', line 10

def api_call_made
  @api_call_made
end

Instance Method Details

#call_urlObject



27
28
29
# File 'lib/context_io/account/threads.rb', line 27

def call_url
  build_url("threads", thread_id)
end

#get(**kwargs) ⇒ Object



31
32
33
# File 'lib/context_io/account/threads.rb', line 31

def get(**kwargs)
  get_request(given_params: kwargs, valid_params: ValidGetParams::THREAD)
end