groupdocs_annotation_cloud 23.4 → 25.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +5 -5
  2. data/lib/groupdocs_annotation_cloud/api/annotate_api.rb +5 -5
  3. data/lib/groupdocs_annotation_cloud/api/file_api.rb +6 -6
  4. data/lib/groupdocs_annotation_cloud/api/folder_api.rb +6 -6
  5. data/lib/groupdocs_annotation_cloud/api/info_api.rb +2 -2
  6. data/lib/groupdocs_annotation_cloud/api/license_api.rb +1 -1
  7. data/lib/groupdocs_annotation_cloud/api/preview_api.rb +3 -3
  8. data/lib/groupdocs_annotation_cloud/api/storage_api.rb +5 -5
  9. data/lib/groupdocs_annotation_cloud/api_client.rb +4 -5
  10. data/lib/groupdocs_annotation_cloud/{api_error.rb → api_client_error.rb} +6 -6
  11. data/lib/groupdocs_annotation_cloud/configuration.rb +1 -1
  12. data/lib/groupdocs_annotation_cloud/models/annotate_options.rb +1 -1
  13. data/lib/groupdocs_annotation_cloud/models/annotation_api_link.rb +1 -1
  14. data/lib/groupdocs_annotation_cloud/models/annotation_info.rb +1 -1
  15. data/lib/groupdocs_annotation_cloud/models/annotation_reply_info.rb +1 -1
  16. data/lib/groupdocs_annotation_cloud/models/api_error.rb +244 -0
  17. data/lib/groupdocs_annotation_cloud/models/api_error_response.rb +220 -0
  18. data/lib/groupdocs_annotation_cloud/models/consumption_result.rb +20 -5
  19. data/lib/groupdocs_annotation_cloud/models/disc_usage.rb +1 -1
  20. data/lib/groupdocs_annotation_cloud/models/document_info.rb +1 -1
  21. data/lib/groupdocs_annotation_cloud/models/error.rb +1 -1
  22. data/lib/groupdocs_annotation_cloud/models/error_details.rb +1 -1
  23. data/lib/groupdocs_annotation_cloud/models/file_info.rb +1 -1
  24. data/lib/groupdocs_annotation_cloud/models/file_version.rb +1 -1
  25. data/lib/groupdocs_annotation_cloud/models/file_versions.rb +1 -1
  26. data/lib/groupdocs_annotation_cloud/models/files_list.rb +1 -1
  27. data/lib/groupdocs_annotation_cloud/models/files_upload_result.rb +1 -1
  28. data/lib/groupdocs_annotation_cloud/models/format.rb +1 -1
  29. data/lib/groupdocs_annotation_cloud/models/formats_result.rb +1 -1
  30. data/lib/groupdocs_annotation_cloud/models/link.rb +1 -1
  31. data/lib/groupdocs_annotation_cloud/models/link_element.rb +1 -1
  32. data/lib/groupdocs_annotation_cloud/models/object_exist.rb +1 -1
  33. data/lib/groupdocs_annotation_cloud/models/page_image.rb +1 -1
  34. data/lib/groupdocs_annotation_cloud/models/page_images.rb +1 -1
  35. data/lib/groupdocs_annotation_cloud/models/page_info.rb +1 -1
  36. data/lib/groupdocs_annotation_cloud/models/point.rb +1 -1
  37. data/lib/groupdocs_annotation_cloud/models/preview_options.rb +1 -1
  38. data/lib/groupdocs_annotation_cloud/models/rectangle.rb +1 -1
  39. data/lib/groupdocs_annotation_cloud/models/remove_options.rb +1 -1
  40. data/lib/groupdocs_annotation_cloud/models/storage_exist.rb +1 -1
  41. data/lib/groupdocs_annotation_cloud/models/storage_file.rb +1 -1
  42. data/lib/groupdocs_annotation_cloud/version.rb +2 -2
  43. data/lib/groupdocs_annotation_cloud.rb +4 -2
  44. metadata +13 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8edeb3ab309272f20329a0b7926d6f1d0a0bcbfe
4
- data.tar.gz: fa27df3d5bb334e1cd846e3f90d70080f88f81ea
2
+ SHA256:
3
+ metadata.gz: 96b875b0b88aa0152cda3e8b33187687e0b7aa0b4fafa0ba998238b0907821ca
4
+ data.tar.gz: f30a576bc4dc00fc3b06e18cf140a6dde5157985f64e8590428646e55b077cd7
5
5
  SHA512:
6
- metadata.gz: 9679cee1c56bfe94e5141dbbbb252fbe704943fe596605908c57dc93567223f6aab5a267b9b57ffaad053c1b4db42c34bf669775bf5e28b3422db1ff14e4640b
7
- data.tar.gz: 8c9dd4987b1b4b61daeff6e01e0c32eedff62917738c6be41e73f69d961651ec4762803d06ca901eba2b2043202c5198f46752d8c45ffc1053da45040824745e
6
+ metadata.gz: 559bba103cc76257eccb1995927e3332417ce48ace60a8561affc9057d8b77c0d3af82d75a918dfbe8378abc19117429f7f73da89c7d48e011475df25f3de89b
7
+ data.tar.gz: 4cf0ba6721dfb3f4b8aeee7cf7d290770b1a3501d5f45d804b2e069c40e5fe18e5c33ed2e7df0aa367b6ba482911cc874c42e986c253a91355c4a4bb6a3780f0
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="annotate.rb">
3
- # Copyright (c) 2003-2023 Aspose Pty Ltd
3
+ # Copyright (c) Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -329,7 +329,7 @@ end
329
329
  #
330
330
  # --------------------------------------------------------------------------------------------------------------------
331
331
  # <copyright company="Aspose Pty Ltd" file="annotate_request.rb">
332
- # Copyright (c) 2003-2023 Aspose Pty Ltd
332
+ # Copyright (c) Aspose Pty Ltd
333
333
  # </copyright>
334
334
  # <summary>
335
335
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -374,7 +374,7 @@ end
374
374
  #
375
375
  # --------------------------------------------------------------------------------------------------------------------
376
376
  # <copyright company="Aspose Pty Ltd" file="annotate_direct_request.rb">
377
- # Copyright (c) 2003-2023 Aspose Pty Ltd
377
+ # Copyright (c) Aspose Pty Ltd
378
378
  # </copyright>
379
379
  # <summary>
380
380
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -419,7 +419,7 @@ end
419
419
  #
420
420
  # --------------------------------------------------------------------------------------------------------------------
421
421
  # <copyright company="Aspose Pty Ltd" file="extract_request.rb">
422
- # Copyright (c) 2003-2023 Aspose Pty Ltd
422
+ # Copyright (c) Aspose Pty Ltd
423
423
  # </copyright>
424
424
  # <summary>
425
425
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -464,7 +464,7 @@ end
464
464
  #
465
465
  # --------------------------------------------------------------------------------------------------------------------
466
466
  # <copyright company="Aspose Pty Ltd" file="remove_annotations_request.rb">
467
- # Copyright (c) 2003-2023 Aspose Pty Ltd
467
+ # Copyright (c) Aspose Pty Ltd
468
468
  # </copyright>
469
469
  # <summary>
470
470
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="file.rb">
3
- # Copyright (c) 2003-2023 Aspose Pty Ltd
3
+ # Copyright (c) Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -449,7 +449,7 @@ end
449
449
  #
450
450
  # --------------------------------------------------------------------------------------------------------------------
451
451
  # <copyright company="Aspose Pty Ltd" file="copy_file_request.rb">
452
- # Copyright (c) 2003-2023 Aspose Pty Ltd
452
+ # Copyright (c) Aspose Pty Ltd
453
453
  # </copyright>
454
454
  # <summary>
455
455
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -510,7 +510,7 @@ end
510
510
  #
511
511
  # --------------------------------------------------------------------------------------------------------------------
512
512
  # <copyright company="Aspose Pty Ltd" file="delete_file_request.rb">
513
- # Copyright (c) 2003-2023 Aspose Pty Ltd
513
+ # Copyright (c) Aspose Pty Ltd
514
514
  # </copyright>
515
515
  # <summary>
516
516
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -563,7 +563,7 @@ end
563
563
  #
564
564
  # --------------------------------------------------------------------------------------------------------------------
565
565
  # <copyright company="Aspose Pty Ltd" file="download_file_request.rb">
566
- # Copyright (c) 2003-2023 Aspose Pty Ltd
566
+ # Copyright (c) Aspose Pty Ltd
567
567
  # </copyright>
568
568
  # <summary>
569
569
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -616,7 +616,7 @@ end
616
616
  #
617
617
  # --------------------------------------------------------------------------------------------------------------------
618
618
  # <copyright company="Aspose Pty Ltd" file="move_file_request.rb">
619
- # Copyright (c) 2003-2023 Aspose Pty Ltd
619
+ # Copyright (c) Aspose Pty Ltd
620
620
  # </copyright>
621
621
  # <summary>
622
622
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -677,7 +677,7 @@ end
677
677
  #
678
678
  # --------------------------------------------------------------------------------------------------------------------
679
679
  # <copyright company="Aspose Pty Ltd" file="upload_file_request.rb">
680
- # Copyright (c) 2003-2023 Aspose Pty Ltd
680
+ # Copyright (c) Aspose Pty Ltd
681
681
  # </copyright>
682
682
  # <summary>
683
683
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="folder.rb">
3
- # Copyright (c) 2003-2023 Aspose Pty Ltd
3
+ # Copyright (c) Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -430,7 +430,7 @@ end
430
430
  #
431
431
  # --------------------------------------------------------------------------------------------------------------------
432
432
  # <copyright company="Aspose Pty Ltd" file="copy_folder_request.rb">
433
- # Copyright (c) 2003-2023 Aspose Pty Ltd
433
+ # Copyright (c) Aspose Pty Ltd
434
434
  # </copyright>
435
435
  # <summary>
436
436
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -487,7 +487,7 @@ end
487
487
  #
488
488
  # --------------------------------------------------------------------------------------------------------------------
489
489
  # <copyright company="Aspose Pty Ltd" file="create_folder_request.rb">
490
- # Copyright (c) 2003-2023 Aspose Pty Ltd
490
+ # Copyright (c) Aspose Pty Ltd
491
491
  # </copyright>
492
492
  # <summary>
493
493
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -536,7 +536,7 @@ end
536
536
  #
537
537
  # --------------------------------------------------------------------------------------------------------------------
538
538
  # <copyright company="Aspose Pty Ltd" file="delete_folder_request.rb">
539
- # Copyright (c) 2003-2023 Aspose Pty Ltd
539
+ # Copyright (c) Aspose Pty Ltd
540
540
  # </copyright>
541
541
  # <summary>
542
542
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -589,7 +589,7 @@ end
589
589
  #
590
590
  # --------------------------------------------------------------------------------------------------------------------
591
591
  # <copyright company="Aspose Pty Ltd" file="get_files_list_request.rb">
592
- # Copyright (c) 2003-2023 Aspose Pty Ltd
592
+ # Copyright (c) Aspose Pty Ltd
593
593
  # </copyright>
594
594
  # <summary>
595
595
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -638,7 +638,7 @@ end
638
638
  #
639
639
  # --------------------------------------------------------------------------------------------------------------------
640
640
  # <copyright company="Aspose Pty Ltd" file="move_folder_request.rb">
641
- # Copyright (c) 2003-2023 Aspose Pty Ltd
641
+ # Copyright (c) Aspose Pty Ltd
642
642
  # </copyright>
643
643
  # <summary>
644
644
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="info.rb">
3
- # Copyright (c) 2003-2023 Aspose Pty Ltd
3
+ # Copyright (c) Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -222,7 +222,7 @@ end
222
222
  #
223
223
  # --------------------------------------------------------------------------------------------------------------------
224
224
  # <copyright company="Aspose Pty Ltd" file="get_info_request.rb">
225
- # Copyright (c) 2003-2023 Aspose Pty Ltd
225
+ # Copyright (c) Aspose Pty Ltd
226
226
  # </copyright>
227
227
  # <summary>
228
228
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="license.rb">
3
- # Copyright (c) 2003-2023 Aspose Pty Ltd
3
+ # Copyright (c) Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="preview.rb">
3
- # Copyright (c) 2003-2023 Aspose Pty Ltd
3
+ # Copyright (c) Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -224,7 +224,7 @@ end
224
224
  #
225
225
  # --------------------------------------------------------------------------------------------------------------------
226
226
  # <copyright company="Aspose Pty Ltd" file="delete_pages_request.rb">
227
- # Copyright (c) 2003-2023 Aspose Pty Ltd
227
+ # Copyright (c) Aspose Pty Ltd
228
228
  # </copyright>
229
229
  # <summary>
230
230
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -269,7 +269,7 @@ end
269
269
  #
270
270
  # --------------------------------------------------------------------------------------------------------------------
271
271
  # <copyright company="Aspose Pty Ltd" file="get_pages_request.rb">
272
- # Copyright (c) 2003-2023 Aspose Pty Ltd
272
+ # Copyright (c) Aspose Pty Ltd
273
273
  # </copyright>
274
274
  # <summary>
275
275
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="storage.rb">
3
- # Copyright (c) 2003-2023 Aspose Pty Ltd
3
+ # Copyright (c) Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -350,7 +350,7 @@ end
350
350
  #
351
351
  # --------------------------------------------------------------------------------------------------------------------
352
352
  # <copyright company="Aspose Pty Ltd" file="get_disc_usage_request.rb">
353
- # Copyright (c) 2003-2023 Aspose Pty Ltd
353
+ # Copyright (c) Aspose Pty Ltd
354
354
  # </copyright>
355
355
  # <summary>
356
356
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -395,7 +395,7 @@ end
395
395
  #
396
396
  # --------------------------------------------------------------------------------------------------------------------
397
397
  # <copyright company="Aspose Pty Ltd" file="get_file_versions_request.rb">
398
- # Copyright (c) 2003-2023 Aspose Pty Ltd
398
+ # Copyright (c) Aspose Pty Ltd
399
399
  # </copyright>
400
400
  # <summary>
401
401
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -444,7 +444,7 @@ end
444
444
  #
445
445
  # --------------------------------------------------------------------------------------------------------------------
446
446
  # <copyright company="Aspose Pty Ltd" file="object_exists_request.rb">
447
- # Copyright (c) 2003-2023 Aspose Pty Ltd
447
+ # Copyright (c) Aspose Pty Ltd
448
448
  # </copyright>
449
449
  # <summary>
450
450
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -497,7 +497,7 @@ end
497
497
  #
498
498
  # --------------------------------------------------------------------------------------------------------------------
499
499
  # <copyright company="Aspose Pty Ltd" file="storage_exists_request.rb">
500
- # Copyright (c) 2003-2023 Aspose Pty Ltd
500
+ # Copyright (c) Aspose Pty Ltd
501
501
  # </copyright>
502
502
  # <summary>
503
503
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="api_client.rb">
3
- # Copyright (c) 2003-2023 Aspose Pty Ltd
3
+ # Copyright (c) Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -28,10 +28,9 @@ require 'json'
28
28
  require 'logger'
29
29
  require 'tempfile'
30
30
  require 'faraday'
31
- require 'mimemagic'
32
31
  require 'addressable'
33
32
  require_relative 'version'
34
- require_relative 'api_error'
33
+ require_relative 'api_client_error'
35
34
 
36
35
  module GroupDocsAnnotationCloud
37
36
  #
@@ -69,7 +68,7 @@ module GroupDocsAnnotationCloud
69
68
  end
70
69
 
71
70
  unless response.success?
72
- raise ApiError.new(:code => response.status, :response_body => response.body)
71
+ raise ApiClientError.new(:code => response.status, :response_body => response.body)
73
72
  end
74
73
 
75
74
  data = deserialize(response, opts[:return_type]) if opts[:return_type]
@@ -281,7 +280,7 @@ module GroupDocsAnnotationCloud
281
280
  form_params.each do |key, value|
282
281
  case value
283
282
  when ::File
284
- data[key] = Faraday::UploadIO.new(value.path, MimeMagic.by_magic(value).to_s, key)
283
+ data[key] = Faraday::UploadIO.new(value.path, "application/octet-stream", key)
285
284
  when ::Array, nil
286
285
  data[key] = value
287
286
  else
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
- # <copyright company="Aspose Pty Ltd" file="api_error.rb">
3
- # Copyright (c) 2003-2023 Aspose Pty Ltd
2
+ # <copyright company="Aspose Pty Ltd" file="api_client_error.rb">
3
+ # Copyright (c) Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -25,15 +25,15 @@
25
25
 
26
26
  module GroupDocsAnnotationCloud
27
27
  #
28
- # ApiError class for error handling
28
+ # ApiClientError class for error handling
29
29
  #
30
- class ApiError < StandardError
30
+ class ApiClientError < StandardError
31
31
  attr_reader :code
32
32
  attr_reader :message
33
33
 
34
34
  # Usage examples:
35
- # ApiError.new
36
- # ApiError.new(:code => 500, :response_body => "")
35
+ # ApiClientError.new
36
+ # ApiClientError.new(:code => 500, :response_body => "")
37
37
  def initialize(arg = nil)
38
38
  if arg.is_a? Hash
39
39
 
@@ -1,6 +1,6 @@
1
1
  # ------------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="configuration.rb">
3
- # Copyright (c) 2003-2023 Aspose Pty Ltd
3
+ # Copyright (c) Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="annotate_options.rb">
4
- # Copyright (c) 2003-2023 Aspose Pty Ltd
4
+ # Copyright (c) Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="annotation_api_link.rb">
4
- # Copyright (c) 2003-2023 Aspose Pty Ltd
4
+ # Copyright (c) Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="annotation_info.rb">
4
- # Copyright (c) 2003-2023 Aspose Pty Ltd
4
+ # Copyright (c) Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="annotation_reply_info.rb">
4
- # Copyright (c) 2003-2023 Aspose Pty Ltd
4
+ # Copyright (c) Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -0,0 +1,244 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="api_error.rb">
4
+ # Copyright (c) Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsAnnotationCloud
31
+
32
+ class ApiError
33
+ attr_accessor :code
34
+ attr_accessor :message
35
+ attr_accessor :description
36
+ attr_accessor :date_time
37
+ attr_accessor :inner_error
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'code' => :'Code',
43
+ :'message' => :'Message',
44
+ :'description' => :'Description',
45
+ :'date_time' => :'DateTime',
46
+ :'inner_error' => :'InnerError'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.swagger_types
52
+ {
53
+ :'code' => :'String',
54
+ :'message' => :'String',
55
+ :'description' => :'String',
56
+ :'date_time' => :'DateTime',
57
+ :'inner_error' => :'ApiError'
58
+ }
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ return unless attributes.is_a?(Hash)
65
+
66
+ # convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
+
69
+ if attributes.key?(:'Code')
70
+ self.code = attributes[:'Code']
71
+ end
72
+
73
+ if attributes.key?(:'Message')
74
+ self.message = attributes[:'Message']
75
+ end
76
+
77
+ if attributes.key?(:'Description')
78
+ self.description = attributes[:'Description']
79
+ end
80
+
81
+ if attributes.key?(:'DateTime')
82
+ self.date_time = attributes[:'DateTime']
83
+ end
84
+
85
+ if attributes.key?(:'InnerError')
86
+ self.inner_error = attributes[:'InnerError']
87
+ end
88
+
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properies with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = []
95
+ return invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ return true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(other)
107
+ return true if self.equal?(other)
108
+ self.class == other.class &&
109
+ code == other.code &&
110
+ message == other.message &&
111
+ description == other.description &&
112
+ date_time == other.date_time &&
113
+ inner_error == other.inner_error
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(other)
119
+ self == other
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Fixnum] Hash code
124
+ def hash
125
+ [code, message, description, date_time, inner_error].hash
126
+ end
127
+
128
+ # Downcases first letter.
129
+ # @return downcased string
130
+ def uncap(str)
131
+ str[0, 1].downcase + str[1..-1]
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ self.class.swagger_types.each_pair do |key, type|
140
+ pname = uncap(self.class.attribute_map[key]).intern
141
+ value = attributes[pname]
142
+ if type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the the attribute
144
+ # is documented as an array but the input is not
145
+ if value.is_a?(Array)
146
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
147
+ end
148
+ elsif !value.nil?
149
+ self.send("#{key}=", _deserialize(type, value))
150
+ end
151
+ # or else data not found in attributes(hash), not an issue as the data can be optional
152
+ end
153
+
154
+ self
155
+ end
156
+
157
+ # Deserializes the data based on type
158
+ # @param string type Data type
159
+ # @param string value Value to be deserialized
160
+ # @return [Object] Deserialized data
161
+ def _deserialize(type, value)
162
+ case type.to_sym
163
+ when :DateTime
164
+ Date.parse value
165
+ when :Date
166
+ Date.parse value
167
+ when :String
168
+ value.to_s
169
+ when :Integer
170
+ value.to_i
171
+ when :Float
172
+ value.to_f
173
+ when :BOOLEAN
174
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
175
+ true
176
+ else
177
+ false
178
+ end
179
+ when :Object
180
+ # generic object (usually a Hash), return directly
181
+ value
182
+ when /\AArray<(?<inner_type>.+)>\z/
183
+ inner_type = Regexp.last_match[:inner_type]
184
+ value.map { |v| _deserialize(inner_type, v) }
185
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
186
+ k_type = Regexp.last_match[:k_type]
187
+ v_type = Regexp.last_match[:v_type]
188
+ {}.tap do |hash|
189
+ value.each do |k, v|
190
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
191
+ end
192
+ end
193
+ else
194
+ # model
195
+ temp_model = GroupDocsAnnotationCloud.const_get(type).new
196
+ temp_model.build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ next if value.nil?
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+
244
+ end