Class: Merge::Crm::AsyncUsersClient
- Inherits:
-
Object
- Object
- Merge::Crm::AsyncUsersClient
- Defined in:
- lib/merge_ruby_client/crm/users/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#ignore_create(model_id:, request:, request_options: nil) ⇒ Void
Ignores a specific row based on the ‘model_id` in the url.
- #initialize(request_client:) ⇒ Merge::Crm::AsyncUsersClient constructor
-
#list(created_after: nil, created_before: nil, cursor: 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::PaginatedUserList
Returns a list of ‘User` objects.
-
#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:, include_remote_data: nil, include_remote_fields: nil, request_options: nil) ⇒ Merge::Crm::User
Returns a ‘User` object with the given `id`.
Constructor Details
#initialize(request_client:) ⇒ Merge::Crm::AsyncUsersClient
209 210 211 |
# File 'lib/merge_ruby_client/crm/users/client.rb', line 209 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::AsyncRequestClient (readonly)
205 206 207 |
# File 'lib/merge_ruby_client/crm/users/client.rb', line 205 def request_client @request_client end |
Instance Method Details
#ignore_create(model_id:, request:, request_options: nil) ⇒ Void
Ignores a specific row based on the ‘model_id` in the url. These records will
have their properties set to null, and will not be updated in future syncs. The
"reason" and "message" fields in the request body will be stored for audit
purposes.
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/merge_ruby_client/crm/users/client.rb', line 330 def ignore_create(model_id:, request:, request_options: nil) Async do @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 unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(request || {}), **(&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: )}/crm/v1/users/ignore/#{model_id}" end end end |
#list(created_after: nil, created_before: nil, cursor: 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::PaginatedUserList
Returns a list of ‘User` objects.
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/merge_ruby_client/crm/users/client.rb', line 237 def list(created_after: nil, created_before: nil, cursor: 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) Async do 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, "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/users" end Merge::Crm::PaginatedUserList.from_json(json_object: response.body) end 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.
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/merge_ruby_client/crm/users/client.rb', line 370 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) Async do 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/users/remote-field-classes" end Merge::Crm::PaginatedRemoteFieldClassList.from_json(json_object: response.body) end end |
#retrieve(id:, include_remote_data: nil, include_remote_fields: nil, request_options: nil) ⇒ Merge::Crm::User
Returns a ‘User` object with the given `id`.
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 |
# File 'lib/merge_ruby_client/crm/users/client.rb', line 287 def retrieve(id:, include_remote_data: nil, include_remote_fields: nil, request_options: nil) Async do 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 || {}), "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/users/#{id}" end Merge::Crm::User.from_json(json_object: response.body) end end |