aspose_imaging_cloud 20.4 → 20.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +15 -8
- data/lib/aspose-imaging-cloud.rb +22 -27
- data/lib/aspose-imaging-cloud/api/imaging_api.rb +55 -15
- data/lib/aspose-imaging-cloud/api_client.rb +1 -1
- data/lib/aspose-imaging-cloud/models/available_labels_list.rb +204 -0
- data/lib/aspose-imaging-cloud/models/detected_object.rb +228 -0
- data/lib/aspose-imaging-cloud/models/detected_object_list.rb +204 -0
- data/lib/aspose-imaging-cloud/models/dicom_properties.rb +4 -64
- data/lib/aspose-imaging-cloud/models/eps_properties.rb +241 -0
- data/lib/aspose-imaging-cloud/models/imaging_response.rb +11 -1
- data/lib/aspose-imaging-cloud/models/rectangle.rb +247 -0
- data/lib/aspose-imaging-cloud/models/requests/{save_image_as_request.rb → convert_image_request.rb} +7 -7
- data/lib/aspose-imaging-cloud/models/requests/{create_saved_image_as_request.rb → create_converted_image_request.rb} +7 -7
- data/lib/aspose-imaging-cloud/models/requests/create_fax_tiff_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_image_frame_range_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_object_bounds_request.rb +99 -0
- data/lib/aspose-imaging-cloud/models/requests/create_visual_object_bounds_request.rb +102 -0
- data/lib/aspose-imaging-cloud/models/requests/get_available_labels_request.rb +74 -0
- data/lib/aspose-imaging-cloud/models/requests/get_object_bounds_request.rb +98 -0
- data/lib/aspose-imaging-cloud/models/requests/get_visual_object_bounds_request.rb +101 -0
- metadata +15 -5
| @@ -0,0 +1,228 @@ | |
| 1 | 
            +
            #  ----------------------------------------------------------------------------
         | 
| 2 | 
            +
            #  <copyright company="Aspose" file="detected_object.rb">
         | 
| 3 | 
            +
            #    Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
         | 
| 4 | 
            +
            #  </copyright>
         | 
| 5 | 
            +
            #  <summary>
         | 
| 6 | 
            +
            #    Permission is hereby granted, free of charge, to any person obtaining a
         | 
| 7 | 
            +
            #   copy  of this software and associated documentation files (the "Software"),
         | 
| 8 | 
            +
            #   to deal  in the Software without restriction, including without limitation
         | 
| 9 | 
            +
            #   the rights  to use, copy, modify, merge, publish, distribute, sublicense,
         | 
| 10 | 
            +
            #   and/or sell  copies of the Software, and to permit persons to whom the
         | 
| 11 | 
            +
            #   Software is  furnished to do so, subject to the following conditions:
         | 
| 12 | 
            +
            #
         | 
| 13 | 
            +
            #   The above copyright notice and this permission notice shall be included in
         | 
| 14 | 
            +
            #   all  copies or substantial portions of the Software.
         | 
| 15 | 
            +
            #
         | 
| 16 | 
            +
            #   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         | 
| 17 | 
            +
            #   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         | 
| 18 | 
            +
            #   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         | 
| 19 | 
            +
            #   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         | 
| 20 | 
            +
            #   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
         | 
| 21 | 
            +
            #   FROM,  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
         | 
| 22 | 
            +
            #   DEALINGS IN THE SOFTWARE.
         | 
| 23 | 
            +
            #  </summary>
         | 
| 24 | 
            +
            #  ----------------------------------------------------------------------------
         | 
| 25 | 
            +
             | 
| 26 | 
            +
             | 
| 27 | 
            +
            require 'date'
         | 
| 28 | 
            +
             | 
| 29 | 
            +
            module AsposeImagingCloud
         | 
| 30 | 
            +
              class DetectedObject
         | 
| 31 | 
            +
                attr_accessor :label
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                attr_accessor :score
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                attr_accessor :bounds
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                # Attribute mapping from ruby-style variable name to JSON key.
         | 
| 38 | 
            +
                def self.attribute_map
         | 
| 39 | 
            +
                  {
         | 
| 40 | 
            +
                    :'label' => :'Label',
         | 
| 41 | 
            +
                    :'score' => :'Score',
         | 
| 42 | 
            +
                    :'bounds' => :'Bounds'
         | 
| 43 | 
            +
                  }
         | 
| 44 | 
            +
                end
         | 
| 45 | 
            +
             | 
| 46 | 
            +
                # Attribute type mapping.
         | 
| 47 | 
            +
                def self.swagger_types
         | 
| 48 | 
            +
                  {
         | 
| 49 | 
            +
                    :'label' => :'String',
         | 
| 50 | 
            +
                    :'score' => :'Float',
         | 
| 51 | 
            +
                    :'bounds' => :'Rectangle'
         | 
| 52 | 
            +
                  }
         | 
| 53 | 
            +
                end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
                # Initializes the object
         | 
| 56 | 
            +
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 57 | 
            +
                def initialize(attributes = {})
         | 
| 58 | 
            +
                  return unless attributes.is_a?(Hash)
         | 
| 59 | 
            +
             | 
| 60 | 
            +
                  # convert string to symbol for hash key
         | 
| 61 | 
            +
                  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
         | 
| 62 | 
            +
             | 
| 63 | 
            +
                  if attributes.has_key?(:'Label')
         | 
| 64 | 
            +
                    self.label = attributes[:'Label']
         | 
| 65 | 
            +
                  end
         | 
| 66 | 
            +
             | 
| 67 | 
            +
                  if attributes.has_key?(:'Score')
         | 
| 68 | 
            +
                    self.score = attributes[:'Score']
         | 
| 69 | 
            +
                  end
         | 
| 70 | 
            +
             | 
| 71 | 
            +
                  if attributes.has_key?(:'Bounds')
         | 
| 72 | 
            +
                    self.bounds = attributes[:'Bounds']
         | 
| 73 | 
            +
                  end
         | 
| 74 | 
            +
                end
         | 
| 75 | 
            +
             | 
| 76 | 
            +
                # Show invalid properties with the reasons. Usually used together with valid?
         | 
| 77 | 
            +
                # @return Array for valid properties with the reasons
         | 
| 78 | 
            +
                def list_invalid_properties
         | 
| 79 | 
            +
                  invalid_properties = Array.new
         | 
| 80 | 
            +
                  if @score.nil?
         | 
| 81 | 
            +
                    invalid_properties.push('invalid value for "score", score cannot be nil.')
         | 
| 82 | 
            +
                  end
         | 
| 83 | 
            +
             | 
| 84 | 
            +
                  if @bounds.nil?
         | 
| 85 | 
            +
                    invalid_properties.push('invalid value for "bounds", bounds cannot be nil.')
         | 
| 86 | 
            +
                  end
         | 
| 87 | 
            +
             | 
| 88 | 
            +
                  invalid_properties
         | 
| 89 | 
            +
                end
         | 
| 90 | 
            +
             | 
| 91 | 
            +
                # Check to see if the all the properties in the model are valid
         | 
| 92 | 
            +
                # @return true if the model is valid
         | 
| 93 | 
            +
                def valid?
         | 
| 94 | 
            +
                  return false if @score.nil?
         | 
| 95 | 
            +
                  return false if @bounds.nil?
         | 
| 96 | 
            +
                  true
         | 
| 97 | 
            +
                end
         | 
| 98 | 
            +
             | 
| 99 | 
            +
                # Checks equality by comparing each attribute.
         | 
| 100 | 
            +
                # @param [Object] Object to be compared
         | 
| 101 | 
            +
                def ==(o)
         | 
| 102 | 
            +
                  return true if self.equal?(o)
         | 
| 103 | 
            +
                  self.class == o.class &&
         | 
| 104 | 
            +
                      label == o.label &&
         | 
| 105 | 
            +
                      score == o.score &&
         | 
| 106 | 
            +
                      bounds == o.bounds
         | 
| 107 | 
            +
                end
         | 
| 108 | 
            +
             | 
| 109 | 
            +
                # @see the `==` method
         | 
| 110 | 
            +
                # @param [Object] Object to be compared
         | 
| 111 | 
            +
                def eql?(o)
         | 
| 112 | 
            +
                  self == o
         | 
| 113 | 
            +
                end
         | 
| 114 | 
            +
             | 
| 115 | 
            +
                # Calculates hash code according to all attributes.
         | 
| 116 | 
            +
                # @return [Fixnum] Hash code
         | 
| 117 | 
            +
                def hash
         | 
| 118 | 
            +
                  [label, score, bounds].hash
         | 
| 119 | 
            +
                end
         | 
| 120 | 
            +
             | 
| 121 | 
            +
                # Builds the object from hash
         | 
| 122 | 
            +
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 123 | 
            +
                # @return [Object] Returns the model itself
         | 
| 124 | 
            +
                def build_from_hash(attributes)
         | 
| 125 | 
            +
                  return nil unless attributes.is_a?(Hash)
         | 
| 126 | 
            +
                  self.class.swagger_types.each_pair do |key, type|
         | 
| 127 | 
            +
                    attribute_key = self.class.attribute_map[key]
         | 
| 128 | 
            +
                    attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
         | 
| 129 | 
            +
                    if type =~ /\AArray<(.*)>/i
         | 
| 130 | 
            +
                      # check to ensure the input is an array given that the the attribute
         | 
| 131 | 
            +
                      # is documented as an array but the input is not
         | 
| 132 | 
            +
                      if attributes[attribute_key].is_a?(Array)
         | 
| 133 | 
            +
                        self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
         | 
| 134 | 
            +
                      end
         | 
| 135 | 
            +
                    elsif !attributes[attribute_key].nil?
         | 
| 136 | 
            +
                      self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
         | 
| 137 | 
            +
                    end # or else data not found in attributes(hash), not an issue as the data can be optional
         | 
| 138 | 
            +
                  end
         | 
| 139 | 
            +
             | 
| 140 | 
            +
                  self
         | 
| 141 | 
            +
                end
         | 
| 142 | 
            +
             | 
| 143 | 
            +
                # Deserializes the data based on type
         | 
| 144 | 
            +
                # @param string type Data type
         | 
| 145 | 
            +
                # @param string value Value to be deserialized
         | 
| 146 | 
            +
                # @return [Object] Deserialized data
         | 
| 147 | 
            +
                def _deserialize(type, value)
         | 
| 148 | 
            +
                  case type.to_sym
         | 
| 149 | 
            +
                  when :DateTime
         | 
| 150 | 
            +
                    DateTime.parse(value)
         | 
| 151 | 
            +
                  when :Date
         | 
| 152 | 
            +
                    Date.parse(value)
         | 
| 153 | 
            +
                  when :String
         | 
| 154 | 
            +
                    value.to_s
         | 
| 155 | 
            +
                  when :Integer
         | 
| 156 | 
            +
                    value.to_i
         | 
| 157 | 
            +
                  when :Float
         | 
| 158 | 
            +
                    value.to_f
         | 
| 159 | 
            +
                  when :BOOLEAN
         | 
| 160 | 
            +
                    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
         | 
| 161 | 
            +
                      true
         | 
| 162 | 
            +
                    else
         | 
| 163 | 
            +
                      false
         | 
| 164 | 
            +
                    end
         | 
| 165 | 
            +
                  when :Object
         | 
| 166 | 
            +
                    # generic object (usually a Hash), return directly
         | 
| 167 | 
            +
                    value
         | 
| 168 | 
            +
                  when /\AArray<(?<inner_type>.+)>\z/
         | 
| 169 | 
            +
                    inner_type = Regexp.last_match[:inner_type]
         | 
| 170 | 
            +
                    value.map { |v| _deserialize(inner_type, v) }
         | 
| 171 | 
            +
                  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
         | 
| 172 | 
            +
                    k_type = Regexp.last_match[:k_type]
         | 
| 173 | 
            +
                    v_type = Regexp.last_match[:v_type]
         | 
| 174 | 
            +
                    {}.tap do |hash|
         | 
| 175 | 
            +
                      value.each do |k, v|
         | 
| 176 | 
            +
                        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
         | 
| 177 | 
            +
                      end
         | 
| 178 | 
            +
                    end
         | 
| 179 | 
            +
                  else # model
         | 
| 180 | 
            +
                    temp_model = AsposeImagingCloud.const_get(type).new
         | 
| 181 | 
            +
                    temp_model.build_from_hash(value)
         | 
| 182 | 
            +
                  end
         | 
| 183 | 
            +
                end
         | 
| 184 | 
            +
             | 
| 185 | 
            +
                # Returns the string representation of the object
         | 
| 186 | 
            +
                # @return [String] String presentation of the object
         | 
| 187 | 
            +
                def to_s
         | 
| 188 | 
            +
                  to_hash.to_s
         | 
| 189 | 
            +
                end
         | 
| 190 | 
            +
             | 
| 191 | 
            +
                # to_body is an alias to to_hash (backward compatibility)
         | 
| 192 | 
            +
                # @return [Hash] Returns the object in the form of hash
         | 
| 193 | 
            +
                def to_body
         | 
| 194 | 
            +
                  to_hash
         | 
| 195 | 
            +
                end
         | 
| 196 | 
            +
             | 
| 197 | 
            +
                # Returns the object in the form of hash
         | 
| 198 | 
            +
                # @return [Hash] Returns the object in the form of hash
         | 
| 199 | 
            +
                def to_hash
         | 
| 200 | 
            +
                  hash = {}
         | 
| 201 | 
            +
                  self.class.attribute_map.each_pair do |attr, param|
         | 
| 202 | 
            +
                    value = self.send(attr)
         | 
| 203 | 
            +
                    next if value.nil?
         | 
| 204 | 
            +
                    hash[param] = _to_hash(value)
         | 
| 205 | 
            +
                  end
         | 
| 206 | 
            +
                  hash
         | 
| 207 | 
            +
                end
         | 
| 208 | 
            +
             | 
| 209 | 
            +
                # Outputs non-array value in the form of hash
         | 
| 210 | 
            +
                # For object, use to_hash. Otherwise, just return the value
         | 
| 211 | 
            +
                # @param [Object] value Any valid value
         | 
| 212 | 
            +
                # @return [Hash] Returns the value in the form of hash
         | 
| 213 | 
            +
                def _to_hash(value)
         | 
| 214 | 
            +
                  if value.is_a?(Array)
         | 
| 215 | 
            +
                    value.compact.map { |v| _to_hash(v) }
         | 
| 216 | 
            +
                  elsif value.is_a?(Hash)
         | 
| 217 | 
            +
                    {}.tap do |hash|
         | 
| 218 | 
            +
                      value.each { |k, v| hash[k] = _to_hash(v) }
         | 
| 219 | 
            +
                    end
         | 
| 220 | 
            +
                  elsif value.respond_to? :to_hash
         | 
| 221 | 
            +
                    value.to_hash
         | 
| 222 | 
            +
                  else
         | 
| 223 | 
            +
                    value
         | 
| 224 | 
            +
                  end
         | 
| 225 | 
            +
                end
         | 
| 226 | 
            +
             | 
| 227 | 
            +
              end
         | 
| 228 | 
            +
            end
         | 
| @@ -0,0 +1,204 @@ | |
| 1 | 
            +
            #  ----------------------------------------------------------------------------
         | 
| 2 | 
            +
            #  <copyright company="Aspose" file="detected_object_list.rb">
         | 
| 3 | 
            +
            #    Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
         | 
| 4 | 
            +
            #  </copyright>
         | 
| 5 | 
            +
            #  <summary>
         | 
| 6 | 
            +
            #    Permission is hereby granted, free of charge, to any person obtaining a
         | 
| 7 | 
            +
            #   copy  of this software and associated documentation files (the "Software"),
         | 
| 8 | 
            +
            #   to deal  in the Software without restriction, including without limitation
         | 
| 9 | 
            +
            #   the rights  to use, copy, modify, merge, publish, distribute, sublicense,
         | 
| 10 | 
            +
            #   and/or sell  copies of the Software, and to permit persons to whom the
         | 
| 11 | 
            +
            #   Software is  furnished to do so, subject to the following conditions:
         | 
| 12 | 
            +
            #
         | 
| 13 | 
            +
            #   The above copyright notice and this permission notice shall be included in
         | 
| 14 | 
            +
            #   all  copies or substantial portions of the Software.
         | 
| 15 | 
            +
            #
         | 
| 16 | 
            +
            #   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         | 
| 17 | 
            +
            #   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         | 
| 18 | 
            +
            #   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         | 
| 19 | 
            +
            #   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         | 
| 20 | 
            +
            #   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
         | 
| 21 | 
            +
            #   FROM,  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
         | 
| 22 | 
            +
            #   DEALINGS IN THE SOFTWARE.
         | 
| 23 | 
            +
            #  </summary>
         | 
| 24 | 
            +
            #  ----------------------------------------------------------------------------
         | 
| 25 | 
            +
             | 
| 26 | 
            +
             | 
| 27 | 
            +
            require 'date'
         | 
| 28 | 
            +
             | 
| 29 | 
            +
            module AsposeImagingCloud
         | 
| 30 | 
            +
              # Wrapper for detected objects array
         | 
| 31 | 
            +
              class DetectedObjectList
         | 
| 32 | 
            +
                # detected objects
         | 
| 33 | 
            +
                attr_accessor :detected_objects
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                # Attribute mapping from ruby-style variable name to JSON key.
         | 
| 36 | 
            +
                def self.attribute_map
         | 
| 37 | 
            +
                  {
         | 
| 38 | 
            +
                    :'detected_objects' => :'detectedObjects'
         | 
| 39 | 
            +
                  }
         | 
| 40 | 
            +
                end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                # Attribute type mapping.
         | 
| 43 | 
            +
                def self.swagger_types
         | 
| 44 | 
            +
                  {
         | 
| 45 | 
            +
                    :'detected_objects' => :'Array<DetectedObject>'
         | 
| 46 | 
            +
                  }
         | 
| 47 | 
            +
                end
         | 
| 48 | 
            +
             | 
| 49 | 
            +
                # Initializes the object
         | 
| 50 | 
            +
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 51 | 
            +
                def initialize(attributes = {})
         | 
| 52 | 
            +
                  return unless attributes.is_a?(Hash)
         | 
| 53 | 
            +
             | 
| 54 | 
            +
                  # convert string to symbol for hash key
         | 
| 55 | 
            +
                  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
         | 
| 56 | 
            +
             | 
| 57 | 
            +
                  if attributes.has_key?(:'detectedObjects')
         | 
| 58 | 
            +
                    if (value = attributes[:'detectedObjects']).is_a?(Array)
         | 
| 59 | 
            +
                      self.detected_objects = value
         | 
| 60 | 
            +
                    end
         | 
| 61 | 
            +
                  end
         | 
| 62 | 
            +
                end
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                # Show invalid properties with the reasons. Usually used together with valid?
         | 
| 65 | 
            +
                # @return Array for valid properties with the reasons
         | 
| 66 | 
            +
                def list_invalid_properties
         | 
| 67 | 
            +
                  invalid_properties = Array.new
         | 
| 68 | 
            +
                  invalid_properties
         | 
| 69 | 
            +
                end
         | 
| 70 | 
            +
             | 
| 71 | 
            +
                # Check to see if the all the properties in the model are valid
         | 
| 72 | 
            +
                # @return true if the model is valid
         | 
| 73 | 
            +
                def valid?
         | 
| 74 | 
            +
                  true
         | 
| 75 | 
            +
                end
         | 
| 76 | 
            +
             | 
| 77 | 
            +
                # Checks equality by comparing each attribute.
         | 
| 78 | 
            +
                # @param [Object] Object to be compared
         | 
| 79 | 
            +
                def ==(o)
         | 
| 80 | 
            +
                  return true if self.equal?(o)
         | 
| 81 | 
            +
                  self.class == o.class &&
         | 
| 82 | 
            +
                      detected_objects == o.detected_objects
         | 
| 83 | 
            +
                end
         | 
| 84 | 
            +
             | 
| 85 | 
            +
                # @see the `==` method
         | 
| 86 | 
            +
                # @param [Object] Object to be compared
         | 
| 87 | 
            +
                def eql?(o)
         | 
| 88 | 
            +
                  self == o
         | 
| 89 | 
            +
                end
         | 
| 90 | 
            +
             | 
| 91 | 
            +
                # Calculates hash code according to all attributes.
         | 
| 92 | 
            +
                # @return [Fixnum] Hash code
         | 
| 93 | 
            +
                def hash
         | 
| 94 | 
            +
                  [detected_objects].hash
         | 
| 95 | 
            +
                end
         | 
| 96 | 
            +
             | 
| 97 | 
            +
                # Builds the object from hash
         | 
| 98 | 
            +
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 99 | 
            +
                # @return [Object] Returns the model itself
         | 
| 100 | 
            +
                def build_from_hash(attributes)
         | 
| 101 | 
            +
                  return nil unless attributes.is_a?(Hash)
         | 
| 102 | 
            +
                  self.class.swagger_types.each_pair do |key, type|
         | 
| 103 | 
            +
                    attribute_key = self.class.attribute_map[key]
         | 
| 104 | 
            +
                    attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
         | 
| 105 | 
            +
                    if type =~ /\AArray<(.*)>/i
         | 
| 106 | 
            +
                      # check to ensure the input is an array given that the the attribute
         | 
| 107 | 
            +
                      # is documented as an array but the input is not
         | 
| 108 | 
            +
                      if attributes[attribute_key].is_a?(Array)
         | 
| 109 | 
            +
                        self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
         | 
| 110 | 
            +
                      end
         | 
| 111 | 
            +
                    elsif !attributes[attribute_key].nil?
         | 
| 112 | 
            +
                      self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
         | 
| 113 | 
            +
                    end # or else data not found in attributes(hash), not an issue as the data can be optional
         | 
| 114 | 
            +
                  end
         | 
| 115 | 
            +
             | 
| 116 | 
            +
                  self
         | 
| 117 | 
            +
                end
         | 
| 118 | 
            +
             | 
| 119 | 
            +
                # Deserializes the data based on type
         | 
| 120 | 
            +
                # @param string type Data type
         | 
| 121 | 
            +
                # @param string value Value to be deserialized
         | 
| 122 | 
            +
                # @return [Object] Deserialized data
         | 
| 123 | 
            +
                def _deserialize(type, value)
         | 
| 124 | 
            +
                  case type.to_sym
         | 
| 125 | 
            +
                  when :DateTime
         | 
| 126 | 
            +
                    DateTime.parse(value)
         | 
| 127 | 
            +
                  when :Date
         | 
| 128 | 
            +
                    Date.parse(value)
         | 
| 129 | 
            +
                  when :String
         | 
| 130 | 
            +
                    value.to_s
         | 
| 131 | 
            +
                  when :Integer
         | 
| 132 | 
            +
                    value.to_i
         | 
| 133 | 
            +
                  when :Float
         | 
| 134 | 
            +
                    value.to_f
         | 
| 135 | 
            +
                  when :BOOLEAN
         | 
| 136 | 
            +
                    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
         | 
| 137 | 
            +
                      true
         | 
| 138 | 
            +
                    else
         | 
| 139 | 
            +
                      false
         | 
| 140 | 
            +
                    end
         | 
| 141 | 
            +
                  when :Object
         | 
| 142 | 
            +
                    # generic object (usually a Hash), return directly
         | 
| 143 | 
            +
                    value
         | 
| 144 | 
            +
                  when /\AArray<(?<inner_type>.+)>\z/
         | 
| 145 | 
            +
                    inner_type = Regexp.last_match[:inner_type]
         | 
| 146 | 
            +
                    value.map { |v| _deserialize(inner_type, v) }
         | 
| 147 | 
            +
                  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
         | 
| 148 | 
            +
                    k_type = Regexp.last_match[:k_type]
         | 
| 149 | 
            +
                    v_type = Regexp.last_match[:v_type]
         | 
| 150 | 
            +
                    {}.tap do |hash|
         | 
| 151 | 
            +
                      value.each do |k, v|
         | 
| 152 | 
            +
                        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
         | 
| 153 | 
            +
                      end
         | 
| 154 | 
            +
                    end
         | 
| 155 | 
            +
                  else # model
         | 
| 156 | 
            +
                    temp_model = AsposeImagingCloud.const_get(type).new
         | 
| 157 | 
            +
                    temp_model.build_from_hash(value)
         | 
| 158 | 
            +
                  end
         | 
| 159 | 
            +
                end
         | 
| 160 | 
            +
             | 
| 161 | 
            +
                # Returns the string representation of the object
         | 
| 162 | 
            +
                # @return [String] String presentation of the object
         | 
| 163 | 
            +
                def to_s
         | 
| 164 | 
            +
                  to_hash.to_s
         | 
| 165 | 
            +
                end
         | 
| 166 | 
            +
             | 
| 167 | 
            +
                # to_body is an alias to to_hash (backward compatibility)
         | 
| 168 | 
            +
                # @return [Hash] Returns the object in the form of hash
         | 
| 169 | 
            +
                def to_body
         | 
| 170 | 
            +
                  to_hash
         | 
| 171 | 
            +
                end
         | 
| 172 | 
            +
             | 
| 173 | 
            +
                # Returns the object in the form of hash
         | 
| 174 | 
            +
                # @return [Hash] Returns the object in the form of hash
         | 
| 175 | 
            +
                def to_hash
         | 
| 176 | 
            +
                  hash = {}
         | 
| 177 | 
            +
                  self.class.attribute_map.each_pair do |attr, param|
         | 
| 178 | 
            +
                    value = self.send(attr)
         | 
| 179 | 
            +
                    next if value.nil?
         | 
| 180 | 
            +
                    hash[param] = _to_hash(value)
         | 
| 181 | 
            +
                  end
         | 
| 182 | 
            +
                  hash
         | 
| 183 | 
            +
                end
         | 
| 184 | 
            +
             | 
| 185 | 
            +
                # Outputs non-array value in the form of hash
         | 
| 186 | 
            +
                # For object, use to_hash. Otherwise, just return the value
         | 
| 187 | 
            +
                # @param [Object] value Any valid value
         | 
| 188 | 
            +
                # @return [Hash] Returns the value in the form of hash
         | 
| 189 | 
            +
                def _to_hash(value)
         | 
| 190 | 
            +
                  if value.is_a?(Array)
         | 
| 191 | 
            +
                    value.compact.map { |v| _to_hash(v) }
         | 
| 192 | 
            +
                  elsif value.is_a?(Hash)
         | 
| 193 | 
            +
                    {}.tap do |hash|
         | 
| 194 | 
            +
                      value.each { |k, v| hash[k] = _to_hash(v) }
         | 
| 195 | 
            +
                    end
         | 
| 196 | 
            +
                  elsif value.respond_to? :to_hash
         | 
| 197 | 
            +
                    value.to_hash
         | 
| 198 | 
            +
                  else
         | 
| 199 | 
            +
                    value
         | 
| 200 | 
            +
                  end
         | 
| 201 | 
            +
                end
         | 
| 202 | 
            +
             | 
| 203 | 
            +
              end
         | 
| 204 | 
            +
            end
         | 
| @@ -59,12 +59,6 @@ module AsposeImagingCloud | |
| 59 59 | 
             
                # Gets or sets the photo interpretation.
         | 
| 60 60 | 
             
                attr_accessor :photo_interpretation
         | 
| 61 61 |  | 
| 62 | 
            -
                # Gets or sets a value indicating whether width tag found.
         | 
| 63 | 
            -
                attr_accessor :width_tag_found
         | 
| 64 | 
            -
             | 
| 65 | 
            -
                # Gets or sets a value indicating whether height tag found.
         | 
| 66 | 
            -
                attr_accessor :height_tag_found
         | 
| 67 | 
            -
             | 
| 68 62 | 
             
                # Gets or sets the width.
         | 
| 69 63 | 
             
                attr_accessor :width
         | 
| 70 64 |  | 
| @@ -89,18 +83,12 @@ module AsposeImagingCloud | |
| 89 83 | 
             
                # Gets or sets the number of frames.
         | 
| 90 84 | 
             
                attr_accessor :number_of_frames
         | 
| 91 85 |  | 
| 92 | 
            -
                # Gets or sets the length of element.
         | 
| 93 | 
            -
                attr_accessor :length_value
         | 
| 94 | 
            -
             | 
| 95 86 | 
             
                # Indicates if DICOM image has little endian byte order.
         | 
| 96 87 | 
             
                attr_accessor :is_little_endian
         | 
| 97 88 |  | 
| 98 89 | 
             
                # Gets or sets the offset.
         | 
| 99 90 | 
             
                attr_accessor :offset
         | 
| 100 91 |  | 
| 101 | 
            -
                # Gets or sets a value indicating whether \"DICOM\" data is found.
         | 
| 102 | 
            -
                attr_accessor :dicom_found
         | 
| 103 | 
            -
             | 
| 104 92 | 
             
                # Attribute mapping from ruby-style variable name to JSON key.
         | 
| 105 93 | 
             
                def self.attribute_map
         | 
| 106 94 | 
             
                  {
         | 
| @@ -114,8 +102,6 @@ module AsposeImagingCloud | |
| 114 102 | 
             
                    :'samples_per_pixel' => :'SamplesPerPixel',
         | 
| 115 103 | 
             
                    :'bits_allocated' => :'BitsAllocated',
         | 
| 116 104 | 
             
                    :'photo_interpretation' => :'PhotoInterpretation',
         | 
| 117 | 
            -
                    :'width_tag_found' => :'WidthTagFound',
         | 
| 118 | 
            -
                    :'height_tag_found' => :'HeightTagFound',
         | 
| 119 105 | 
             
                    :'width' => :'Width',
         | 
| 120 106 | 
             
                    :'height' => :'Height',
         | 
| 121 107 | 
             
                    :'window_centre' => :'WindowCentre',
         | 
| @@ -124,10 +110,8 @@ module AsposeImagingCloud | |
| 124 110 | 
             
                    :'rescale_intercept' => :'RescaleIntercept',
         | 
| 125 111 | 
             
                    :'rescale_slope' => :'RescaleSlope',
         | 
| 126 112 | 
             
                    :'number_of_frames' => :'NumberOfFrames',
         | 
| 127 | 
            -
                    :'length_value' => :'LengthValue',
         | 
| 128 113 | 
             
                    :'is_little_endian' => :'IsLittleEndian',
         | 
| 129 | 
            -
                    :'offset' => :'Offset' | 
| 130 | 
            -
                    :'dicom_found' => :'DicomFound'
         | 
| 114 | 
            +
                    :'offset' => :'Offset'
         | 
| 131 115 | 
             
                  }
         | 
| 132 116 | 
             
                end
         | 
| 133 117 |  | 
| @@ -144,8 +128,6 @@ module AsposeImagingCloud | |
| 144 128 | 
             
                    :'samples_per_pixel' => :'Integer',
         | 
| 145 129 | 
             
                    :'bits_allocated' => :'Integer',
         | 
| 146 130 | 
             
                    :'photo_interpretation' => :'String',
         | 
| 147 | 
            -
                    :'width_tag_found' => :'BOOLEAN',
         | 
| 148 | 
            -
                    :'height_tag_found' => :'BOOLEAN',
         | 
| 149 131 | 
             
                    :'width' => :'Integer',
         | 
| 150 132 | 
             
                    :'height' => :'Integer',
         | 
| 151 133 | 
             
                    :'window_centre' => :'Float',
         | 
| @@ -154,10 +136,8 @@ module AsposeImagingCloud | |
| 154 136 | 
             
                    :'rescale_intercept' => :'Float',
         | 
| 155 137 | 
             
                    :'rescale_slope' => :'Float',
         | 
| 156 138 | 
             
                    :'number_of_frames' => :'Integer',
         | 
| 157 | 
            -
                    :'length_value' => :'Integer',
         | 
| 158 139 | 
             
                    :'is_little_endian' => :'BOOLEAN',
         | 
| 159 | 
            -
                    :'offset' => :'Integer' | 
| 160 | 
            -
                    :'dicom_found' => :'BOOLEAN'
         | 
| 140 | 
            +
                    :'offset' => :'Integer'
         | 
| 161 141 | 
             
                  }
         | 
| 162 142 | 
             
                end
         | 
| 163 143 |  | 
| @@ -211,14 +191,6 @@ module AsposeImagingCloud | |
| 211 191 | 
             
                    self.photo_interpretation = attributes[:'PhotoInterpretation']
         | 
| 212 192 | 
             
                  end
         | 
| 213 193 |  | 
| 214 | 
            -
                  if attributes.has_key?(:'WidthTagFound')
         | 
| 215 | 
            -
                    self.width_tag_found = attributes[:'WidthTagFound']
         | 
| 216 | 
            -
                  end
         | 
| 217 | 
            -
             | 
| 218 | 
            -
                  if attributes.has_key?(:'HeightTagFound')
         | 
| 219 | 
            -
                    self.height_tag_found = attributes[:'HeightTagFound']
         | 
| 220 | 
            -
                  end
         | 
| 221 | 
            -
             | 
| 222 194 | 
             
                  if attributes.has_key?(:'Width')
         | 
| 223 195 | 
             
                    self.width = attributes[:'Width']
         | 
| 224 196 | 
             
                  end
         | 
| @@ -251,10 +223,6 @@ module AsposeImagingCloud | |
| 251 223 | 
             
                    self.number_of_frames = attributes[:'NumberOfFrames']
         | 
| 252 224 | 
             
                  end
         | 
| 253 225 |  | 
| 254 | 
            -
                  if attributes.has_key?(:'LengthValue')
         | 
| 255 | 
            -
                    self.length_value = attributes[:'LengthValue']
         | 
| 256 | 
            -
                  end
         | 
| 257 | 
            -
             | 
| 258 226 | 
             
                  if attributes.has_key?(:'IsLittleEndian')
         | 
| 259 227 | 
             
                    self.is_little_endian = attributes[:'IsLittleEndian']
         | 
| 260 228 | 
             
                  end
         | 
| @@ -262,10 +230,6 @@ module AsposeImagingCloud | |
| 262 230 | 
             
                  if attributes.has_key?(:'Offset')
         | 
| 263 231 | 
             
                    self.offset = attributes[:'Offset']
         | 
| 264 232 | 
             
                  end
         | 
| 265 | 
            -
             | 
| 266 | 
            -
                  if attributes.has_key?(:'DicomFound')
         | 
| 267 | 
            -
                    self.dicom_found = attributes[:'DicomFound']
         | 
| 268 | 
            -
                  end
         | 
| 269 233 | 
             
                end
         | 
| 270 234 |  | 
| 271 235 | 
             
                # Show invalid properties with the reasons. Usually used together with valid?
         | 
| @@ -304,14 +268,6 @@ module AsposeImagingCloud | |
| 304 268 | 
             
                    invalid_properties.push('invalid value for "bits_allocated", bits_allocated cannot be nil.')
         | 
| 305 269 | 
             
                  end
         | 
| 306 270 |  | 
| 307 | 
            -
                  if @width_tag_found.nil?
         | 
| 308 | 
            -
                    invalid_properties.push('invalid value for "width_tag_found", width_tag_found cannot be nil.')
         | 
| 309 | 
            -
                  end
         | 
| 310 | 
            -
             | 
| 311 | 
            -
                  if @height_tag_found.nil?
         | 
| 312 | 
            -
                    invalid_properties.push('invalid value for "height_tag_found", height_tag_found cannot be nil.')
         | 
| 313 | 
            -
                  end
         | 
| 314 | 
            -
             | 
| 315 271 | 
             
                  if @width.nil?
         | 
| 316 272 | 
             
                    invalid_properties.push('invalid value for "width", width cannot be nil.')
         | 
| 317 273 | 
             
                  end
         | 
| @@ -344,10 +300,6 @@ module AsposeImagingCloud | |
| 344 300 | 
             
                    invalid_properties.push('invalid value for "number_of_frames", number_of_frames cannot be nil.')
         | 
| 345 301 | 
             
                  end
         | 
| 346 302 |  | 
| 347 | 
            -
                  if @length_value.nil?
         | 
| 348 | 
            -
                    invalid_properties.push('invalid value for "length_value", length_value cannot be nil.')
         | 
| 349 | 
            -
                  end
         | 
| 350 | 
            -
             | 
| 351 303 | 
             
                  if @is_little_endian.nil?
         | 
| 352 304 | 
             
                    invalid_properties.push('invalid value for "is_little_endian", is_little_endian cannot be nil.')
         | 
| 353 305 | 
             
                  end
         | 
| @@ -356,10 +308,6 @@ module AsposeImagingCloud | |
| 356 308 | 
             
                    invalid_properties.push('invalid value for "offset", offset cannot be nil.')
         | 
| 357 309 | 
             
                  end
         | 
| 358 310 |  | 
| 359 | 
            -
                  if @dicom_found.nil?
         | 
| 360 | 
            -
                    invalid_properties.push('invalid value for "dicom_found", dicom_found cannot be nil.')
         | 
| 361 | 
            -
                  end
         | 
| 362 | 
            -
             | 
| 363 311 | 
             
                  invalid_properties
         | 
| 364 312 | 
             
                end
         | 
| 365 313 |  | 
| @@ -374,8 +322,6 @@ module AsposeImagingCloud | |
| 374 322 | 
             
                  return false if @signed_image.nil?
         | 
| 375 323 | 
             
                  return false if @samples_per_pixel.nil?
         | 
| 376 324 | 
             
                  return false if @bits_allocated.nil?
         | 
| 377 | 
            -
                  return false if @width_tag_found.nil?
         | 
| 378 | 
            -
                  return false if @height_tag_found.nil?
         | 
| 379 325 | 
             
                  return false if @width.nil?
         | 
| 380 326 | 
             
                  return false if @height.nil?
         | 
| 381 327 | 
             
                  return false if @window_centre.nil?
         | 
| @@ -384,10 +330,8 @@ module AsposeImagingCloud | |
| 384 330 | 
             
                  return false if @rescale_intercept.nil?
         | 
| 385 331 | 
             
                  return false if @rescale_slope.nil?
         | 
| 386 332 | 
             
                  return false if @number_of_frames.nil?
         | 
| 387 | 
            -
                  return false if @length_value.nil?
         | 
| 388 333 | 
             
                  return false if @is_little_endian.nil?
         | 
| 389 334 | 
             
                  return false if @offset.nil?
         | 
| 390 | 
            -
                  return false if @dicom_found.nil?
         | 
| 391 335 | 
             
                  true
         | 
| 392 336 | 
             
                end
         | 
| 393 337 |  | 
| @@ -446,8 +390,6 @@ module AsposeImagingCloud | |
| 446 390 | 
             
                      samples_per_pixel == o.samples_per_pixel &&
         | 
| 447 391 | 
             
                      bits_allocated == o.bits_allocated &&
         | 
| 448 392 | 
             
                      photo_interpretation == o.photo_interpretation &&
         | 
| 449 | 
            -
                      width_tag_found == o.width_tag_found &&
         | 
| 450 | 
            -
                      height_tag_found == o.height_tag_found &&
         | 
| 451 393 | 
             
                      width == o.width &&
         | 
| 452 394 | 
             
                      height == o.height &&
         | 
| 453 395 | 
             
                      window_centre == o.window_centre &&
         | 
| @@ -456,10 +398,8 @@ module AsposeImagingCloud | |
| 456 398 | 
             
                      rescale_intercept == o.rescale_intercept &&
         | 
| 457 399 | 
             
                      rescale_slope == o.rescale_slope &&
         | 
| 458 400 | 
             
                      number_of_frames == o.number_of_frames &&
         | 
| 459 | 
            -
                      length_value == o.length_value &&
         | 
| 460 401 | 
             
                      is_little_endian == o.is_little_endian &&
         | 
| 461 | 
            -
                      offset == o.offset | 
| 462 | 
            -
                      dicom_found == o.dicom_found
         | 
| 402 | 
            +
                      offset == o.offset
         | 
| 463 403 | 
             
                end
         | 
| 464 404 |  | 
| 465 405 | 
             
                # @see the `==` method
         | 
| @@ -471,7 +411,7 @@ module AsposeImagingCloud | |
| 471 411 | 
             
                # Calculates hash code according to all attributes.
         | 
| 472 412 | 
             
                # @return [Fixnum] Hash code
         | 
| 473 413 | 
             
                def hash
         | 
| 474 | 
            -
                  [planar_configuration, reds, greens, blues, dicom_header_info_by_bytes, signed_image, dicom_info, samples_per_pixel, bits_allocated, photo_interpretation,  | 
| 414 | 
            +
                  [planar_configuration, reds, greens, blues, dicom_header_info_by_bytes, signed_image, dicom_info, samples_per_pixel, bits_allocated, photo_interpretation, width, height, window_centre, window_width, pixel_representation, rescale_intercept, rescale_slope, number_of_frames, is_little_endian, offset].hash
         | 
| 475 415 | 
             
                end
         | 
| 476 416 |  | 
| 477 417 | 
             
                # Builds the object from hash
         |