groupdocs_viewer_cloud 18.11 → 19.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_viewer_cloud.rb +27 -32
  3. data/lib/groupdocs_viewer_cloud/api/file_api.rb +729 -0
  4. data/lib/groupdocs_viewer_cloud/api/folder_api.rb +694 -0
  5. data/lib/groupdocs_viewer_cloud/api/storage_api.rb +541 -0
  6. data/lib/groupdocs_viewer_cloud/api/viewer_api.rb +232 -5069
  7. data/lib/groupdocs_viewer_cloud/api_client.rb +5 -5
  8. data/lib/groupdocs_viewer_cloud/api_error.rb +6 -6
  9. data/lib/groupdocs_viewer_cloud/configuration.rb +4 -4
  10. data/lib/groupdocs_viewer_cloud/models/attachment_info.rb +22 -34
  11. data/lib/groupdocs_viewer_cloud/models/{html_page.rb → attachment_view.rb} +39 -33
  12. data/lib/groupdocs_viewer_cloud/models/cad_options.rb +44 -65
  13. data/lib/groupdocs_viewer_cloud/models/{font_family.rb → delete_view_options.rb} +25 -17
  14. data/lib/groupdocs_viewer_cloud/models/{reorder_options.rb → disc_usage.rb} +42 -34
  15. data/lib/groupdocs_viewer_cloud/models/email_options.rb +23 -25
  16. data/lib/groupdocs_viewer_cloud/models/{image_page_collection.rb → error.rb} +46 -40
  17. data/lib/groupdocs_viewer_cloud/models/{outlook_options.rb → error_details.rb} +40 -17
  18. data/lib/groupdocs_viewer_cloud/models/field_label.rb +20 -12
  19. data/lib/groupdocs_viewer_cloud/models/{transform_options_base.rb → file_info.rb} +49 -21
  20. data/lib/groupdocs_viewer_cloud/models/{html_attachment_page_collection.rb → file_version.rb} +91 -40
  21. data/lib/groupdocs_viewer_cloud/models/{page_info_collection.rb → file_versions.rb} +26 -18
  22. data/lib/groupdocs_viewer_cloud/models/{font_collection.rb → files_list.rb} +26 -18
  23. data/lib/groupdocs_viewer_cloud/models/{image_page.rb → files_upload_result.rb} +36 -24
  24. data/lib/groupdocs_viewer_cloud/models/format.rb +30 -22
  25. data/lib/groupdocs_viewer_cloud/models/{format_collection.rb → formats_result.rb} +19 -11
  26. data/lib/groupdocs_viewer_cloud/models/html_options.rb +108 -209
  27. data/lib/groupdocs_viewer_cloud/models/html_resource.rb +234 -0
  28. data/lib/groupdocs_viewer_cloud/models/image_options.rb +129 -163
  29. data/lib/groupdocs_viewer_cloud/models/{attachment_collection.rb → info_result.rb} +32 -32
  30. data/lib/groupdocs_viewer_cloud/models/{rotate_options.rb → object_exist.rb} +42 -34
  31. data/lib/groupdocs_viewer_cloud/models/page_info.rb +48 -55
  32. data/lib/groupdocs_viewer_cloud/models/{pdf_file_info.rb → page_view.rb} +53 -38
  33. data/lib/groupdocs_viewer_cloud/models/{project_options.rb → project_management_options.rb} +39 -21
  34. data/lib/groupdocs_viewer_cloud/models/render_options.rb +92 -146
  35. data/lib/groupdocs_viewer_cloud/models/resource.rb +30 -22
  36. data/lib/groupdocs_viewer_cloud/models/{row_info.rb → row.rb} +65 -37
  37. data/lib/groupdocs_viewer_cloud/models/{cells_options.rb → spreadsheet_options.rb} +95 -67
  38. data/lib/groupdocs_viewer_cloud/models/{attachment.rb → storage_exist.rb} +30 -27
  39. data/lib/groupdocs_viewer_cloud/models/{image_attachment_page_collection.rb → storage_file.rb} +66 -40
  40. data/lib/groupdocs_viewer_cloud/models/{document_info.rb → view_options.rb} +99 -105
  41. data/lib/groupdocs_viewer_cloud/models/{html_page_collection.rb → view_result.rb} +43 -33
  42. data/lib/groupdocs_viewer_cloud/models/watermark.rb +35 -22
  43. data/lib/groupdocs_viewer_cloud/version.rb +2 -2
  44. metadata +27 -110
  45. data/lib/groupdocs_viewer_cloud/models/document_info_options.rb +0 -358
  46. data/lib/groupdocs_viewer_cloud/models/file_response.rb +0 -196
  47. data/lib/groupdocs_viewer_cloud/models/pdf_file_options.rb +0 -358
  48. data/lib/groupdocs_viewer_cloud/models/pdf_options.rb +0 -236
  49. data/lib/groupdocs_viewer_cloud/models/render_options_base.rb +0 -358
  50. data/lib/groupdocs_viewer_cloud/models/requests/html_create_attachment_pages_cache_request.rb +0 -65
  51. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_from_content_request.rb +0 -65
  52. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_from_url_request.rb +0 -65
  53. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_request.rb +0 -61
  54. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_from_content_request.rb +0 -65
  55. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_from_url_request.rb +0 -65
  56. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_request.rb +0 -61
  57. data/lib/groupdocs_viewer_cloud/models/requests/html_delete_attachment_pages_cache_request.rb +0 -57
  58. data/lib/groupdocs_viewer_cloud/models/requests/html_delete_pages_cache_request.rb +0 -53
  59. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_info_request.rb +0 -65
  60. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_info_with_options_request.rb +0 -61
  61. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_page_request.rb +0 -109
  62. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_page_resource_request.rb +0 -65
  63. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_pages_request.rb +0 -113
  64. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_request.rb +0 -61
  65. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachments_request.rb +0 -57
  66. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_content_request.rb +0 -61
  67. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_url_request.rb +0 -69
  68. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_url_with_options_request.rb +0 -61
  69. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_request.rb +0 -65
  70. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_with_options_request.rb +0 -57
  71. data/lib/groupdocs_viewer_cloud/models/requests/html_get_page_request.rb +0 -101
  72. data/lib/groupdocs_viewer_cloud/models/requests/html_get_page_resource_request.rb +0 -61
  73. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pages_from_url_request.rb +0 -109
  74. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pages_request.rb +0 -105
  75. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pdf_file_from_url_request.rb +0 -77
  76. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pdf_file_request.rb +0 -73
  77. data/lib/groupdocs_viewer_cloud/models/requests/html_get_zip_with_attachment_pages_request.rb +0 -113
  78. data/lib/groupdocs_viewer_cloud/models/requests/html_get_zip_with_pages_request.rb +0 -105
  79. data/lib/groupdocs_viewer_cloud/models/requests/html_transform_pages_request.rb +0 -57
  80. data/lib/groupdocs_viewer_cloud/models/requests/image_create_attachment_pages_cache_request.rb +0 -65
  81. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_from_content_request.rb +0 -65
  82. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_from_url_request.rb +0 -65
  83. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_request.rb +0 -61
  84. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_from_content_request.rb +0 -65
  85. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_from_url_request.rb +0 -65
  86. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_request.rb +0 -61
  87. data/lib/groupdocs_viewer_cloud/models/requests/image_delete_attachment_pages_cache_request.rb +0 -57
  88. data/lib/groupdocs_viewer_cloud/models/requests/image_delete_pages_cache_request.rb +0 -53
  89. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_info_request.rb +0 -69
  90. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_info_with_options_request.rb +0 -61
  91. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_page_request.rb +0 -105
  92. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_pages_request.rb +0 -109
  93. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_request.rb +0 -61
  94. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachments_request.rb +0 -57
  95. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_content_request.rb +0 -61
  96. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_url_request.rb +0 -73
  97. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_url_with_options_request.rb +0 -61
  98. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_request.rb +0 -69
  99. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_with_options_request.rb +0 -57
  100. data/lib/groupdocs_viewer_cloud/models/requests/image_get_page_request.rb +0 -97
  101. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pages_from_url_request.rb +0 -105
  102. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pages_request.rb +0 -101
  103. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pdf_file_from_url_request.rb +0 -77
  104. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pdf_file_request.rb +0 -73
  105. data/lib/groupdocs_viewer_cloud/models/requests/image_get_zip_with_attachment_pages_request.rb +0 -109
  106. data/lib/groupdocs_viewer_cloud/models/requests/image_get_zip_with_pages_request.rb +0 -101
  107. data/lib/groupdocs_viewer_cloud/models/requests/image_transform_pages_request.rb +0 -57
  108. data/lib/groupdocs_viewer_cloud/models/resource_url.rb +0 -206
  109. data/lib/groupdocs_viewer_cloud/models/slides_options.rb +0 -206
  110. data/lib/groupdocs_viewer_cloud/models/tile.rb +0 -236
  111. data/lib/groupdocs_viewer_cloud/models/words_options.rb +0 -216
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="api_client.rb">
3
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -51,7 +51,7 @@ module GroupDocsViewerCloud
51
51
  def initialize(config)
52
52
  @config = config
53
53
  @default_headers = {
54
- 'Content-Type' => "application/json",
54
+ 'Content-Type' => config.api_version == '' ? "application/x-www-form-urlencoded" : "application/json",
55
55
  'x-groupdocs-client' => "ruby sdk",
56
56
  'x-groupdocs-version' => GroupDocsViewerCloud::VERSION.to_s
57
57
  }
@@ -273,7 +273,9 @@ module GroupDocsViewerCloud
273
273
  # @return [String] HTTP body data in the form of string
274
274
  def build_request_body(header_params, form_params, body)
275
275
  # http form
276
- if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
276
+ if body
277
+ data = body.is_a?(String) ? body : body.to_json
278
+ elsif header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
277
279
  header_params['Content-Type'] == 'multipart/form-data'
278
280
  data = {}
279
281
  form_params.each do |key, value|
@@ -286,8 +288,6 @@ module GroupDocsViewerCloud
286
288
  data[key] = value.to_s
287
289
  end
288
290
  end
289
- elsif body
290
- data = body.is_a?(String) ? body : body.to_json
291
291
  else
292
292
  data = nil
293
293
  end
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="api_error.rb">
3
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -39,15 +39,15 @@ module GroupDocsViewerCloud
39
39
 
40
40
  if arg.key?(:response_body) then
41
41
  data = JSON.parse(arg[:response_body], :symbolize_names => true)
42
- if !data.nil? && !data[:error_description].nil? then
43
- @message = data[:error_description]
44
- elsif !data.nil? && !data[:error].nil? && !data[:error][:message].nil? then
45
- @message = data[:error][:message]
42
+ if !data.nil? && !data[:error].nil? then
43
+ @message = data[:error]
44
+ elsif !data.nil? && !data[:Error].nil? && !data[:Error][:Message].nil? then
45
+ @message = data[:Error][:Message]
46
46
  end
47
47
  end
48
48
 
49
49
  if arg.key?(:arg) then
50
- @code = arg[:code]
50
+ @code = arg[:Code]
51
51
  end
52
52
 
53
53
  else
@@ -1,6 +1,6 @@
1
1
  # ------------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="configuration.rb">
3
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -34,7 +34,7 @@ module GroupDocsViewerCloud
34
34
  # @return [String] Api base url
35
35
  attr_accessor :api_base_url
36
36
 
37
- # Api version, default is '/v1'
37
+ # Api version, default is '/v2.0'
38
38
  #
39
39
  # @return [String] Api version
40
40
  attr_accessor :api_version
@@ -80,8 +80,8 @@ module GroupDocsViewerCloud
80
80
  # @param [app_key] Application private key (App Key)
81
81
  # @return [Configuration] New instance of Configuration
82
82
  def initialize(app_sid, app_key)
83
- @api_base_url = "http://api.groupdocs.cloud"
84
- @api_version = '/v1'
83
+ @api_base_url = "https://api.groupdocs.cloud"
84
+ @api_version = '/v2.0'
85
85
  @app_sid = app_sid
86
86
  @app_key = app_key
87
87
  @client_side_validation = true
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="attachment_info.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -28,33 +28,23 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # Describes attachment information
31
+ # Attachment information
32
32
  class AttachmentInfo
33
33
 
34
- # Attachment name.
34
+ # Attachment name
35
35
  attr_accessor :name
36
36
 
37
- # Attachment extension.
38
- attr_accessor :extension
39
-
40
- # File format.
41
- attr_accessor :file_format
42
-
43
37
  # Attribute mapping from ruby-style variable name to JSON key.
44
38
  def self.attribute_map
45
39
  {
46
- :'name' => :'name',
47
- :'extension' => :'extension',
48
- :'file_format' => :'fileFormat'
40
+ :'name' => :'Name'
49
41
  }
50
42
  end
51
43
 
52
44
  # Attribute type mapping.
53
45
  def self.swagger_types
54
46
  {
55
- :'name' => :'String',
56
- :'extension' => :'String',
57
- :'file_format' => :'String'
47
+ :'name' => :'String'
58
48
  }
59
49
  end
60
50
 
@@ -66,16 +56,8 @@ module GroupDocsViewerCloud
66
56
  # convert string to symbol for hash key
67
57
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
58
 
69
- if attributes.key?(:'name')
70
- self.name = attributes[:'name']
71
- end
72
-
73
- if attributes.key?(:'extension')
74
- self.extension = attributes[:'extension']
75
- end
76
-
77
- if attributes.key?(:'fileFormat')
78
- self.file_format = attributes[:'fileFormat']
59
+ if attributes.key?(:'Name')
60
+ self.name = attributes[:'Name']
79
61
  end
80
62
 
81
63
  end
@@ -98,9 +80,7 @@ module GroupDocsViewerCloud
98
80
  def ==(other)
99
81
  return true if self.equal?(other)
100
82
  self.class == other.class &&
101
- name == other.name &&
102
- extension == other.extension &&
103
- file_format == other.file_format
83
+ name == other.name
104
84
  end
105
85
 
106
86
  # @see the `==` method
@@ -112,7 +92,13 @@ module GroupDocsViewerCloud
112
92
  # Calculates hash code according to all attributes.
113
93
  # @return [Fixnum] Hash code
114
94
  def hash
115
- [name, extension, file_format].hash
95
+ [name].hash
96
+ end
97
+
98
+ # Downcases first letter.
99
+ # @return downcased string
100
+ def uncap(str)
101
+ str[0, 1].downcase + str[1..-1]
116
102
  end
117
103
 
118
104
  # Builds the object from hash
@@ -121,14 +107,16 @@ module GroupDocsViewerCloud
121
107
  def build_from_hash(attributes)
122
108
  return nil unless attributes.is_a?(Hash)
123
109
  self.class.swagger_types.each_pair do |key, type|
110
+ pname = uncap(self.class.attribute_map[key]).intern
111
+ value = attributes[pname]
124
112
  if type =~ /\AArray<(.*)>/i
125
113
  # check to ensure the input is an array given that the the attribute
126
- # is documented as an array but the input is not
127
- if attributes[self.class.attribute_map[key]].is_a?(Array)
128
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ # is documented as an array but the input is not
115
+ if value.is_a?(Array)
116
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
129
117
  end
130
- elsif !attributes[self.class.attribute_map[key]].nil?
131
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
118
+ elsif !value.nil?
119
+ self.send("#{key}=", _deserialize(type, value))
132
120
  end
133
121
  # or else data not found in attributes(hash), not an issue as the data can be optional
134
122
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="html_page.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # <copyright company="Aspose Pty Ltd" file="attachment_view.rb">
4
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -28,33 +28,33 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # Describes HTML page.
32
- class HtmlPage
31
+ # Attachment
32
+ class AttachmentView
33
33
 
34
- # ULR to retrieve resource.
35
- attr_accessor :url
34
+ # Path of resource file in storage
35
+ attr_accessor :path
36
36
 
37
- # Page number.
38
- attr_accessor :number
37
+ # ULR to retrieve resource.
38
+ attr_accessor :download_url
39
39
 
40
- # HTML resources.
41
- attr_accessor :resources
40
+ # Attachment name
41
+ attr_accessor :name
42
42
 
43
43
  # Attribute mapping from ruby-style variable name to JSON key.
44
44
  def self.attribute_map
45
45
  {
46
- :'url' => :'url',
47
- :'number' => :'number',
48
- :'resources' => :'resources'
46
+ :'path' => :'Path',
47
+ :'download_url' => :'DownloadUrl',
48
+ :'name' => :'Name'
49
49
  }
50
50
  end
51
51
 
52
52
  # Attribute type mapping.
53
53
  def self.swagger_types
54
54
  {
55
- :'url' => :'String',
56
- :'number' => :'Integer',
57
- :'resources' => :'Array<Resource>'
55
+ :'path' => :'String',
56
+ :'download_url' => :'String',
57
+ :'name' => :'String'
58
58
  }
59
59
  end
60
60
 
@@ -66,18 +66,16 @@ module GroupDocsViewerCloud
66
66
  # convert string to symbol for hash key
67
67
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
68
 
69
- if attributes.key?(:'url')
70
- self.url = attributes[:'url']
69
+ if attributes.key?(:'Path')
70
+ self.path = attributes[:'Path']
71
71
  end
72
72
 
73
- if attributes.key?(:'number')
74
- self.number = attributes[:'number']
73
+ if attributes.key?(:'DownloadUrl')
74
+ self.download_url = attributes[:'DownloadUrl']
75
75
  end
76
76
 
77
- if attributes.key?(:'resources')
78
- if (value = attributes[:'resources']).is_a?(Array)
79
- self.resources = value
80
- end
77
+ if attributes.key?(:'Name')
78
+ self.name = attributes[:'Name']
81
79
  end
82
80
 
83
81
  end
@@ -100,9 +98,9 @@ module GroupDocsViewerCloud
100
98
  def ==(other)
101
99
  return true if self.equal?(other)
102
100
  self.class == other.class &&
103
- url == other.url &&
104
- number == other.number &&
105
- resources == other.resources
101
+ path == other.path &&
102
+ download_url == other.download_url &&
103
+ name == other.name
106
104
  end
107
105
 
108
106
  # @see the `==` method
@@ -114,7 +112,13 @@ module GroupDocsViewerCloud
114
112
  # Calculates hash code according to all attributes.
115
113
  # @return [Fixnum] Hash code
116
114
  def hash
117
- [url, number, resources].hash
115
+ [path, download_url, name].hash
116
+ end
117
+
118
+ # Downcases first letter.
119
+ # @return downcased string
120
+ def uncap(str)
121
+ str[0, 1].downcase + str[1..-1]
118
122
  end
119
123
 
120
124
  # Builds the object from hash
@@ -123,14 +127,16 @@ module GroupDocsViewerCloud
123
127
  def build_from_hash(attributes)
124
128
  return nil unless attributes.is_a?(Hash)
125
129
  self.class.swagger_types.each_pair do |key, type|
130
+ pname = uncap(self.class.attribute_map[key]).intern
131
+ value = attributes[pname]
126
132
  if type =~ /\AArray<(.*)>/i
127
133
  # check to ensure the input is an array given that the the attribute
128
- # is documented as an array but the input is not
129
- if attributes[self.class.attribute_map[key]].is_a?(Array)
130
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
134
+ # is documented as an array but the input is not
135
+ if value.is_a?(Array)
136
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
131
137
  end
132
- elsif !attributes[self.class.attribute_map[key]].nil?
133
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ elsif !value.nil?
139
+ self.send("#{key}=", _deserialize(type, value))
134
140
  end
135
141
  # or else data not found in attributes(hash), not an issue as the data can be optional
136
142
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="cad_options.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -28,40 +28,24 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # The CAD documents rendering options. Rendering of CAD file formats is not supported at the moment.
31
+ # Rendering options for CAD file formats. CAD file formats include files with extensions: .dwg, .dxf, .dgn, .ifc, .stl
32
32
  class CadOptions
33
33
 
34
- # The scale factor affects the size of an output document.
34
+ # Scale factor allows to change the size of the output document. Values higher than 1 will enlarge output result and values between 0 and 1 will make output result smaller. This option is ignored when either Height or Width options are set.
35
35
  attr_accessor :scale_factor
36
36
 
37
- # The width of the render result in pixels.
37
+ # Width of the output result in pixels
38
38
  attr_accessor :width
39
39
 
40
- # The height of the render result in pixels.
40
+ # Height of the output result in pixels
41
41
  attr_accessor :height
42
42
 
43
- # Indicates whether layouts from CAD document should be rendered.
44
- attr_accessor :render_layouts
45
-
46
- # The name of the specific layout to render.
47
- attr_accessor :layout_name
48
-
49
- # The list of document layers to render. By default all layers will be rendered. Layer names are case sensitive.
50
- attr_accessor :layers
51
-
52
- # The coordinates of the drawing regions, that should be rendered. Please note, that this option works only for DWG format. When the list is empty, then whole drawing is rendered. When the list contains at least one tile, then ScaleFactor, Width, Height, RenderLayouts and LayoutName properties are ignored.
53
- attr_accessor :tiles
54
-
55
43
  # Attribute mapping from ruby-style variable name to JSON key.
56
44
  def self.attribute_map
57
45
  {
58
- :'scale_factor' => :'scaleFactor',
59
- :'width' => :'width',
60
- :'height' => :'height',
61
- :'render_layouts' => :'renderLayouts',
62
- :'layout_name' => :'layoutName',
63
- :'layers' => :'layers',
64
- :'tiles' => :'tiles'
46
+ :'scale_factor' => :'ScaleFactor',
47
+ :'width' => :'Width',
48
+ :'height' => :'Height'
65
49
  }
66
50
  end
67
51
 
@@ -70,11 +54,7 @@ module GroupDocsViewerCloud
70
54
  {
71
55
  :'scale_factor' => :'Float',
72
56
  :'width' => :'Integer',
73
- :'height' => :'Integer',
74
- :'render_layouts' => :'BOOLEAN',
75
- :'layout_name' => :'String',
76
- :'layers' => :'Array<String>',
77
- :'tiles' => :'Array<Tile>'
57
+ :'height' => :'Integer'
78
58
  }
79
59
  end
80
60
 
@@ -86,50 +66,45 @@ module GroupDocsViewerCloud
86
66
  # convert string to symbol for hash key
87
67
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
88
68
 
89
- if attributes.key?(:'scaleFactor')
90
- self.scale_factor = attributes[:'scaleFactor']
69
+ if attributes.key?(:'ScaleFactor')
70
+ self.scale_factor = attributes[:'ScaleFactor']
91
71
  end
92
72
 
93
- if attributes.key?(:'width')
94
- self.width = attributes[:'width']
73
+ if attributes.key?(:'Width')
74
+ self.width = attributes[:'Width']
95
75
  end
96
76
 
97
- if attributes.key?(:'height')
98
- self.height = attributes[:'height']
77
+ if attributes.key?(:'Height')
78
+ self.height = attributes[:'Height']
99
79
  end
100
80
 
101
- if attributes.key?(:'renderLayouts')
102
- self.render_layouts = attributes[:'renderLayouts']
103
- end
81
+ end
104
82
 
105
- if attributes.key?(:'layoutName')
106
- self.layout_name = attributes[:'layoutName']
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properies with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = []
87
+ if @scale_factor.nil?
88
+ invalid_properties.push("invalid value for 'scale_factor', scale_factor cannot be nil.")
107
89
  end
108
90
 
109
- if attributes.key?(:'layers')
110
- if (value = attributes[:'layers']).is_a?(Array)
111
- self.layers = value
112
- end
91
+ if @width.nil?
92
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
113
93
  end
114
94
 
115
- if attributes.key?(:'tiles')
116
- if (value = attributes[:'tiles']).is_a?(Array)
117
- self.tiles = value
118
- end
95
+ if @height.nil?
96
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
119
97
  end
120
98
 
121
- end
122
-
123
- # Show invalid properties with the reasons. Usually used together with valid?
124
- # @return Array for valid properies with the reasons
125
- def list_invalid_properties
126
- invalid_properties = []
127
99
  return invalid_properties
128
100
  end
129
101
 
130
102
  # Check to see if the all the properties in the model are valid
131
103
  # @return true if the model is valid
132
104
  def valid?
105
+ return false if @scale_factor.nil?
106
+ return false if @width.nil?
107
+ return false if @height.nil?
133
108
  return true
134
109
  end
135
110
 
@@ -140,11 +115,7 @@ module GroupDocsViewerCloud
140
115
  self.class == other.class &&
141
116
  scale_factor == other.scale_factor &&
142
117
  width == other.width &&
143
- height == other.height &&
144
- render_layouts == other.render_layouts &&
145
- layout_name == other.layout_name &&
146
- layers == other.layers &&
147
- tiles == other.tiles
118
+ height == other.height
148
119
  end
149
120
 
150
121
  # @see the `==` method
@@ -156,7 +127,13 @@ module GroupDocsViewerCloud
156
127
  # Calculates hash code according to all attributes.
157
128
  # @return [Fixnum] Hash code
158
129
  def hash
159
- [scale_factor, width, height, render_layouts, layout_name, layers, tiles].hash
130
+ [scale_factor, width, height].hash
131
+ end
132
+
133
+ # Downcases first letter.
134
+ # @return downcased string
135
+ def uncap(str)
136
+ str[0, 1].downcase + str[1..-1]
160
137
  end
161
138
 
162
139
  # Builds the object from hash
@@ -165,14 +142,16 @@ module GroupDocsViewerCloud
165
142
  def build_from_hash(attributes)
166
143
  return nil unless attributes.is_a?(Hash)
167
144
  self.class.swagger_types.each_pair do |key, type|
145
+ pname = uncap(self.class.attribute_map[key]).intern
146
+ value = attributes[pname]
168
147
  if type =~ /\AArray<(.*)>/i
169
148
  # check to ensure the input is an array given that the the attribute
170
- # is documented as an array but the input is not
171
- if attributes[self.class.attribute_map[key]].is_a?(Array)
172
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ # is documented as an array but the input is not
150
+ if value.is_a?(Array)
151
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
173
152
  end
174
- elsif !attributes[self.class.attribute_map[key]].nil?
175
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ elsif !value.nil?
154
+ self.send("#{key}=", _deserialize(type, value))
176
155
  end
177
156
  # or else data not found in attributes(hash), not an issue as the data can be optional
178
157
  end