class CrxPackageManager::Package
Attributes
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/crx_packmgr_api_client/models/package.rb, line 95 def self.attribute_map { :'pid' => :'pid', :'path' => :'path', :'name' => :'name', :'download_name' => :'downloadName', :'group' => :'group', :'group_title' => :'groupTitle', :'version' => :'version', :'description' => :'description', :'thumbnail' => :'thumbnail', :'build_count' => :'buildCount', :'last_modified' => :'lastModified', :'last_modified_by' => :'lastModifiedBy', :'created' => :'created', :'create_by' => :'createBy', :'last_unpacked' => :'lastUnpacked', :'last_unpacked_by' => :'lastUnpackedBy', :'last_wrapped' => :'lastWrapped', :'last_wrapped_by' => :'lastWrappedBy', :'last_unwrapped' => :'lastUnwrapped', :'last_unwrapped_by' => :'lastUnwrappedBy', :'size' => :'size', :'has_snapshot' => :'hasSnapshot', :'needs_rewrap' => :'needsRewrap', :'built_with' => :'builtWith', :'tested_with' => :'testedWith', :'fixed_bugs' => :'fixedBugs', :'requires_root' => :'requiresRoot', :'requires_restart' => :'requiresRestart', :'ac_handling' => :'acHandling', :'dependencies' => :'dependencies', :'resolved' => :'resolved', :'filter' => :'filter', :'screenshots' => :'screenshots' } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/crx_packmgr_api_client/models/package.rb, line 174 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?(:'pid') self.pid = attributes[:'pid'] end if attributes.has_key?(:'path') self.path = attributes[:'path'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'downloadName') self.download_name = attributes[:'downloadName'] end if attributes.has_key?(:'group') self.group = attributes[:'group'] end if attributes.has_key?(:'groupTitle') self.group_title = attributes[:'groupTitle'] end if attributes.has_key?(:'version') self.version = attributes[:'version'] end if attributes.has_key?(:'description') self.description = attributes[:'description'] end if attributes.has_key?(:'thumbnail') self.thumbnail = attributes[:'thumbnail'] end if attributes.has_key?(:'buildCount') self.build_count = attributes[:'buildCount'] end if attributes.has_key?(:'lastModified') self.last_modified = attributes[:'lastModified'] end if attributes.has_key?(:'lastModifiedBy') self.last_modified_by = attributes[:'lastModifiedBy'] end if attributes.has_key?(:'created') self.created = attributes[:'created'] end if attributes.has_key?(:'createBy') self.create_by = attributes[:'createBy'] end if attributes.has_key?(:'lastUnpacked') self.last_unpacked = attributes[:'lastUnpacked'] end if attributes.has_key?(:'lastUnpackedBy') self.last_unpacked_by = attributes[:'lastUnpackedBy'] end if attributes.has_key?(:'lastWrapped') self.last_wrapped = attributes[:'lastWrapped'] end if attributes.has_key?(:'lastWrappedBy') self.last_wrapped_by = attributes[:'lastWrappedBy'] end if attributes.has_key?(:'lastUnwrapped') self.last_unwrapped = attributes[:'lastUnwrapped'] end if attributes.has_key?(:'lastUnwrappedBy') self.last_unwrapped_by = attributes[:'lastUnwrappedBy'] end if attributes.has_key?(:'size') self.size = attributes[:'size'] end if attributes.has_key?(:'hasSnapshot') self.has_snapshot = attributes[:'hasSnapshot'] end if attributes.has_key?(:'needsRewrap') self.needs_rewrap = attributes[:'needsRewrap'] end if attributes.has_key?(:'builtWith') self.built_with = attributes[:'builtWith'] end if attributes.has_key?(:'testedWith') self.tested_with = attributes[:'testedWith'] end if attributes.has_key?(:'fixedBugs') self.fixed_bugs = attributes[:'fixedBugs'] end if attributes.has_key?(:'requiresRoot') self.requires_root = attributes[:'requiresRoot'] end if attributes.has_key?(:'requiresRestart') self.requires_restart = attributes[:'requiresRestart'] end if attributes.has_key?(:'acHandling') self.ac_handling = attributes[:'acHandling'] end if attributes.has_key?(:'dependencies') if (value = attributes[:'dependencies']).is_a?(Array) self.dependencies = value end end if attributes.has_key?(:'resolved') self.resolved = attributes[:'resolved'] end if attributes.has_key?(:'filter') if (value = attributes[:'filter']).is_a?(Array) self.filter = value end end if attributes.has_key?(:'screenshots') if (value = attributes[:'screenshots']).is_a?(Array) self.screenshots = value end end end
Attribute type mapping.
# File lib/crx_packmgr_api_client/models/package.rb, line 134 def self.swagger_types { :'pid' => :'String', :'path' => :'String', :'name' => :'String', :'download_name' => :'String', :'group' => :'String', :'group_title' => :'String', :'version' => :'String', :'description' => :'String', :'thumbnail' => :'String', :'build_count' => :'Integer', :'last_modified' => :'Integer', :'last_modified_by' => :'String', :'created' => :'Integer', :'create_by' => :'String', :'last_unpacked' => :'Integer', :'last_unpacked_by' => :'String', :'last_wrapped' => :'Integer', :'last_wrapped_by' => :'String', :'last_unwrapped' => :'Integer', :'last_unwrapped_by' => :'String', :'size' => :'Integer', :'has_snapshot' => :'BOOLEAN', :'needs_rewrap' => :'BOOLEAN', :'built_with' => :'String', :'tested_with' => :'String', :'fixed_bugs' => :'String', :'requires_root' => :'BOOLEAN', :'requires_restart' => :'BOOLEAN', :'ac_handling' => :'String', :'dependencies' => :'Array<String>', :'resolved' => :'BOOLEAN', :'filter' => :'Array<Filter>', :'screenshots' => :'Array<String>' } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object to be compared
# File lib/crx_packmgr_api_client/models/package.rb, line 334 def ==(o) return true if self.equal?(o) self.class == o.class && pid == o.pid && path == o.path && name == o.name && download_name == o.download_name && group == o.group && group_title == o.group_title && version == o.version && description == o.description && thumbnail == o.thumbnail && build_count == o.build_count && last_modified == o.last_modified && last_modified_by == o.last_modified_by && created == o.created && create_by == o.create_by && last_unpacked == o.last_unpacked && last_unpacked_by == o.last_unpacked_by && last_wrapped == o.last_wrapped && last_wrapped_by == o.last_wrapped_by && last_unwrapped == o.last_unwrapped && last_unwrapped_by == o.last_unwrapped_by && size == o.size && has_snapshot == o.has_snapshot && needs_rewrap == o.needs_rewrap && built_with == o.built_with && tested_with == o.tested_with && fixed_bugs == o.fixed_bugs && requires_root == o.requires_root && requires_restart == o.requires_restart && ac_handling == o.ac_handling && dependencies == o.dependencies && resolved == o.resolved && filter == o.filter && screenshots == o.screenshots end
Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data
# File lib/crx_packmgr_api_client/models/package.rb, line 408 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<(?<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 = CrxPackageManager.const_get(type).new temp_model.build_from_hash(value) end 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
# File lib/crx_packmgr_api_client/models/package.rb, line 474 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
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/crx_packmgr_api_client/models/package.rb, line 387 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
@see the `==` method @param [Object] Object to be compared
# File lib/crx_packmgr_api_client/models/package.rb, line 374 def eql?(o) self == o end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/crx_packmgr_api_client/models/package.rb, line 380 def hash [pid, path, name, download_name, group, group_title, version, description, thumbnail, build_count, last_modified, last_modified_by, created, create_by, last_unpacked, last_unpacked_by, last_wrapped, last_wrapped_by, last_unwrapped, last_unwrapped_by, size, has_snapshot, needs_rewrap, built_with, tested_with, fixed_bugs, requires_root, requires_restart, ac_handling, dependencies, resolved, filter, screenshots].hash end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
# File lib/crx_packmgr_api_client/models/package.rb, line 321 def list_invalid_properties invalid_properties = Array.new invalid_properties end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/crx_packmgr_api_client/models/package.rb, line 460 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
Returns the string representation of the object @return [String] String presentation of the object
# File lib/crx_packmgr_api_client/models/package.rb, line 448 def to_s to_hash.to_s end
Check to see if the all the properties in the model are valid @return true if the model is valid
# File lib/crx_packmgr_api_client/models/package.rb, line 328 def valid? true end