Class: GroupDocsMergerCloud::MixPagesOptions
- Inherits:
-
Object
- Object
- GroupDocsMergerCloud::MixPagesOptions
- Defined in:
- lib/groupdocs_merger_cloud/models/mix_pages_options.rb
Overview
Defines options for documents JoinPages method
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#files ⇒ Object
Source documents for JoinPages operation.
-
#files_pages ⇒ Object
Page numbers for document indicies in Files collection.
-
#image_join_mode ⇒ Object
Possible modes for the image joining.
-
#output_path ⇒ Object
The output path.
-
#word_join_compliance ⇒ Object
Compliance mode for the Word Ooxml format.
-
#word_join_mode ⇒ Object
Allows to join word documents without empty space between documents.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ MixPagesOptions
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#uncap(str) ⇒ Object
Downcases first letter.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ MixPagesOptions
Initializes the object
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 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 99 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.key?(:'Files') if (value = attributes[:'Files']).is_a?(Array) self.files = value end end if attributes.key?(:'FilesPages') if (value = attributes[:'FilesPages']).is_a?(Array) self.files_pages = value end end if attributes.key?(:'OutputPath') self.output_path = attributes[:'OutputPath'] end if attributes.key?(:'WordJoinMode') self.word_join_mode = attributes[:'WordJoinMode'] end if attributes.key?(:'WordJoinCompliance') self.word_join_compliance = attributes[:'WordJoinCompliance'] end if attributes.key?(:'ImageJoinMode') self.image_join_mode = attributes[:'ImageJoinMode'] end end |
Instance Attribute Details
#files ⇒ Object
Source documents for JoinPages operation
35 36 37 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 35 def files @files end |
#files_pages ⇒ Object
Page numbers for document indicies in Files collection.
38 39 40 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 38 def files_pages @files_pages end |
#image_join_mode ⇒ Object
Possible modes for the image joining.
50 51 52 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 50 def image_join_mode @image_join_mode end |
#output_path ⇒ Object
The output path
41 42 43 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 41 def output_path @output_path end |
#word_join_compliance ⇒ Object
Compliance mode for the Word Ooxml format
47 48 49 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 47 def word_join_compliance @word_join_compliance end |
#word_join_mode ⇒ Object
Allows to join word documents without empty space between documents.
44 45 46 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 44 def word_join_mode @word_join_mode end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
74 75 76 77 78 79 80 81 82 83 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 74 def self.attribute_map { :'files' => :'Files', :'files_pages' => :'FilesPages', :'output_path' => :'OutputPath', :'word_join_mode' => :'WordJoinMode', :'word_join_compliance' => :'WordJoinCompliance', :'image_join_mode' => :'ImageJoinMode' } end |
.swagger_types ⇒ Object
Attribute type mapping.
86 87 88 89 90 91 92 93 94 95 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 86 def self.swagger_types { :'files' => :'Array<FileInfo>', :'files_pages' => :'Array<MixPagesItem>', :'output_path' => :'String', :'word_join_mode' => :'String', :'word_join_compliance' => :'String', :'image_join_mode' => :'String' } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
213 214 215 216 217 218 219 220 221 222 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 213 def ==(other) return true if self.equal?(other) self.class == other.class && files == other.files && files_pages == other.files_pages && output_path == other.output_path && word_join_mode == other.word_join_mode && word_join_compliance == other.word_join_compliance && image_join_mode == other.image_join_mode end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 269 def _deserialize(type, value) case type.to_sym when :DateTime Date.parse value when :Date Date.parse value when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = GroupDocsMergerCloud.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 336 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 245 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| pname = uncap(self.class.attribute_map[key]).intern value = attributes[pname] if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if value.is_a?(Array) self.send("#{key}=", value.map { |v| _deserialize($1, v) }) end elsif !value.nil? self.send("#{key}=", _deserialize(type, value)) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
226 227 228 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 226 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
232 233 234 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 232 def hash [files, files_pages, output_path, word_join_mode, word_join_compliance, image_join_mode].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 137 def list_invalid_properties invalid_properties = [] if @word_join_mode.nil? invalid_properties.push("invalid value for 'word_join_mode', word_join_mode cannot be nil.") end if @word_join_compliance.nil? invalid_properties.push("invalid value for 'word_join_compliance', word_join_compliance cannot be nil.") end if @image_join_mode.nil? invalid_properties.push("invalid value for 'image_join_mode', image_join_mode cannot be nil.") end return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
316 317 318 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 316 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
322 323 324 325 326 327 328 329 330 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 322 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
310 311 312 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 310 def to_s to_hash.to_s end |
#uncap(str) ⇒ Object
Downcases first letter.
238 239 240 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 238 def uncap(str) str[0, 1].downcase + str[1..-1] end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/groupdocs_merger_cloud/models/mix_pages_options.rb', line 156 def valid? return false if @word_join_mode.nil? word_join_mode_validator = EnumAttributeValidator.new('String', ["Default", "Continuous"]) return false unless word_join_mode_validator.valid?(@word_join_mode) return false if @word_join_compliance.nil? word_join_compliance_validator = EnumAttributeValidator.new('String', ["Ecma376_2006", "Iso29500_2008_Transitional", "Iso29500_2008_Strict", "Auto"]) return false unless word_join_compliance_validator.valid?(@word_join_compliance) return false if @image_join_mode.nil? image_join_mode_validator = EnumAttributeValidator.new('String', ["Horizontal", "Vertical"]) return false unless image_join_mode_validator.valid?(@image_join_mode) return true end |