Class: FireflyIIIClient::AttachmentsApi
- Inherits:
-
Object
- Object
- FireflyIIIClient::AttachmentsApi
- Defined in:
- lib/firefly_iii_client/api/attachments_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_attachment(id, opts = {}) ⇒ nil
Delete an attachment.
-
#delete_attachment_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete an attachment.
-
#download_attachment(id, opts = {}) ⇒ File
Download a single attachment.
-
#download_attachment_with_http_info(id, opts = {}) ⇒ Array<(File, Integer, Hash)>
Download a single attachment.
-
#get_attachment(id, opts = {}) ⇒ AttachmentSingle
Get a single attachment.
-
#get_attachment_with_http_info(id, opts = {}) ⇒ Array<(AttachmentSingle, Integer, Hash)>
Get a single attachment.
-
#initialize(api_client = ApiClient.default) ⇒ AttachmentsApi
constructor
A new instance of AttachmentsApi.
-
#list_attachment(opts = {}) ⇒ AttachmentArray
List all attachments.
-
#list_attachment_with_http_info(opts = {}) ⇒ Array<(AttachmentArray, Integer, Hash)>
List all attachments.
-
#store_attachment(attachment, opts = {}) ⇒ AttachmentSingle
Store a new attachment.
-
#store_attachment_with_http_info(attachment, opts = {}) ⇒ Array<(AttachmentSingle, Integer, Hash)>
Store a new attachment.
-
#update_attachment(id, attachment, opts = {}) ⇒ AttachmentSingle
Update existing attachment.
-
#update_attachment_with_http_info(id, attachment, opts = {}) ⇒ Array<(AttachmentSingle, Integer, Hash)>
Update existing attachment.
-
#upload_attachment(id, opts = {}) ⇒ nil
Upload an attachment.
-
#upload_attachment_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Upload an attachment.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AttachmentsApi
Returns a new instance of AttachmentsApi.
19 20 21 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#delete_attachment(id, opts = {}) ⇒ nil
Delete an attachment. With this endpoint you delete an attachment, including any stored file data.
27 28 29 30 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 27 def (id, opts = {}) (id, opts) nil end |
#delete_attachment_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete an attachment. With this endpoint you delete an attachment, including any stored file data.
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/attachments_api.rb', line 37 def (id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentsApi.delete_attachment ...' 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 AttachmentsApi.delete_attachment" end # resource path local_var_path = '/api/v1/attachments/{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'] = opts.merge( :operation => :"AttachmentsApi.delete_attachment", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentsApi#delete_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#download_attachment(id, opts = {}) ⇒ File
Download a single attachment. This endpoint allows you to download the binary content of a transaction. It will be sent to you as a download, using the content type "application/octet-stream" and content disposition "attachment; filename=example.pdf".
88 89 90 91 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 88 def (id, opts = {}) data, _status_code, _headers = (id, opts) data end |
#download_attachment_with_http_info(id, opts = {}) ⇒ Array<(File, Integer, Hash)>
Download a single attachment. This endpoint allows you to download the binary content of a transaction. It will be sent to you as a download, using the content type "application/octet-stream" and content disposition "attachment; filename=example.pdf".
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 143 144 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 98 def (id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentsApi.download_attachment ...' 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 AttachmentsApi.download_attachment" end # resource path local_var_path = '/api/v1/attachments/{id}/download'.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/octet-stream']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'File' # auth_names auth_names = opts[:debug_auth_names] || ['firefly_iii_auth'] = opts.merge( :operation => :"AttachmentsApi.download_attachment", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentsApi#download_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_attachment(id, opts = {}) ⇒ AttachmentSingle
Get a single attachment. Get a single attachment. This endpoint only returns the available metadata for the attachment. Actual file data is handled in two other endpoints (see below).
151 152 153 154 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 151 def (id, opts = {}) data, _status_code, _headers = (id, opts) data end |
#get_attachment_with_http_info(id, opts = {}) ⇒ Array<(AttachmentSingle, Integer, Hash)>
Get a single attachment. Get a single attachment. This endpoint only returns the available metadata for the attachment. Actual file data is handled in two other endpoints (see below).
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 206 207 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 161 def (id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentsApi.get_attachment ...' 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 AttachmentsApi.get_attachment" end # resource path local_var_path = '/api/v1/attachments/{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] || 'AttachmentSingle' # auth_names auth_names = opts[:debug_auth_names] || ['firefly_iii_auth'] = opts.merge( :operation => :"AttachmentsApi.get_attachment", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentsApi#get_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_attachment(opts = {}) ⇒ AttachmentArray
List all attachments. This endpoint lists all attachments.
214 215 216 217 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 214 def (opts = {}) data, _status_code, _headers = (opts) data end |
#list_attachment_with_http_info(opts = {}) ⇒ Array<(AttachmentArray, Integer, Hash)>
List all attachments. This endpoint lists all attachments.
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 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 224 def (opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentsApi.list_attachment ...' end # resource path local_var_path = '/api/v1/attachments' # 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] || 'AttachmentArray' # auth_names auth_names = opts[:debug_auth_names] || ['firefly_iii_auth'] = opts.merge( :operation => :"AttachmentsApi.list_attachment", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentsApi#list_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#store_attachment(attachment, opts = {}) ⇒ AttachmentSingle
Store a new attachment. Creates a new attachment. The data required can be submitted as a JSON body or as a list of parameters. You cannot use this endpoint to upload the actual file data (see below). This endpoint only creates the attachment object.
274 275 276 277 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 274 def (, opts = {}) data, _status_code, _headers = (, opts) data end |
#store_attachment_with_http_info(attachment, opts = {}) ⇒ Array<(AttachmentSingle, Integer, Hash)>
Store a new attachment. Creates a new attachment. The data required can be submitted as a JSON body or as a list of parameters. You cannot use this endpoint to upload the actual file data (see below). This endpoint only creates the attachment object.
284 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 329 330 331 332 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 284 def (, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentsApi.store_attachment ...' end # verify the required parameter 'attachment' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'attachment' when calling AttachmentsApi.store_attachment" end # resource path local_var_path = '/api/v1/attachments' # 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() # return_type return_type = opts[:debug_return_type] || 'AttachmentSingle' # auth_names auth_names = opts[:debug_auth_names] || ['firefly_iii_auth'] = opts.merge( :operation => :"AttachmentsApi.store_attachment", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentsApi#store_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_attachment(id, attachment, opts = {}) ⇒ AttachmentSingle
Update existing attachment. Update the meta data for an existing attachment. This endpoint does not allow you to upload or download data. For that, see below.
340 341 342 343 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 340 def (id, , opts = {}) data, _status_code, _headers = (id, , opts) data end |
#update_attachment_with_http_info(id, attachment, opts = {}) ⇒ Array<(AttachmentSingle, Integer, Hash)>
Update existing attachment. Update the meta data for an existing attachment. This endpoint does not allow you to upload or download data. For that, see below.
351 352 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/attachments_api.rb', line 351 def (id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentsApi.update_attachment ...' 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 AttachmentsApi.update_attachment" end # verify the required parameter 'attachment' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'attachment' when calling AttachmentsApi.update_attachment" end # resource path local_var_path = '/api/v1/attachments/{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() # return_type return_type = opts[:debug_return_type] || 'AttachmentSingle' # auth_names auth_names = opts[:debug_auth_names] || ['firefly_iii_auth'] = opts.merge( :operation => :"AttachmentsApi.update_attachment", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentsApi#update_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#upload_attachment(id, opts = {}) ⇒ nil
Upload an attachment. Use this endpoint to upload (and possible overwrite) the file contents of an attachment. Simply put the entire file in the body as binary data.
411 412 413 414 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 411 def (id, opts = {}) (id, opts) nil end |
#upload_attachment_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Upload an attachment. Use this endpoint to upload (and possible overwrite) the file contents of an attachment. Simply put the entire file in the body as binary data.
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 464 465 466 467 468 |
# File 'lib/firefly_iii_client/api/attachments_api.rb', line 422 def (id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentsApi.upload_attachment ...' 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 AttachmentsApi.upload_attachment" end # resource path local_var_path = '/api/v1/attachments/{id}/upload'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body']) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['firefly_iii_auth'] = opts.merge( :operation => :"AttachmentsApi.upload_attachment", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentsApi#upload_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |