=begin #convertapi #Convert API lets you effortlessly convert file formats and types. OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: unset =end require 'date' module CloudmersiveConvertApiClient # A table in a Word Document (DOCX) file class DocxTable # The ID of the table; leave blank for new tables attr_accessor :table_id # The Path of the location of this object; leave blank for new tables attr_accessor :path # The Width of the table, or 0 if not specified attr_accessor :width # The Width configuration type of the table attr_accessor :width_type # Rows in the table; this is where the contents is located attr_accessor :table_rows # Type for the top border - can be a Single, DashDotStroked, Dashed, DashSmallGap, DotDash, DotDotDash, Dotted, Double, DoubleWave, Inset, Nil, None, Outset, Thick, ThickThinLargeGap, ThickThinMediumGap, ThickThinSmallGap, ThinThickLargeGap, ThinThickMediumGap, ThinThickSmallGap, ThinThickThinLargeGap, ThinThickThinMediumGap, ThinThickThinSmallGap, ThreeDEmboss, ThreeDEngrave, Triple, Wave attr_accessor :top_border_type # Width of the border in points (1/72nd of an inch) attr_accessor :top_border_size # Spacing around the border in points (1/72nd of an inch) attr_accessor :top_border_space # HTML-style color hex value (do not include a #) attr_accessor :top_border_color # Type for the bottom border - can be a Single, DashDotStroked, Dashed, DashSmallGap, DotDash, DotDotDash, Dotted, Double, DoubleWave, Inset, Nil, None, Outset, Thick, ThickThinLargeGap, ThickThinMediumGap, ThickThinSmallGap, ThinThickLargeGap, ThinThickMediumGap, ThinThickSmallGap, ThinThickThinLargeGap, ThinThickThinMediumGap, ThinThickThinSmallGap, ThreeDEmboss, ThreeDEngrave, Triple, Wave attr_accessor :bottom_border_type # Width of the border in points (1/72nd of an inch) attr_accessor :bottom_border_size # Spacing around the border in points (1/72nd of an inch) attr_accessor :bottom_border_space # HTML-style color hex value (do not include a #) attr_accessor :bottom_border_color # Type for the left border - can be a Single, DashDotStroked, Dashed, DashSmallGap, DotDash, DotDotDash, Dotted, Double, DoubleWave, Inset, Nil, None, Outset, Thick, ThickThinLargeGap, ThickThinMediumGap, ThickThinSmallGap, ThinThickLargeGap, ThinThickMediumGap, ThinThickSmallGap, ThinThickThinLargeGap, ThinThickThinMediumGap, ThinThickThinSmallGap, ThreeDEmboss, ThreeDEngrave, Triple, Wave attr_accessor :left_border_type # Width of the border in points (1/72nd of an inch) attr_accessor :left_border_size # Spacing around the border in points (1/72nd of an inch) attr_accessor :left_border_space # HTML-style color hex value (do not include a #) attr_accessor :left_border_color # Type for the right border - can be a Single, DashDotStroked, Dashed, DashSmallGap, DotDash, DotDotDash, Dotted, Double, DoubleWave, Inset, Nil, None, Outset, Thick, ThickThinLargeGap, ThickThinMediumGap, ThickThinSmallGap, ThinThickLargeGap, ThinThickMediumGap, ThinThickSmallGap, ThinThickThinLargeGap, ThinThickThinMediumGap, ThinThickThinSmallGap, ThreeDEmboss, ThreeDEngrave, Triple, Wave attr_accessor :right_border_type # Width of the border in points (1/72nd of an inch) attr_accessor :right_border_size # Spacing around the border in points (1/72nd of an inch) attr_accessor :right_border_space # HTML-style color hex value (do not include a #) attr_accessor :right_border_color # Type for the cell horizontal border - can be a Single, DashDotStroked, Dashed, DashSmallGap, DotDash, DotDotDash, Dotted, Double, DoubleWave, Inset, Nil, None, Outset, Thick, ThickThinLargeGap, ThickThinMediumGap, ThickThinSmallGap, ThinThickLargeGap, ThinThickMediumGap, ThinThickSmallGap, ThinThickThinLargeGap, ThinThickThinMediumGap, ThinThickThinSmallGap, ThreeDEmboss, ThreeDEngrave, Triple, Wave attr_accessor :cell_horizontal_border_type # Width of the border in points (1/72nd of an inch) attr_accessor :cell_horizontal_border_size # Spacing around the border in points (1/72nd of an inch) attr_accessor :cell_horizontal_border_space # HTML-style color hex value (do not include a #) attr_accessor :cell_horizontal_border_color # Type for the cell vertical border - can be a Single, DashDotStroked, Dashed, DashSmallGap, DotDash, DotDotDash, Dotted, Double, DoubleWave, Inset, Nil, None, Outset, Thick, ThickThinLargeGap, ThickThinMediumGap, ThickThinSmallGap, ThinThickLargeGap, ThinThickMediumGap, ThinThickSmallGap, ThinThickThinLargeGap, ThinThickThinMediumGap, ThinThickThinSmallGap, ThreeDEmboss, ThreeDEngrave, Triple, Wave attr_accessor :cell_vertical_border_type # Width of the border in points (1/72nd of an inch) attr_accessor :cell_vertical_border_size # Spacing around the border in points (1/72nd of an inch) attr_accessor :cell_vertical_border_space # HTML-style color hex value (do not include a #) attr_accessor :cell_vertical_border_color # Type for the start border - can be a Single, DashDotStroked, Dashed, DashSmallGap, DotDash, DotDotDash, Dotted, Double, DoubleWave, Inset, Nil, None, Outset, Thick, ThickThinLargeGap, ThickThinMediumGap, ThickThinSmallGap, ThinThickLargeGap, ThinThickMediumGap, ThinThickSmallGap, ThinThickThinLargeGap, ThinThickThinMediumGap, ThinThickThinSmallGap, ThreeDEmboss, ThreeDEngrave, Triple, Wave attr_accessor :start_border_type # Width of the border in points (1/72nd of an inch) attr_accessor :start_border_size # Spacing around the border in points (1/72nd of an inch) attr_accessor :start_border_space # HTML-style color hex value (do not include a #) attr_accessor :start_border_color # Type for the end border - can be a Single, DashDotStroked, Dashed, DashSmallGap, DotDash, DotDotDash, Dotted, Double, DoubleWave, Inset, Nil, None, Outset, Thick, ThickThinLargeGap, ThickThinMediumGap, ThickThinSmallGap, ThinThickLargeGap, ThinThickMediumGap, ThinThickSmallGap, ThinThickThinLargeGap, ThinThickThinMediumGap, ThinThickThinSmallGap, ThreeDEmboss, ThreeDEngrave, Triple, Wave attr_accessor :end_border_type # Width of the border in points (1/72nd of an inch) attr_accessor :end_border_size # Spacing around the border in points (1/72nd of an inch) attr_accessor :end_border_space # HTML-style color hex value (do not include a #) attr_accessor :end_border_color # Table indentation type attr_accessor :table_indentation_mode # Table indentation width attr_accessor :table_indentation_width # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'table_id' => :'TableID', :'path' => :'Path', :'width' => :'Width', :'width_type' => :'WidthType', :'table_rows' => :'TableRows', :'top_border_type' => :'TopBorderType', :'top_border_size' => :'TopBorderSize', :'top_border_space' => :'TopBorderSpace', :'top_border_color' => :'TopBorderColor', :'bottom_border_type' => :'BottomBorderType', :'bottom_border_size' => :'BottomBorderSize', :'bottom_border_space' => :'BottomBorderSpace', :'bottom_border_color' => :'BottomBorderColor', :'left_border_type' => :'LeftBorderType', :'left_border_size' => :'LeftBorderSize', :'left_border_space' => :'LeftBorderSpace', :'left_border_color' => :'LeftBorderColor', :'right_border_type' => :'RightBorderType', :'right_border_size' => :'RightBorderSize', :'right_border_space' => :'RightBorderSpace', :'right_border_color' => :'RightBorderColor', :'cell_horizontal_border_type' => :'CellHorizontalBorderType', :'cell_horizontal_border_size' => :'CellHorizontalBorderSize', :'cell_horizontal_border_space' => :'CellHorizontalBorderSpace', :'cell_horizontal_border_color' => :'CellHorizontalBorderColor', :'cell_vertical_border_type' => :'CellVerticalBorderType', :'cell_vertical_border_size' => :'CellVerticalBorderSize', :'cell_vertical_border_space' => :'CellVerticalBorderSpace', :'cell_vertical_border_color' => :'CellVerticalBorderColor', :'start_border_type' => :'StartBorderType', :'start_border_size' => :'StartBorderSize', :'start_border_space' => :'StartBorderSpace', :'start_border_color' => :'StartBorderColor', :'end_border_type' => :'EndBorderType', :'end_border_size' => :'EndBorderSize', :'end_border_space' => :'EndBorderSpace', :'end_border_color' => :'EndBorderColor', :'table_indentation_mode' => :'TableIndentationMode', :'table_indentation_width' => :'TableIndentationWidth' } end # Attribute type mapping. def self.swagger_types { :'table_id' => :'String', :'path' => :'String', :'width' => :'String', :'width_type' => :'String', :'table_rows' => :'Array', :'top_border_type' => :'String', :'top_border_size' => :'Integer', :'top_border_space' => :'Integer', :'top_border_color' => :'String', :'bottom_border_type' => :'String', :'bottom_border_size' => :'Integer', :'bottom_border_space' => :'Integer', :'bottom_border_color' => :'String', :'left_border_type' => :'String', :'left_border_size' => :'Integer', :'left_border_space' => :'Integer', :'left_border_color' => :'String', :'right_border_type' => :'String', :'right_border_size' => :'Integer', :'right_border_space' => :'Integer', :'right_border_color' => :'String', :'cell_horizontal_border_type' => :'String', :'cell_horizontal_border_size' => :'Integer', :'cell_horizontal_border_space' => :'Integer', :'cell_horizontal_border_color' => :'String', :'cell_vertical_border_type' => :'String', :'cell_vertical_border_size' => :'Integer', :'cell_vertical_border_space' => :'Integer', :'cell_vertical_border_color' => :'String', :'start_border_type' => :'String', :'start_border_size' => :'Integer', :'start_border_space' => :'Integer', :'start_border_color' => :'String', :'end_border_type' => :'String', :'end_border_size' => :'Integer', :'end_border_space' => :'Integer', :'end_border_color' => :'String', :'table_indentation_mode' => :'String', :'table_indentation_width' => :'Integer' } end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash 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.has_key?(:'TableID') self.table_id = attributes[:'TableID'] end if attributes.has_key?(:'Path') self.path = attributes[:'Path'] end if attributes.has_key?(:'Width') self.width = attributes[:'Width'] end if attributes.has_key?(:'WidthType') self.width_type = attributes[:'WidthType'] end if attributes.has_key?(:'TableRows') if (value = attributes[:'TableRows']).is_a?(Array) self.table_rows = value end end if attributes.has_key?(:'TopBorderType') self.top_border_type = attributes[:'TopBorderType'] end if attributes.has_key?(:'TopBorderSize') self.top_border_size = attributes[:'TopBorderSize'] end if attributes.has_key?(:'TopBorderSpace') self.top_border_space = attributes[:'TopBorderSpace'] end if attributes.has_key?(:'TopBorderColor') self.top_border_color = attributes[:'TopBorderColor'] end if attributes.has_key?(:'BottomBorderType') self.bottom_border_type = attributes[:'BottomBorderType'] end if attributes.has_key?(:'BottomBorderSize') self.bottom_border_size = attributes[:'BottomBorderSize'] end if attributes.has_key?(:'BottomBorderSpace') self.bottom_border_space = attributes[:'BottomBorderSpace'] end if attributes.has_key?(:'BottomBorderColor') self.bottom_border_color = attributes[:'BottomBorderColor'] end if attributes.has_key?(:'LeftBorderType') self.left_border_type = attributes[:'LeftBorderType'] end if attributes.has_key?(:'LeftBorderSize') self.left_border_size = attributes[:'LeftBorderSize'] end if attributes.has_key?(:'LeftBorderSpace') self.left_border_space = attributes[:'LeftBorderSpace'] end if attributes.has_key?(:'LeftBorderColor') self.left_border_color = attributes[:'LeftBorderColor'] end if attributes.has_key?(:'RightBorderType') self.right_border_type = attributes[:'RightBorderType'] end if attributes.has_key?(:'RightBorderSize') self.right_border_size = attributes[:'RightBorderSize'] end if attributes.has_key?(:'RightBorderSpace') self.right_border_space = attributes[:'RightBorderSpace'] end if attributes.has_key?(:'RightBorderColor') self.right_border_color = attributes[:'RightBorderColor'] end if attributes.has_key?(:'CellHorizontalBorderType') self.cell_horizontal_border_type = attributes[:'CellHorizontalBorderType'] end if attributes.has_key?(:'CellHorizontalBorderSize') self.cell_horizontal_border_size = attributes[:'CellHorizontalBorderSize'] end if attributes.has_key?(:'CellHorizontalBorderSpace') self.cell_horizontal_border_space = attributes[:'CellHorizontalBorderSpace'] end if attributes.has_key?(:'CellHorizontalBorderColor') self.cell_horizontal_border_color = attributes[:'CellHorizontalBorderColor'] end if attributes.has_key?(:'CellVerticalBorderType') self.cell_vertical_border_type = attributes[:'CellVerticalBorderType'] end if attributes.has_key?(:'CellVerticalBorderSize') self.cell_vertical_border_size = attributes[:'CellVerticalBorderSize'] end if attributes.has_key?(:'CellVerticalBorderSpace') self.cell_vertical_border_space = attributes[:'CellVerticalBorderSpace'] end if attributes.has_key?(:'CellVerticalBorderColor') self.cell_vertical_border_color = attributes[:'CellVerticalBorderColor'] end if attributes.has_key?(:'StartBorderType') self.start_border_type = attributes[:'StartBorderType'] end if attributes.has_key?(:'StartBorderSize') self.start_border_size = attributes[:'StartBorderSize'] end if attributes.has_key?(:'StartBorderSpace') self.start_border_space = attributes[:'StartBorderSpace'] end if attributes.has_key?(:'StartBorderColor') self.start_border_color = attributes[:'StartBorderColor'] end if attributes.has_key?(:'EndBorderType') self.end_border_type = attributes[:'EndBorderType'] end if attributes.has_key?(:'EndBorderSize') self.end_border_size = attributes[:'EndBorderSize'] end if attributes.has_key?(:'EndBorderSpace') self.end_border_space = attributes[:'EndBorderSpace'] end if attributes.has_key?(:'EndBorderColor') self.end_border_color = attributes[:'EndBorderColor'] end if attributes.has_key?(:'TableIndentationMode') self.table_indentation_mode = attributes[:'TableIndentationMode'] end if attributes.has_key?(:'TableIndentationWidth') self.table_indentation_width = attributes[:'TableIndentationWidth'] end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new 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 true end # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && table_id == o.table_id && path == o.path && width == o.width && width_type == o.width_type && table_rows == o.table_rows && top_border_type == o.top_border_type && top_border_size == o.top_border_size && top_border_space == o.top_border_space && top_border_color == o.top_border_color && bottom_border_type == o.bottom_border_type && bottom_border_size == o.bottom_border_size && bottom_border_space == o.bottom_border_space && bottom_border_color == o.bottom_border_color && left_border_type == o.left_border_type && left_border_size == o.left_border_size && left_border_space == o.left_border_space && left_border_color == o.left_border_color && right_border_type == o.right_border_type && right_border_size == o.right_border_size && right_border_space == o.right_border_space && right_border_color == o.right_border_color && cell_horizontal_border_type == o.cell_horizontal_border_type && cell_horizontal_border_size == o.cell_horizontal_border_size && cell_horizontal_border_space == o.cell_horizontal_border_space && cell_horizontal_border_color == o.cell_horizontal_border_color && cell_vertical_border_type == o.cell_vertical_border_type && cell_vertical_border_size == o.cell_vertical_border_size && cell_vertical_border_space == o.cell_vertical_border_space && cell_vertical_border_color == o.cell_vertical_border_color && start_border_type == o.start_border_type && start_border_size == o.start_border_size && start_border_space == o.start_border_space && start_border_color == o.start_border_color && end_border_type == o.end_border_type && end_border_size == o.end_border_size && end_border_space == o.end_border_space && end_border_color == o.end_border_color && table_indentation_mode == o.table_indentation_mode && table_indentation_width == o.table_indentation_width end # @see the `==` method # @param [Object] Object to be compared def eql?(o) self == o end # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash [table_id, path, width, width_type, table_rows, top_border_type, top_border_size, top_border_space, top_border_color, bottom_border_type, bottom_border_size, bottom_border_space, bottom_border_color, left_border_type, left_border_size, left_border_space, left_border_color, right_border_type, right_border_size, right_border_space, right_border_color, cell_horizontal_border_type, cell_horizontal_border_size, cell_horizontal_border_space, cell_horizontal_border_color, cell_vertical_border_type, cell_vertical_border_size, cell_vertical_border_space, cell_vertical_border_color, start_border_type, start_border_size, start_border_space, start_border_color, end_border_type, end_border_size, end_border_space, end_border_color, table_indentation_mode, table_indentation_width].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| 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 attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym when :DateTime DateTime.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<(?.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?.+?), (?.+)>\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 = CloudmersiveConvertApiClient.const_get(type).new temp_model.build_from_hash(value) end end # Returns the string representation of the object # @return [String] String presentation of the object def to_s to_hash.to_s end # to_body is an alias to to_hash (backward compatibility) # @return [Hash] Returns the object in the form of hash def to_body to_hash end # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash 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 # Outputs non-array value in the form of hash # For object, use to_hash. Otherwise, just return the value # @param [Object] value Any valid value # @return [Hash] Returns the value in the form of hash 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 end end