Class: Amocrm::Resources::EntityNotesByParent

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ EntityNotesByParent

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

Parameters:



183
184
185
# File 'lib/amocrm/resources/entity_notes_by_parent.rb', line 183

def initialize(client:)
  @client = client
end

Instance Method Details

#create_by_parent(entity_id, entity_type:, body:, request_options: {}) ⇒ Amocrm::Models::EntityNotesByParentCreateByParentResponse::NoteCreateResponse, Amocrm::Models::EntityNotesByParentCreateByParentResponse::Problem

Create notes for a specific entity.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/amocrm/resources/entity_notes_by_parent.rb', line 21

def create_by_parent(entity_id, params)
  parsed, options = Amocrm::EntityNotesByParentCreateByParentParams.dump_request(params)
  entity_type =
    parsed.delete(:entity_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["api/v4/%1$s/%2$s/notes", entity_type, entity_id],
    body: parsed[:body],
    model: Amocrm::Models::EntityNotesByParentCreateByParentResponse,
    options: options
  )
end

#get_by_parent_id(note_id, entity_type:, entity_id:, with: nil, request_options: {}) ⇒ Amocrm::Models::EntityNotesByParentGetByParentIDResponse::Note, Amocrm::Models::EntityNotesByParentGetByParentIDResponse::Problem

Get note by id for a specific entity.

Parameters:

Returns:

See Also:



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/amocrm/resources/entity_notes_by_parent.rb', line 53

def get_by_parent_id(note_id, params)
  parsed, options = Amocrm::EntityNotesByParentGetByParentIDParams.dump_request(params)
  query = Amocrm::Internal::Util.encode_query_params(parsed)
  entity_type =
    parsed.delete(:entity_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  entity_id =
    parsed.delete(:entity_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["api/v4/%1$s/%2$s/notes/%3$s", entity_type, entity_id, note_id],
    query: query,
    model: Amocrm::Models::EntityNotesByParentGetByParentIDResponse,
    options: options
  )
end

#list_by_parent(entity_id, entity_type:, filter: nil, limit: nil, page: nil, request_options: {}) ⇒ Amocrm::Models::EntityNotesByParentListByParentResponse::NoteListResponse, Amocrm::Models::EntityNotesByParentListByParentResponse::Problem

Get notes list for a specific entity.

Parameters:

Returns:

See Also:



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/amocrm/resources/entity_notes_by_parent.rb', line 92

def list_by_parent(entity_id, params)
  parsed, options = Amocrm::EntityNotesByParentListByParentParams.dump_request(params)
  query = Amocrm::Internal::Util.encode_query_params(parsed)
  entity_type =
    parsed.delete(:entity_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["api/v4/%1$s/%2$s/notes", entity_type, entity_id],
    query: query,
    model: Amocrm::Models::EntityNotesByParentListByParentResponse,
    options: options
  )
end

#update_by_parent(entity_id, entity_type:, body:, request_options: {}) ⇒ Amocrm::Models::EntityNotesByParentUpdateByParentResponse::NoteCreateResponse, Amocrm::Models::EntityNotesByParentUpdateByParentResponse::Problem

Update notes for a specific entity (batch).



123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/amocrm/resources/entity_notes_by_parent.rb', line 123

def update_by_parent(entity_id, params)
  parsed, options = Amocrm::EntityNotesByParentUpdateByParentParams.dump_request(params)
  entity_type =
    parsed.delete(:entity_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :patch,
    path: ["api/v4/%1$s/%2$s/notes", entity_type, entity_id],
    body: parsed[:body],
    model: Amocrm::Models::EntityNotesByParentUpdateByParentResponse,
    options: options
  )
end

#update_by_parent_id(note_id, entity_type:, body_entity_id: nil, note_type: nil, params: nil, updated_at: nil, updated_by: nil, request_options: {}) ⇒ Amocrm::Models::EntityNotesByParentUpdateByParentIDResponse::NoteCreateResponse, Amocrm::Models::EntityNotesByParentUpdateByParentIDResponse::Problem

Update note by id for a specific entity.

Parameters:

Returns:

See Also:



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/amocrm/resources/entity_notes_by_parent.rb', line 161

def update_by_parent_id(note_id, params)
  parsed, options = Amocrm::EntityNotesByParentUpdateByParentIDParams.dump_request(params)
  entity_type =
    parsed.delete(:entity_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  path_entity_id =
    parsed.delete(:path_entity_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :patch,
    path: ["api/v4/%1$s/%2$s/notes/%3$s", entity_type, path_entity_id, note_id],
    body: parsed,
    model: Amocrm::Models::EntityNotesByParentUpdateByParentIDResponse,
    options: options
  )
end