Class: MergeHRISClient::FieldMappingApi

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_hris_client/api/field_mapping_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ FieldMappingApi

Returns a new instance of FieldMappingApi.



19
20
21
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#field_mappings_create(x_account_token, create_field_mapping_request, opts = {}) ⇒ 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.

Parameters:

  • x_account_token (String)

    Token identifying the end user.

  • create_field_mapping_request (CreateFieldMappingRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 27

def field_mappings_create(, create_field_mapping_request, opts = {})
  data, _status_code, _headers = field_mappings_create_with_http_info(, create_field_mapping_request, opts)
  data
end

#field_mappings_create_with_http_info(x_account_token, create_field_mapping_request, opts = {}) ⇒ Array<(FieldMappingInstanceResponse, Integer, Hash)>

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.

Parameters:

  • x_account_token (String)

    Token identifying the end user.

  • create_field_mapping_request (CreateFieldMappingRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
86
87
88
89
90
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 37

def field_mappings_create_with_http_info(, create_field_mapping_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FieldMappingApi.field_mappings_create ...'
  end
  # verify the required parameter 'x_account_token' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_token' when calling FieldMappingApi.field_mappings_create"
  end
  # verify the required parameter 'create_field_mapping_request' is set
  if @api_client.config.client_side_validation && create_field_mapping_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_field_mapping_request' when calling FieldMappingApi.field_mappings_create"
  end
  # resource path
  local_var_path = '/field-mappings'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
  header_params[:'X-Account-Token'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_field_mapping_request)

  # return_type
  return_type = opts[:debug_return_type] || 'FieldMappingInstanceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['tokenAuth']

  new_options = opts.merge(
    :operation => :"FieldMappingApi.field_mappings_create",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FieldMappingApi#field_mappings_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#field_mappings_destroy(x_account_token, field_mapping_id, opts = {}) ⇒ 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.

Parameters:

  • x_account_token (String)

    Token identifying the end user.

  • field_mapping_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



97
98
99
100
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 97

def field_mappings_destroy(, field_mapping_id, opts = {})
  data, _status_code, _headers = field_mappings_destroy_with_http_info(, field_mapping_id, opts)
  data
end

#field_mappings_destroy_with_http_info(x_account_token, field_mapping_id, opts = {}) ⇒ Array<(FieldMappingInstanceResponse, Integer, Hash)>

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.

Parameters:

  • x_account_token (String)

    Token identifying the end user.

  • field_mapping_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 107

def field_mappings_destroy_with_http_info(, field_mapping_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FieldMappingApi.field_mappings_destroy ...'
  end
  # verify the required parameter 'x_account_token' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_token' when calling FieldMappingApi.field_mappings_destroy"
  end
  # verify the required parameter 'field_mapping_id' is set
  if @api_client.config.client_side_validation && field_mapping_id.nil?
    fail ArgumentError, "Missing the required parameter 'field_mapping_id' when calling FieldMappingApi.field_mappings_destroy"
  end
  # resource path
  local_var_path = '/field-mappings/{field_mapping_id}'.sub('{' + 'field_mapping_id' + '}', CGI.escape(field_mapping_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Account-Token'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'FieldMappingInstanceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['tokenAuth']

  new_options = opts.merge(
    :operation => :"FieldMappingApi.field_mappings_destroy",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FieldMappingApi#field_mappings_destroy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#field_mappings_partial_update(x_account_token, field_mapping_id, opts = {}) ⇒ 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.

Parameters:

  • x_account_token (String)

    Token identifying the end user.

  • field_mapping_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



166
167
168
169
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 166

def field_mappings_partial_update(, field_mapping_id, opts = {})
  data, _status_code, _headers = field_mappings_partial_update_with_http_info(, field_mapping_id, opts)
  data
end

#field_mappings_partial_update_with_http_info(x_account_token, field_mapping_id, opts = {}) ⇒ Array<(FieldMappingInstanceResponse, Integer, Hash)>

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.

Parameters:

  • x_account_token (String)

    Token identifying the end user.

  • field_mapping_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 177

def field_mappings_partial_update_with_http_info(, field_mapping_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FieldMappingApi.field_mappings_partial_update ...'
  end
  # verify the required parameter 'x_account_token' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_token' when calling FieldMappingApi.field_mappings_partial_update"
  end
  # verify the required parameter 'field_mapping_id' is set
  if @api_client.config.client_side_validation && field_mapping_id.nil?
    fail ArgumentError, "Missing the required parameter 'field_mapping_id' when calling FieldMappingApi.field_mappings_partial_update"
  end
  # resource path
  local_var_path = '/field-mappings/{field_mapping_id}'.sub('{' + 'field_mapping_id' + '}', CGI.escape(field_mapping_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
  header_params[:'X-Account-Token'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'patched_edit_field_mapping_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'FieldMappingInstanceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['tokenAuth']

  new_options = opts.merge(
    :operation => :"FieldMappingApi.field_mappings_partial_update",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FieldMappingApi#field_mappings_partial_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#field_mappings_retrieve(x_account_token, opts = {}) ⇒ 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](docs.merge.dev/supplemental-data/field-mappings/overview/).

Parameters:

  • x_account_token (String)

    Token identifying the end user.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



236
237
238
239
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 236

def field_mappings_retrieve(, opts = {})
  data, _status_code, _headers = field_mappings_retrieve_with_http_info(, opts)
  data
end

#field_mappings_retrieve_with_http_info(x_account_token, opts = {}) ⇒ Array<(FieldMappingApiInstanceResponse, Integer, Hash)>

Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](docs.merge.dev/supplemental-data/field-mappings/overview/).

Parameters:

  • x_account_token (String)

    Token identifying the end user.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 245

def field_mappings_retrieve_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FieldMappingApi.field_mappings_retrieve ...'
  end
  # verify the required parameter 'x_account_token' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_token' when calling FieldMappingApi.field_mappings_retrieve"
  end
  # resource path
  local_var_path = '/field-mappings'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Account-Token'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'FieldMappingApiInstanceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['tokenAuth']

  new_options = opts.merge(
    :operation => :"FieldMappingApi.field_mappings_retrieve",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FieldMappingApi#field_mappings_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remote_fields_retrieve(x_account_token, opts = {}) ⇒ 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](docs.merge.dev/supplemental-data/field-mappings/overview/).

Parameters:

  • x_account_token (String)

    Token identifying the end user.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :common_models (String)

    A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models.

  • :include_example_values (String)

    If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers.

Returns:



300
301
302
303
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 300

def remote_fields_retrieve(, opts = {})
  data, _status_code, _headers = remote_fields_retrieve_with_http_info(, opts)
  data
end

#remote_fields_retrieve_with_http_info(x_account_token, opts = {}) ⇒ Array<(RemoteFieldAPIResponse, Integer, Hash)>

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](docs.merge.dev/supplemental-data/field-mappings/overview/).

Parameters:

  • x_account_token (String)

    Token identifying the end user.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :common_models (String)

    A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models.

  • :include_example_values (String)

    If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers.

Returns:

  • (Array<(RemoteFieldAPIResponse, Integer, Hash)>)

    RemoteFieldAPIResponse data, response status code and response headers



311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 311

def remote_fields_retrieve_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FieldMappingApi.remote_fields_retrieve ...'
  end
  # verify the required parameter 'x_account_token' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_token' when calling FieldMappingApi.remote_fields_retrieve"
  end
  # resource path
  local_var_path = '/remote-fields'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'common_models'] = opts[:'common_models'] if !opts[:'common_models'].nil?
  query_params[:'include_example_values'] = opts[:'include_example_values'] if !opts[:'include_example_values'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Account-Token'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RemoteFieldAPIResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['tokenAuth']

  new_options = opts.merge(
    :operation => :"FieldMappingApi.remote_fields_retrieve",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FieldMappingApi#remote_fields_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#target_fields_retrieve(x_account_token, opts = {}) ⇒ 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](docs.merge.dev/supplemental-data/field-mappings/target-fields/).

Parameters:

  • x_account_token (String)

    Token identifying the end user.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



366
367
368
369
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 366

def target_fields_retrieve(, opts = {})
  data, _status_code, _headers = target_fields_retrieve_with_http_info(, opts)
  data
end

#target_fields_retrieve_with_http_info(x_account_token, opts = {}) ⇒ Array<(ExternalTargetFieldAPIResponse, Integer, Hash)>

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](docs.merge.dev/supplemental-data/field-mappings/target-fields/).

Parameters:

  • x_account_token (String)

    Token identifying the end user.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/merge_hris_client/api/field_mapping_api.rb', line 375

def target_fields_retrieve_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FieldMappingApi.target_fields_retrieve ...'
  end
  # verify the required parameter 'x_account_token' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_token' when calling FieldMappingApi.target_fields_retrieve"
  end
  # resource path
  local_var_path = '/target-fields'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Account-Token'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ExternalTargetFieldAPIResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['tokenAuth']

  new_options = opts.merge(
    :operation => :"FieldMappingApi.target_fields_retrieve",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FieldMappingApi#target_fields_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end