Class: Merge::Crm::TasksClient
- Inherits:
-
Object
- Object
- Merge::Crm::TasksClient
- Defined in:
- lib/merge_ruby_client/crm/tasks/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Crm::TaskResponse
Creates a ‘Task` object with the given values.
- #initialize(request_client:) ⇒ Merge::Crm::TasksClient constructor
-
#list(created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, modified_after: nil, modified_before: nil, page_size: nil, remote_id: nil, request_options: nil) ⇒ Merge::Crm::PaginatedTaskList
Returns a list of ‘Task` objects.
-
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘Task` PATCHs.
-
#meta_post_retrieve(request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘Task` POSTs.
-
#partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Crm::TaskResponse
Updates a ‘Task` object with the given `id`.
-
#remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, is_common_model_field: nil, page_size: nil, request_options: nil) ⇒ Merge::Crm::PaginatedRemoteFieldClassList
Returns a list of ‘RemoteFieldClass` objects.
-
#retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, request_options: nil) ⇒ Merge::Crm::Task
Returns a ‘Task` object with the given `id`.
Constructor Details
#initialize(request_client:) ⇒ Merge::Crm::TasksClient
24 25 26 |
# File 'lib/merge_ruby_client/crm/tasks/client.rb', line 24 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::RequestClient (readonly)
20 21 22 |
# File 'lib/merge_ruby_client/crm/tasks/client.rb', line 20 def request_client @request_client end |
Instance Method Details
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Crm::TaskResponse
Creates a ‘Task` object with the given values.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/merge_ruby_client/crm/tasks/client.rb', line 112 def create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "is_debug_mode": is_debug_mode, "run_async": run_async }.compact req.body = { **(&.additional_body_parameters || {}), model: model }.compact req.url "#{@request_client.get_url(request_options: )}/crm/v1/tasks" end Merge::Crm::TaskResponse.from_json(json_object: response.body) end |
#list(created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, modified_after: nil, modified_before: nil, page_size: nil, remote_id: nil, request_options: nil) ⇒ Merge::Crm::PaginatedTaskList
Returns a list of ‘Task` objects.
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 |
# File 'lib/merge_ruby_client/crm/tasks/client.rb', line 54 def list(created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, modified_after: nil, modified_before: nil, page_size: nil, remote_id: nil, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "created_after": created_after, "created_before": created_before, "cursor": cursor, "expand": , "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "include_remote_fields": include_remote_fields, "modified_after": modified_after, "modified_before": modified_before, "page_size": page_size, "remote_id": remote_id }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/tasks" end Merge::Crm::PaginatedTaskList.from_json(json_object: response.body) end |
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘Task` PATCHs.
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/merge_ruby_client/crm/tasks/client.rb', line 234 def (id:, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/tasks/meta/patch/#{id}" end Merge::Crm::MetaResponse.from_json(json_object: response.body) end |
#meta_post_retrieve(request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘Task` POSTs.
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/merge_ruby_client/crm/tasks/client.rb', line 266 def (request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/tasks/meta/post" end Merge::Crm::MetaResponse.from_json(json_object: response.body) end |
#partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Crm::TaskResponse
Updates a ‘Task` object with the given `id`.
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/merge_ruby_client/crm/tasks/client.rb', line 201 def partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) response = @request_client.conn.patch do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "is_debug_mode": is_debug_mode, "run_async": run_async }.compact req.body = { **(&.additional_body_parameters || {}), model: model }.compact req.url "#{@request_client.get_url(request_options: )}/crm/v1/tasks/#{id}" end Merge::Crm::TaskResponse.from_json(json_object: response.body) end |
#remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, is_common_model_field: nil, page_size: nil, request_options: nil) ⇒ Merge::Crm::PaginatedRemoteFieldClassList
Returns a list of ‘RemoteFieldClass` objects.
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
# File 'lib/merge_ruby_client/crm/tasks/client.rb', line 307 def remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, is_common_model_field: nil, page_size: nil, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "cursor": cursor, "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "include_remote_fields": include_remote_fields, "is_common_model_field": is_common_model_field, "page_size": page_size }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/tasks/remote-field-classes" end Merge::Crm::PaginatedRemoteFieldClassList.from_json(json_object: response.body) end |
#retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, request_options: nil) ⇒ Merge::Crm::Task
Returns a ‘Task` object with the given `id`.
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/merge_ruby_client/crm/tasks/client.rb', line 151 def retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "expand": , "include_remote_data": include_remote_data, "include_remote_fields": include_remote_fields }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/tasks/#{id}" end Merge::Crm::Task.from_json(json_object: response.body) end |