Skip to content

Commit 4b14924

Browse files
committed
Updated sources
1 parent c68c127 commit 4b14924

16 files changed

+1446
-291
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
groupdocs_conversion_cloud (24.3)
4+
groupdocs_conversion_cloud (24.4)
55
addressable (~> 2.8.0, >= 2.8.0)
66
faraday (~> 0.14.0)
77

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ gem install groupdocs_conversion_cloud
1212
To add dependency to your app copy following into your Gemfile and run `bundle install`:
1313

1414
```
15-
gem "groupdocs_conversion_cloud", "~> 24.3"
15+
gem "groupdocs_conversion_cloud", "~> 24.4"
1616
```
1717

1818
## Getting Started

lib/groupdocs_conversion_cloud.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
require_relative 'groupdocs_conversion_cloud/models/xml_load_options'
7777
require_relative 'groupdocs_conversion_cloud/models/bmp_convert_options'
7878
require_relative 'groupdocs_conversion_cloud/models/bmp_load_options'
79+
require_relative 'groupdocs_conversion_cloud/models/cf2_load_options'
7980
require_relative 'groupdocs_conversion_cloud/models/csv_load_options'
8081
require_relative 'groupdocs_conversion_cloud/models/dcm_convert_options'
8182
require_relative 'groupdocs_conversion_cloud/models/dcm_load_options'
@@ -96,7 +97,9 @@
9697
require_relative 'groupdocs_conversion_cloud/models/dotx_convert_options'
9798
require_relative 'groupdocs_conversion_cloud/models/dotx_load_options'
9899
require_relative 'groupdocs_conversion_cloud/models/dwf_load_options'
100+
require_relative 'groupdocs_conversion_cloud/models/dwfx_load_options'
99101
require_relative 'groupdocs_conversion_cloud/models/dwg_load_options'
102+
require_relative 'groupdocs_conversion_cloud/models/dwt_load_options'
100103
require_relative 'groupdocs_conversion_cloud/models/dxf_load_options'
101104
require_relative 'groupdocs_conversion_cloud/models/emf_convert_options'
102105
require_relative 'groupdocs_conversion_cloud/models/emf_load_options'

lib/groupdocs_conversion_cloud/models/cad_load_options.rb

Lines changed: 64 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,53 @@ class CadLoadOptions
3434
# The format of input file, (\"docx\", for example). This field must be filled with correct input file format when using ConvertDirect method, which accept input file as binary stream, and, because of that, API can correctly handle LoadOptions. In regular conversion, the input file format taken from the input file name and this field ignored.
3535
attr_accessor :format
3636

37-
# Set desired page width for converting CAD document
38-
attr_accessor :width
39-
40-
# Set desired page height for converting CAD document
41-
attr_accessor :height
42-
4337
# Render specific CAD layouts
4438
attr_accessor :layout_names
4539

40+
# Gets or sets a background color.
41+
attr_accessor :background_color
42+
43+
# Gets or sets type of drawing.
44+
attr_accessor :draw_type
45+
class EnumAttributeValidator
46+
attr_reader :datatype
47+
attr_reader :allowable_values
48+
49+
def initialize(datatype, allowable_values)
50+
@allowable_values = allowable_values.map do |value|
51+
case datatype.to_s
52+
when /Integer/i
53+
value.to_i
54+
when /Float/i
55+
value.to_f
56+
else
57+
value
58+
end
59+
end
60+
end
61+
62+
def valid?(value)
63+
!value || allowable_values.include?(value)
64+
end
65+
end
66+
4667
# Attribute mapping from ruby-style variable name to JSON key.
4768
def self.attribute_map
4869
{
4970
:'format' => :'Format',
50-
:'width' => :'Width',
51-
:'height' => :'Height',
52-
:'layout_names' => :'LayoutNames'
71+
:'layout_names' => :'LayoutNames',
72+
:'background_color' => :'BackgroundColor',
73+
:'draw_type' => :'DrawType'
5374
}
5475
end
5576

5677
# Attribute type mapping.
5778
def self.swagger_types
5879
{
5980
:'format' => :'String',
60-
:'width' => :'Integer',
61-
:'height' => :'Integer',
62-
:'layout_names' => :'Array<String>'
81+
:'layout_names' => :'Array<String>',
82+
:'background_color' => :'String',
83+
:'draw_type' => :'String'
6384
}
6485
end
6586

@@ -75,32 +96,28 @@ def initialize(attributes = {})
7596
self.format = attributes[:'Format']
7697
end
7798

78-
if attributes.key?(:'Width')
79-
self.width = attributes[:'Width']
80-
end
81-
82-
if attributes.key?(:'Height')
83-
self.height = attributes[:'Height']
84-
end
85-
8699
if attributes.key?(:'LayoutNames')
87100
if (value = attributes[:'LayoutNames']).is_a?(Array)
88101
self.layout_names = value
89102
end
90103
end
91104

105+
if attributes.key?(:'BackgroundColor')
106+
self.background_color = attributes[:'BackgroundColor']
107+
end
108+
109+
if attributes.key?(:'DrawType')
110+
self.draw_type = attributes[:'DrawType']
111+
end
112+
92113
end
93114

94115
# Show invalid properties with the reasons. Usually used together with valid?
95116
# @return Array for valid properies with the reasons
96117
def list_invalid_properties
97118
invalid_properties = []
98-
if @width.nil?
99-
invalid_properties.push("invalid value for 'width', width cannot be nil.")
100-
end
101-
102-
if @height.nil?
103-
invalid_properties.push("invalid value for 'height', height cannot be nil.")
119+
if @draw_type.nil?
120+
invalid_properties.push("invalid value for 'draw_type', draw_type cannot be nil.")
104121
end
105122

106123
return invalid_properties
@@ -109,20 +126,35 @@ def list_invalid_properties
109126
# Check to see if the all the properties in the model are valid
110127
# @return true if the model is valid
111128
def valid?
112-
return false if @width.nil?
113-
return false if @height.nil?
129+
return false if @draw_type.nil?
130+
draw_type_validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
131+
return false unless draw_type_validator.valid?(@draw_type)
114132
return true
115133
end
116134

135+
# Custom attribute writer method checking allowed values (enum).
136+
# @param [Object] draw_type Object to be assigned
137+
def draw_type=(draw_type)
138+
validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
139+
if draw_type.to_i == 0
140+
unless validator.valid?(draw_type)
141+
raise ArgumentError, "invalid value for 'draw_type', must be one of #{validator.allowable_values}."
142+
end
143+
@draw_type = draw_type
144+
else
145+
@draw_type = validator.allowable_values[draw_type.to_i]
146+
end
147+
end
148+
117149
# Checks equality by comparing each attribute.
118150
# @param [Object] Object to be compared
119151
def ==(other)
120152
return true if self.equal?(other)
121153
self.class == other.class &&
122154
format == other.format &&
123-
width == other.width &&
124-
height == other.height &&
125-
layout_names == other.layout_names
155+
layout_names == other.layout_names &&
156+
background_color == other.background_color &&
157+
draw_type == other.draw_type
126158
end
127159

128160
# @see the `==` method
@@ -134,7 +166,7 @@ def eql?(other)
134166
# Calculates hash code according to all attributes.
135167
# @return [Fixnum] Hash code
136168
def hash
137-
[format, width, height, layout_names].hash
169+
[format, layout_names, background_color, draw_type].hash
138170
end
139171

140172
# Downcases first letter.

0 commit comments

Comments
 (0)