Class: Amocrm::Resources::Talks

Inherits:
Object
  • Object
show all
Defined in:
lib/amocrm/resources/talks.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Talks

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 Talks.

Parameters:



52
53
54
# File 'lib/amocrm/resources/talks.rb', line 52

def initialize(client:)
  @client = client
end

Instance Method Details

#close(id, force_close: nil, request_options: {}) ⇒ Amocrm::Models::TalkCloseResponse::EmptyResponse, Amocrm::Models::TalkCloseResponse::Problem

Close talk by id (optionally force without NPS bot).

Parameters:

  • id (Integer)
  • force_close (Boolean)

    Force close talk without NPS bot.

  • request_options (Amocrm::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



19
20
21
22
23
24
25
26
27
28
# File 'lib/amocrm/resources/talks.rb', line 19

def close(id, params = {})
  parsed, options = Amocrm::TalkCloseParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["api/v4/talks/%1$s/close", id],
    body: parsed,
    model: Amocrm::Models::TalkCloseResponse,
    options: options
  )
end

#get_by_id(id, request_options: {}) ⇒ Amocrm::Models::TalkGetByIDResponse::Talk, Amocrm::Models::TalkGetByIDResponse::Problem

Get talk by id.

Parameters:

Returns:

See Also:



40
41
42
43
44
45
46
47
# File 'lib/amocrm/resources/talks.rb', line 40

def get_by_id(id, params = {})
  @client.request(
    method: :get,
    path: ["api/v4/talks/%1$s", id],
    model: Amocrm::Models::TalkGetByIDResponse,
    options: params[:request_options]
  )
end