Class: Merge::Crm::AsyncFieldMappingClient
- Inherits:
-
Object
- Object
- Merge::Crm::AsyncFieldMappingClient
- Defined in:
- lib/merge_ruby_client/crm/field_mapping/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#field_mappings_create(target_field_name:, target_field_description:, remote_field_traversal_path:, remote_method:, remote_url_path:, common_model_name:, request_options: nil) ⇒ Merge::Crm::FieldMappingInstanceResponse
Create new Field Mappings that will be available after the next scheduled sync.
-
#field_mappings_destroy(field_mapping_id:, request_options: nil) ⇒ Merge::Crm::FieldMappingInstanceResponse
Deletes Field Mappings for a Linked Account.
-
#field_mappings_partial_update(field_mapping_id:, remote_field_traversal_path: nil, remote_method: nil, remote_url_path: nil, request_options: nil) ⇒ Merge::Crm::FieldMappingInstanceResponse
Create or update existing Field Mappings for a Linked Account.
-
#field_mappings_retrieve(request_options: nil) ⇒ Merge::Crm::FieldMappingApiInstanceResponse
Get all Field Mappings for this Linked Account.
- #initialize(request_client:) ⇒ Merge::Crm::AsyncFieldMappingClient constructor
-
#remote_fields_retrieve(common_models: nil, include_example_values: nil, request_options: nil) ⇒ Merge::Crm::RemoteFieldApiResponse
Get all remote fields for a Linked Account.
-
#target_fields_retrieve(request_options: nil) ⇒ Merge::Crm::ExternalTargetFieldApiResponse
Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields.
Constructor Details
#initialize(request_client:) ⇒ Merge::Crm::AsyncFieldMappingClient
275 276 277 |
# File 'lib/merge_ruby_client/crm/field_mapping/client.rb', line 275 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::AsyncRequestClient (readonly)
271 272 273 |
# File 'lib/merge_ruby_client/crm/field_mapping/client.rb', line 271 def request_client @request_client end |
Instance Method Details
#field_mappings_create(target_field_name:, target_field_description:, remote_field_traversal_path:, remote_method:, remote_url_path:, common_model_name:, request_options: nil) ⇒ Merge::Crm::FieldMappingInstanceResponse
Create new Field Mappings that will be available after the next scheduled sync.
This will cause the next sync for this Linked Account to sync **ALL** data from
start.
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
# File 'lib/merge_ruby_client/crm/field_mapping/client.rb', line 343 def field_mappings_create(target_field_name:, target_field_description:, remote_field_traversal_path:, remote_method:, remote_url_path:, common_model_name:, request_options: nil) Async do 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 unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), target_field_name: target_field_name, target_field_description: target_field_description, remote_field_traversal_path: remote_field_traversal_path, remote_method: remote_method, remote_url_path: remote_url_path, common_model_name: common_model_name }.compact req.url "#{@request_client.get_url(request_options: )}/crm/v1/field-mappings" end Merge::Crm::FieldMappingInstanceResponse.from_json(json_object: response.body) end end |
#field_mappings_destroy(field_mapping_id:, request_options: nil) ⇒ Merge::Crm::FieldMappingInstanceResponse
Deletes Field Mappings for a Linked Account. All data related to this Field
Mapping will be deleted and these changes will be reflected after the next
scheduled sync. This will cause the next sync for this Linked Account to sync
**ALL** data from start.
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/merge_ruby_client/crm/field_mapping/client.rb', line 388 def field_mappings_destroy(field_mapping_id:, request_options: nil) Async do response = @request_client.conn.delete 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/field-mappings/#{field_mapping_id}" end Merge::Crm::FieldMappingInstanceResponse.from_json(json_object: response.body) end end |
#field_mappings_partial_update(field_mapping_id:, remote_field_traversal_path: nil, remote_method: nil, remote_url_path: nil, request_options: nil) ⇒ Merge::Crm::FieldMappingInstanceResponse
Create or update existing Field Mappings for a Linked Account. Changes will be
reflected after the next scheduled sync. This will cause the next sync for this
Linked Account to sync **ALL** data from start.
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
# File 'lib/merge_ruby_client/crm/field_mapping/client.rb', line 429 def field_mappings_partial_update(field_mapping_id:, remote_field_traversal_path: nil, remote_method: nil, remote_url_path: nil, request_options: nil) Async do 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 unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), remote_field_traversal_path: remote_field_traversal_path, remote_method: remote_method, remote_url_path: remote_url_path }.compact req.url "#{@request_client.get_url(request_options: )}/crm/v1/field-mappings/#{field_mapping_id}" end Merge::Crm::FieldMappingInstanceResponse.from_json(json_object: response.body) end end |
#field_mappings_retrieve(request_options: nil) ⇒ Merge::Crm::FieldMappingApiInstanceResponse
Get all Field Mappings for this Linked Account. Field Mappings are mappings
between third-party Remote Fields and user defined Merge fields. [Learn
more](https://docs.merge.dev/supplemental-data/field-mappings/overview/).
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/merge_ruby_client/crm/field_mapping/client.rb', line 292 def field_mappings_retrieve(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 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/field-mappings" end Merge::Crm::FieldMappingApiInstanceResponse.from_json(json_object: response.body) end end |
#remote_fields_retrieve(common_models: nil, include_example_values: nil, request_options: nil) ⇒ Merge::Crm::RemoteFieldApiResponse
Get all remote fields for a Linked Account. Remote fields are third-party fields
that are accessible after initial sync if remote_data is enabled. You can use
remote fields to override existing Merge fields or map a new Merge field. [Learn
more](https://docs.merge.dev/supplemental-data/field-mappings/overview/).
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 |
# File 'lib/merge_ruby_client/crm/field_mapping/client.rb', line 474 def remote_fields_retrieve(common_models: nil, include_example_values: 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 || {}), "common_models": common_models, "include_example_values": include_example_values }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/remote-fields" end Merge::Crm::RemoteFieldApiResponse.from_json(json_object: response.body) end end |
#target_fields_retrieve(request_options: nil) ⇒ Merge::Crm::ExternalTargetFieldApiResponse
Get all organization-wide Target Fields, this will not include any Linked
Account specific Target Fields. Organization-wide Target Fields are additional
fields appended to the Merge Common Model for all Linked Accounts in a category.
[Learn
more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/).
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 |
# File 'lib/merge_ruby_client/crm/field_mapping/client.rb', line 514 def target_fields_retrieve(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 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/target-fields" end Merge::Crm::ExternalTargetFieldApiResponse.from_json(json_object: response.body) end end |