Class: FireflyIIIClient::LinksApi

Inherits:
Object
  • Object
show all
Defined in:
lib/firefly_iii_client/api/links_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LinksApi

Returns a new instance of LinksApi.



19
20
21
# File 'lib/firefly_iii_client/api/links_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/firefly_iii_client/api/links_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

Permanently delete link type. Will permanently delete a link type. The links between transactions will be removed. The transactions themselves remain. You cannot delete some of the system provided link types, indicated by the editable=false flag when you list it.

Parameters:

  • id (Integer)

    The ID of the link type.

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

    the optional parameters

Returns:

  • (nil)


27
28
29
30
# File 'lib/firefly_iii_client/api/links_api.rb', line 27

def delete_link_type(id, opts = {})
  delete_link_type_with_http_info(id, opts)
  nil
end

Permanently delete link type. Will permanently delete a link type. The links between transactions will be removed. The transactions themselves remain. You cannot delete some of the system provided link types, indicated by the editable=false flag when you list it.

Parameters:

  • id (Integer)

    The ID of the link type.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/firefly_iii_client/api/links_api.rb', line 37

def delete_link_type_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LinksApi.delete_link_type ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LinksApi.delete_link_type"
  end
  # resource path
  local_var_path = '/api/v1/link_types/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"LinksApi.delete_link_type",
    :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: LinksApi#delete_link_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Permanently delete link between transactions. Will permanently delete link. Transactions remain.

Parameters:

  • id (Integer)

    The ID of the transaction link.

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

    the optional parameters

Returns:

  • (nil)


88
89
90
91
# File 'lib/firefly_iii_client/api/links_api.rb', line 88

def delete_transaction_link(id, opts = {})
  delete_transaction_link_with_http_info(id, opts)
  nil
end

Permanently delete link between transactions. Will permanently delete link. Transactions remain.

Parameters:

  • id (Integer)

    The ID of the transaction link.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



98
99
100
101
102
103
104
105
106
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
# File 'lib/firefly_iii_client/api/links_api.rb', line 98

def delete_transaction_link_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LinksApi.delete_transaction_link ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LinksApi.delete_transaction_link"
  end
  # resource path
  local_var_path = '/api/v1/transaction_links/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"LinksApi.delete_transaction_link",
    :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: LinksApi#delete_transaction_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Get single a link type. Returns a single link type by its ID.

Parameters:

  • id (Integer)

    The ID of the link type.

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

    the optional parameters

Returns:



149
150
151
152
# File 'lib/firefly_iii_client/api/links_api.rb', line 149

def get_link_type(id, opts = {})
  data, _status_code, _headers = get_link_type_with_http_info(id, opts)
  data
end

Get single a link type. Returns a single link type by its ID.

Parameters:

  • id (Integer)

    The ID of the link type.

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

    the optional parameters

Returns:

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

    LinkTypeSingle data, response status code and response headers



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
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
# File 'lib/firefly_iii_client/api/links_api.rb', line 159

def get_link_type_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LinksApi.get_link_type ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LinksApi.get_link_type"
  end
  # resource path
  local_var_path = '/api/v1/link_types/{id}'.sub('{' + 'id' + '}', CGI.escape(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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"LinksApi.get_link_type",
    :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: LinksApi#get_link_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Get a single link. Returns a single link by its ID.

Parameters:

  • id (Integer)

    The ID of the transaction link.

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

    the optional parameters

Returns:



212
213
214
215
# File 'lib/firefly_iii_client/api/links_api.rb', line 212

def get_transaction_link(id, opts = {})
  data, _status_code, _headers = get_transaction_link_with_http_info(id, opts)
  data
end

Get a single link. Returns a single link by its ID.

Parameters:

  • id (Integer)

    The ID of the transaction link.

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

    the optional parameters

Returns:

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

    TransactionLinkSingle data, response status code and response headers



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
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
# File 'lib/firefly_iii_client/api/links_api.rb', line 222

def get_transaction_link_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LinksApi.get_transaction_link ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LinksApi.get_transaction_link"
  end
  # resource path
  local_var_path = '/api/v1/transaction_links/{id}'.sub('{' + 'id' + '}', CGI.escape(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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"LinksApi.get_transaction_link",
    :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: LinksApi#get_transaction_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

List all types of links. List all the link types the system has. These include the default ones as well as any new ones.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50 items.

Returns:



275
276
277
278
# File 'lib/firefly_iii_client/api/links_api.rb', line 275

def list_link_type(opts = {})
  data, _status_code, _headers = list_link_type_with_http_info(opts)
  data
end

List all types of links. List all the link types the system has. These include the default ones as well as any new ones.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50 items.

Returns:

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

    LinkTypeArray data, response status code and response headers



285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/firefly_iii_client/api/links_api.rb', line 285

def list_link_type_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LinksApi.list_link_type ...'
  end
  # resource path
  local_var_path = '/api/v1/link_types'

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"LinksApi.list_link_type",
    :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: LinksApi#list_link_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

List all transactions under this link type. List all transactions under this link type, both the inward and outward transactions.

Parameters:

  • id (Integer)

    The ID of the link type.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is per 50 items.

  • :start (Date)

    A date formatted YYYY-MM-DD, to limit the results.

  • :_end (Date)

    A date formatted YYYY-MM-DD, to limit the results.

  • :type (TransactionTypeFilter)

    Optional filter on the transaction type(s) returned.

Returns:



339
340
341
342
# File 'lib/firefly_iii_client/api/links_api.rb', line 339

def list_transaction_by_link_type(id, opts = {})
  data, _status_code, _headers = list_transaction_by_link_type_with_http_info(id, opts)
  data
end

List all transactions under this link type. List all transactions under this link type, both the inward and outward transactions.

Parameters:

  • id (Integer)

    The ID of the link type.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is per 50 items.

  • :start (Date)

    A date formatted YYYY-MM-DD, to limit the results.

  • :_end (Date)

    A date formatted YYYY-MM-DD, to limit the results.

  • :type (TransactionTypeFilter)

    Optional filter on the transaction type(s) returned.

Returns:

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

    TransactionArray data, response status code and response headers



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
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
399
400
401
402
403
# File 'lib/firefly_iii_client/api/links_api.rb', line 353

def list_transaction_by_link_type_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LinksApi.list_transaction_by_link_type ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LinksApi.list_transaction_by_link_type"
  end
  # resource path
  local_var_path = '/api/v1/link_types/{id}/transactions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"LinksApi.list_transaction_by_link_type",
    :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: LinksApi#list_transaction_by_link_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

List all transaction links. List all the transaction links.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is per 50 items.

Returns:



410
411
412
413
# File 'lib/firefly_iii_client/api/links_api.rb', line 410

def list_transaction_link(opts = {})
  data, _status_code, _headers = list_transaction_link_with_http_info(opts)
  data
end

List all transaction links. List all the transaction links.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is per 50 items.

Returns:

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

    TransactionLinkArray data, response status code and response headers



420
421
422
423
424
425
426
427
428
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
455
456
457
458
459
460
461
462
463
# File 'lib/firefly_iii_client/api/links_api.rb', line 420

def list_transaction_link_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LinksApi.list_transaction_link ...'
  end
  # resource path
  local_var_path = '/api/v1/transaction_links'

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"LinksApi.list_transaction_link",
    :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: LinksApi#list_transaction_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Create a new link type Creates a new link type. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform).

Parameters:

  • link_type (LinkType)

    JSON array with the necessary link type information or key&#x3D;value pairs. See the model for the exact specifications.

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

    the optional parameters

Returns:



470
471
472
473
# File 'lib/firefly_iii_client/api/links_api.rb', line 470

def store_link_type(link_type, opts = {})
  data, _status_code, _headers = store_link_type_with_http_info(link_type, opts)
  data
end

Create a new link type Creates a new link type. The data required can be submitted as a JSON body or as a list of parameters (in key&#x3D;value pairs, like a webform).

Parameters:

  • link_type (LinkType)

    JSON array with the necessary link type information or key&#x3D;value pairs. See the model for the exact specifications.

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

    the optional parameters

Returns:

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

    LinkTypeSingle data, response status code and response headers



480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
# File 'lib/firefly_iii_client/api/links_api.rb', line 480

def store_link_type_with_http_info(link_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LinksApi.store_link_type ...'
  end
  # verify the required parameter 'link_type' is set
  if @api_client.config.client_side_validation && link_type.nil?
    fail ArgumentError, "Missing the required parameter 'link_type' when calling LinksApi.store_link_type"
  end
  # resource path
  local_var_path = '/api/v1/link_types'

  # 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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"LinksApi.store_link_type",
    :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: LinksApi#store_link_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Create a new link between transactions Store a new link between two transactions. For this end point you need the journal_id from a transaction.

Parameters:

  • transaction_link (TransactionLink)

    JSON array with the necessary link type information or key&#x3D;value pairs. See the model for the exact specifications.

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

    the optional parameters

Returns:



535
536
537
538
# File 'lib/firefly_iii_client/api/links_api.rb', line 535

def store_transaction_link(transaction_link, opts = {})
  data, _status_code, _headers = store_transaction_link_with_http_info(transaction_link, opts)
  data
end

Create a new link between transactions Store a new link between two transactions. For this end point you need the journal_id from a transaction.

Parameters:

  • transaction_link (TransactionLink)

    JSON array with the necessary link type information or key&#x3D;value pairs. See the model for the exact specifications.

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

    the optional parameters

Returns:

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

    TransactionLinkSingle data, response status code and response headers



545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/firefly_iii_client/api/links_api.rb', line 545

def store_transaction_link_with_http_info(transaction_link, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LinksApi.store_transaction_link ...'
  end
  # verify the required parameter 'transaction_link' is set
  if @api_client.config.client_side_validation && transaction_link.nil?
    fail ArgumentError, "Missing the required parameter 'transaction_link' when calling LinksApi.store_transaction_link"
  end
  # resource path
  local_var_path = '/api/v1/transaction_links'

  # 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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"LinksApi.store_transaction_link",
    :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: LinksApi#store_transaction_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Update existing link type. Used to update a single link type. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory. You cannot update some of the system provided link types, indicated by the editable=false flag when you list it.

Parameters:

  • id (Integer)

    The ID of the link type.

  • link_type (LinkType)

    JSON array or formdata with updated link type information. See the model for the exact specifications.

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

    the optional parameters

Returns:



601
602
603
604
# File 'lib/firefly_iii_client/api/links_api.rb', line 601

def update_link_type(id, link_type, opts = {})
  data, _status_code, _headers = update_link_type_with_http_info(id, link_type, opts)
  data
end

Update existing link type. Used to update a single link type. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory. You cannot update some of the system provided link types, indicated by the editable&#x3D;false flag when you list it.

Parameters:

  • id (Integer)

    The ID of the link type.

  • link_type (LinkType)

    JSON array or formdata with updated link type information. See the model for the exact specifications.

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

    the optional parameters

Returns:

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

    LinkTypeSingle data, response status code and response headers



612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
# File 'lib/firefly_iii_client/api/links_api.rb', line 612

def update_link_type_with_http_info(id, link_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LinksApi.update_link_type ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LinksApi.update_link_type"
  end
  # verify the required parameter 'link_type' is set
  if @api_client.config.client_side_validation && link_type.nil?
    fail ArgumentError, "Missing the required parameter 'link_type' when calling LinksApi.update_link_type"
  end
  # resource path
  local_var_path = '/api/v1/link_types/{id}'.sub('{' + 'id' + '}', CGI.escape(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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"LinksApi.update_link_type",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LinksApi#update_link_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Update an existing link between transactions. Used to update a single existing link.

Parameters:

  • id (Integer)

    The ID of the transaction link.

  • transaction_link (TransactionLink)

    JSON array or formdata with updated link type information. See the model for the exact specifications.

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

    the optional parameters

Returns:



672
673
674
675
# File 'lib/firefly_iii_client/api/links_api.rb', line 672

def update_transaction_link(id, transaction_link, opts = {})
  data, _status_code, _headers = update_transaction_link_with_http_info(id, transaction_link, opts)
  data
end

Update an existing link between transactions. Used to update a single existing link.

Parameters:

  • id (Integer)

    The ID of the transaction link.

  • transaction_link (TransactionLink)

    JSON array or formdata with updated link type information. See the model for the exact specifications.

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

    the optional parameters

Returns:

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

    TransactionLinkSingle data, response status code and response headers



683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
# File 'lib/firefly_iii_client/api/links_api.rb', line 683

def update_transaction_link_with_http_info(id, transaction_link, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LinksApi.update_transaction_link ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LinksApi.update_transaction_link"
  end
  # verify the required parameter 'transaction_link' is set
  if @api_client.config.client_side_validation && transaction_link.nil?
    fail ArgumentError, "Missing the required parameter 'transaction_link' when calling LinksApi.update_transaction_link"
  end
  # resource path
  local_var_path = '/api/v1/transaction_links/{id}'.sub('{' + 'id' + '}', CGI.escape(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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"LinksApi.update_transaction_link",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LinksApi#update_transaction_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end