Skip to content

Commit

Permalink
Updated sources
Browse files Browse the repository at this point in the history
  • Loading branch information
product-team committed Nov 7, 2024
1 parent dd353f0 commit 0cfa4ea
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
groupdocs_conversion_cloud (24.8)
groupdocs_conversion_cloud (24.11)
addressable (~> 2.8.0, >= 2.8.0)
faraday (~> 0.14.0)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gem install groupdocs_conversion_cloud
To add dependency to your app copy following into your Gemfile and run `bundle install`:

```
gem "groupdocs_conversion_cloud", "~> 24.8"
gem "groupdocs_conversion_cloud", "~> 24.11"
```

## Getting Started
Expand Down
85 changes: 81 additions & 4 deletions lib/groupdocs_conversion_cloud/models/web_load_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,55 @@ class WebLoadOptions
# Enable or disable generation of page numbering in converted document. Default: false
attr_accessor :page_numbering

# Get or sets the encoding to be used when loading the web document. If the property is null the encoding will be determined from document character set attribute
attr_accessor :encoding

# Use pdf for the conversion. Default: false
attr_accessor :use_pdf

# Controls how HTML content is rendered. Default: AbsolutePositioning
attr_accessor :rendering_mode
class EnumAttributeValidator
attr_reader :datatype
attr_reader :allowable_values

def initialize(datatype, allowable_values)
@allowable_values = allowable_values.map do |value|
case datatype.to_s
when /Integer/i
value.to_i
when /Float/i
value.to_f
else
value
end
end
end

def valid?(value)
!value || allowable_values.include?(value)
end
end

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'format' => :'Format',
:'page_numbering' => :'PageNumbering'
:'page_numbering' => :'PageNumbering',
:'encoding' => :'Encoding',
:'use_pdf' => :'UsePdf',
:'rendering_mode' => :'RenderingMode'
}
end

# Attribute type mapping.
def self.swagger_types
{
:'format' => :'String',
:'page_numbering' => :'BOOLEAN'
:'page_numbering' => :'BOOLEAN',
:'encoding' => :'String',
:'use_pdf' => :'BOOLEAN',
:'rendering_mode' => :'String'
}
end

Expand All @@ -69,6 +105,18 @@ def initialize(attributes = {})
self.page_numbering = attributes[:'PageNumbering']
end

if attributes.key?(:'Encoding')
self.encoding = attributes[:'Encoding']
end

if attributes.key?(:'UsePdf')
self.use_pdf = attributes[:'UsePdf']
end

if attributes.key?(:'RenderingMode')
self.rendering_mode = attributes[:'RenderingMode']
end

end

# Show invalid properties with the reasons. Usually used together with valid?
Expand All @@ -79,23 +127,52 @@ def list_invalid_properties
invalid_properties.push("invalid value for 'page_numbering', page_numbering cannot be nil.")
end

if @use_pdf.nil?
invalid_properties.push("invalid value for 'use_pdf', use_pdf cannot be nil.")
end

if @rendering_mode.nil?
invalid_properties.push("invalid value for 'rendering_mode', rendering_mode cannot be nil.")
end

return invalid_properties
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
return false if @page_numbering.nil?
return false if @use_pdf.nil?
return false if @rendering_mode.nil?
rendering_mode_validator = EnumAttributeValidator.new('String', ["Flow", "AbsolutePositioning"])
return false unless rendering_mode_validator.valid?(@rendering_mode)
return true
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] rendering_mode Object to be assigned
def rendering_mode=(rendering_mode)
validator = EnumAttributeValidator.new('String', ["Flow", "AbsolutePositioning"])
if rendering_mode.to_i == 0
unless validator.valid?(rendering_mode)
raise ArgumentError, "invalid value for 'rendering_mode', must be one of #{validator.allowable_values}."
end
@rendering_mode = rendering_mode
else
@rendering_mode = validator.allowable_values[rendering_mode.to_i]
end
end

# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(other)
return true if self.equal?(other)
self.class == other.class &&
format == other.format &&
page_numbering == other.page_numbering
page_numbering == other.page_numbering &&
encoding == other.encoding &&
use_pdf == other.use_pdf &&
rendering_mode == other.rendering_mode
end

# @see the `==` method
Expand All @@ -107,7 +184,7 @@ def eql?(other)
# Calculates hash code according to all attributes.
# @return [Fixnum] Hash code
def hash
[format, page_numbering].hash
[format, page_numbering, encoding, use_pdf, rendering_mode].hash
end

# Downcases first letter.
Expand Down
2 changes: 1 addition & 1 deletion lib/groupdocs_conversion_cloud/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
# --------------------------------------------------------------------------------------------------------------------
#
module GroupDocsConversionCloud
VERSION = "24.8".freeze
VERSION = "24.11".freeze
end

0 comments on commit 0cfa4ea

Please sign in to comment.