Class: Merge::Ats::FieldMappingClient
- Inherits:
-
Object
- Object
- Merge::Ats::FieldMappingClient
- Defined in:
- lib/merge_ruby_client/ats/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:, exclude_remote_field_metadata: nil, request_options: nil) ⇒ Merge::Ats::FieldMappingInstanceResponse
Create new Field Mappings that will be available after the next scheduled sync.
-
#field_mappings_destroy(field_mapping_id:, request_options: nil) ⇒ Merge::Ats::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::Ats::FieldMappingInstanceResponse
Create or update existing Field Mappings for a Linked Account.
-
#field_mappings_retrieve(exclude_remote_field_metadata: nil, request_options: nil) ⇒ Merge::Ats::FieldMappingApiInstanceResponse
Get all Field Mappings for this Linked Account.
- #initialize(request_client:) ⇒ Merge::Ats::FieldMappingClient constructor
-
#remote_fields_retrieve(common_models: nil, include_example_values: nil, request_options: nil) ⇒ Merge::Ats::RemoteFieldApiResponse
Get all remote fields for a Linked Account.
-
#target_fields_retrieve(request_options: nil) ⇒ Merge::Ats::ExternalTargetFieldApiResponse
Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields.
Constructor Details
#initialize(request_client:) ⇒ Merge::Ats::FieldMappingClient
18 19 20 |
# File 'lib/merge_ruby_client/ats/field_mapping/client.rb', line 18 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::RequestClient (readonly)
14 15 16 |
# File 'lib/merge_ruby_client/ats/field_mapping/client.rb', line 14 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:, exclude_remote_field_metadata: nil, request_options: nil) ⇒ Merge::Ats::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.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/merge_ruby_client/ats/field_mapping/client.rb', line 93 def field_mappings_create(target_field_name:, target_field_description:, remote_field_traversal_path:, remote_method:, remote_url_path:, common_model_name:, exclude_remote_field_metadata: 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 || {}), "exclude_remote_field_metadata": }.compact 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: )}/ats/v1/field-mappings" end Merge::Ats::FieldMappingInstanceResponse.from_json(json_object: response.body) end |
#field_mappings_destroy(field_mapping_id:, request_options: nil) ⇒ Merge::Ats::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.
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/merge_ruby_client/ats/field_mapping/client.rb', line 137 def field_mappings_destroy(field_mapping_id:, request_options: nil) 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: )}/ats/v1/field-mappings/#{field_mapping_id}" end Merge::Ats::FieldMappingInstanceResponse.from_json(json_object: response.body) end |
#field_mappings_partial_update(field_mapping_id:, remote_field_traversal_path: nil, remote_method: nil, remote_url_path: nil, request_options: nil) ⇒ Merge::Ats::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.
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/merge_ruby_client/ats/field_mapping/client.rb', line 176 def field_mappings_partial_update(field_mapping_id:, remote_field_traversal_path: nil, remote_method: nil, remote_url_path: 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 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: )}/ats/v1/field-mappings/#{field_mapping_id}" end Merge::Ats::FieldMappingInstanceResponse.from_json(json_object: response.body) end |
#field_mappings_retrieve(exclude_remote_field_metadata: nil, request_options: nil) ⇒ Merge::Ats::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/).
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/merge_ruby_client/ats/field_mapping/client.rb', line 39 def field_mappings_retrieve(exclude_remote_field_metadata: 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 || {}), "exclude_remote_field_metadata": }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ats/v1/field-mappings" end Merge::Ats::FieldMappingApiInstanceResponse.from_json(json_object: response.body) end |
#remote_fields_retrieve(common_models: nil, include_example_values: nil, request_options: nil) ⇒ Merge::Ats::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/).
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/merge_ruby_client/ats/field_mapping/client.rb', line 219 def remote_fields_retrieve(common_models: nil, include_example_values: 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 || {}), "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: )}/ats/v1/remote-fields" end Merge::Ats::RemoteFieldApiResponse.from_json(json_object: response.body) end |
#target_fields_retrieve(request_options: nil) ⇒ Merge::Ats::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/).
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/merge_ruby_client/ats/field_mapping/client.rb', line 257 def target_fields_retrieve(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: )}/ats/v1/target-fields" end Merge::Ats::ExternalTargetFieldApiResponse.from_json(json_object: response.body) end |