Class: Amocrm::Resources::EntityLinks
- Inherits:
-
Object
- Object
- Amocrm::Resources::EntityLinks
- Defined in:
- lib/amocrm/resources/entity_links.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ EntityLinks
constructor
private
A new instance of EntityLinks.
-
#link(entity_type, body:, request_options: {}) ⇒ Amocrm::Models::EntityLinkLinkResponse::EmptyResponse, Amocrm::Models::EntityLinkLinkResponse::Problem
Link entities (bulk).
-
#link_by_entity(entity_id, entity_type:, body:, request_options: {}) ⇒ Amocrm::Models::EntityLinkLinkByEntityResponse::EmptyResponse, Amocrm::Models::EntityLinkLinkByEntityResponse::Problem
Link entities for a specific entity.
-
#list(entity_type, filter: nil, request_options: {}) ⇒ Amocrm::Models::EntityLinkListResponse::EntityLinksResponse, Amocrm::Models::EntityLinkListResponse::Problem
Get list of linked entities (bulk).
-
#list_by_entity(entity_id, entity_type:, request_options: {}) ⇒ Amocrm::Models::EntityLinkListByEntityResponse::EntityLinksResponse, Amocrm::Models::EntityLinkListByEntityResponse::Problem
Get links for a specific entity.
-
#unlink(entity_type, body:, request_options: {}) ⇒ Amocrm::Models::EntityLinkUnlinkResponse::EmptyResponse, Amocrm::Models::EntityLinkUnlinkResponse::Problem
Unlink entities (bulk).
-
#unlink_by_entity(entity_id, entity_type:, body:, request_options: {}) ⇒ Amocrm::Models::EntityLinkUnlinkByEntityResponse::EmptyResponse, Amocrm::Models::EntityLinkUnlinkByEntityResponse::Problem
Unlink entities for a specific entity.
Constructor Details
#initialize(client:) ⇒ EntityLinks
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 EntityLinks.
161 162 163 |
# File 'lib/amocrm/resources/entity_links.rb', line 161 def initialize(client:) @client = client end |
Instance Method Details
#link(entity_type, body:, request_options: {}) ⇒ Amocrm::Models::EntityLinkLinkResponse::EmptyResponse, Amocrm::Models::EntityLinkLinkResponse::Problem
Link entities (bulk).
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/amocrm/resources/entity_links.rb', line 40 def link(entity_type, params) parsed, = Amocrm::EntityLinkLinkParams.dump_request(params) @client.request( method: :post, path: ["api/v4/%1$s/link", entity_type], body: parsed[:body], model: Amocrm::Models::EntityLinkLinkResponse, options: ) end |
#link_by_entity(entity_id, entity_type:, body:, request_options: {}) ⇒ Amocrm::Models::EntityLinkLinkByEntityResponse::EmptyResponse, Amocrm::Models::EntityLinkLinkByEntityResponse::Problem
Link entities for a specific entity.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/amocrm/resources/entity_links.rb', line 66 def link_by_entity(entity_id, params) parsed, = Amocrm::EntityLinkLinkByEntityParams.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/link", entity_type, entity_id], body: parsed[:body], model: Amocrm::Models::EntityLinkLinkByEntityResponse, options: ) end |
#list(entity_type, filter: nil, request_options: {}) ⇒ Amocrm::Models::EntityLinkListResponse::EntityLinksResponse, Amocrm::Models::EntityLinkListResponse::Problem
Get list of linked entities (bulk).
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/amocrm/resources/entity_links.rb', line 17 def list(entity_type, params = {}) parsed, = Amocrm::EntityLinkListParams.dump_request(params) query = Amocrm::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/v4/%1$s/links", entity_type], query: query, model: Amocrm::Models::EntityLinkListResponse, options: ) end |
#list_by_entity(entity_id, entity_type:, request_options: {}) ⇒ Amocrm::Models::EntityLinkListByEntityResponse::EntityLinksResponse, Amocrm::Models::EntityLinkListByEntityResponse::Problem
Get links for a specific entity.
92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/amocrm/resources/entity_links.rb', line 92 def list_by_entity(entity_id, params) parsed, = Amocrm::EntityLinkListByEntityParams.dump_request(params) 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/links", entity_type, entity_id], model: Amocrm::Models::EntityLinkListByEntityResponse, options: ) end |
#unlink(entity_type, body:, request_options: {}) ⇒ Amocrm::Models::EntityLinkUnlinkResponse::EmptyResponse, Amocrm::Models::EntityLinkUnlinkResponse::Problem
Unlink entities (bulk).
117 118 119 120 121 122 123 124 125 126 |
# File 'lib/amocrm/resources/entity_links.rb', line 117 def unlink(entity_type, params) parsed, = Amocrm::EntityLinkUnlinkParams.dump_request(params) @client.request( method: :post, path: ["api/v4/%1$s/unlink", entity_type], body: parsed[:body], model: Amocrm::Models::EntityLinkUnlinkResponse, options: ) end |
#unlink_by_entity(entity_id, entity_type:, body:, request_options: {}) ⇒ Amocrm::Models::EntityLinkUnlinkByEntityResponse::EmptyResponse, Amocrm::Models::EntityLinkUnlinkByEntityResponse::Problem
Unlink entities for a specific entity.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/amocrm/resources/entity_links.rb', line 143 def unlink_by_entity(entity_id, params) parsed, = Amocrm::EntityLinkUnlinkByEntityParams.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/unlink", entity_type, entity_id], body: parsed[:body], model: Amocrm::Models::EntityLinkUnlinkByEntityResponse, options: ) end |