=begin
#Pulp 3 API
#Fetch, Upload, Organize, and Distribute Software Packages
The version of the OpenAPI document: v3
Contact: pulp-list@redhat.com
Generated by: https://openapi-generator.tech
Generator version: 7.10.0
=endrequire'date'require'time'modulePulpPythonClient# Base serializer for use with [pulpcore.app.models.Model][] This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.classRepositoryVersionResponseattr_accessor:pulp_href# The Pulp Resource Name (PRN).attr_accessor:prn# Timestamp of creation.attr_accessor:pulp_created# Timestamp of the last time this resource was updated. Note: for immutable resources - like content, repository versions, and publication - pulp_created and pulp_last_updated dates will be the same.attr_accessor:pulp_last_updatedattr_accessor:numberattr_accessor:repository# A repository version whose content was used as the initial set of content for this repository versionattr_accessor:base_version# Various count summaries of the content in the version and the HREF to view them.attr_accessor:content_summaryattr_accessor:vuln_report# Attribute mapping from ruby-style variable name to JSON key.defself.attribute_map{:'pulp_href'=>:'pulp_href',:'prn'=>:'prn',:'pulp_created'=>:'pulp_created',:'pulp_last_updated'=>:'pulp_last_updated',:'number'=>:'number',:'repository'=>:'repository',:'base_version'=>:'base_version',:'content_summary'=>:'content_summary',:'vuln_report'=>:'vuln_report'}end# Returns all the JSON keys this model knows aboutdefself.acceptable_attributesattribute_map.valuesend# Attribute type mapping.defself.openapi_types{:'pulp_href'=>:'String',:'prn'=>:'String',:'pulp_created'=>:'Time',:'pulp_last_updated'=>:'Time',:'number'=>:'Integer',:'repository'=>:'String',:'base_version'=>:'String',:'content_summary'=>:'ContentSummaryResponse',:'vuln_report'=>:'String'}end# List of attributes with nullable: truedefself.openapi_nullableSet.new([])end# Initializes the object# @param [Hash] attributes Model attributes in the form of hashdefinitialize(attributes={})if(!attributes.is_a?(Hash))failArgumentError,"The input argument (attributes) must be a hash in `PulpPythonClient::RepositoryVersionResponse` initialize method"end# check to see if the attribute exists and convert string to symbol for hash keyattributes=attributes.each_with_object({}){|(k,v),h|if(!self.class.attribute_map.key?(k.to_sym))failArgumentError,"`#{k}` is not a valid attribute in `PulpPythonClient::RepositoryVersionResponse`. Please check the name to make sure it's valid. List of attributes: "+self.class.attribute_map.keys.inspectendh[k.to_sym]=v}ifattributes.key?(:'pulp_href')self.pulp_href=attributes[:'pulp_href']endifattributes.key?(:'prn')self.prn=attributes[:'prn']endifattributes.key?(:'pulp_created')self.pulp_created=attributes[:'pulp_created']endifattributes.key?(:'pulp_last_updated')self.pulp_last_updated=attributes[:'pulp_last_updated']endifattributes.key?(:'number')self.number=attributes[:'number']endifattributes.key?(:'repository')self.repository=attributes[:'repository']endifattributes.key?(:'base_version')self.base_version=attributes[:'base_version']endifattributes.key?(:'content_summary')self.content_summary=attributes[:'content_summary']endifattributes.key?(:'vuln_report')self.vuln_report=attributes[:'vuln_report']endend# Show invalid properties with the reasons. Usually used together with valid?# @return Array for valid properties with the reasonsdeflist_invalid_propertieswarn'[DEPRECATED] the `list_invalid_properties` method is obsolete'invalid_properties=Array.newinvalid_propertiesend# Check to see if the all the properties in the model are valid# @return true if the model is validdefvalid?warn'[DEPRECATED] the `valid?` method is obsolete'trueend# Checks equality by comparing each attribute.# @param [Object] Object to be compareddef==(o)returntrueifself.equal?(o)self.class==o.class&&pulp_href==o.pulp_href&&prn==o.prn&&pulp_created==o.pulp_created&&pulp_last_updated==o.pulp_last_updated&&number==o.number&&repository==o.repository&&base_version==o.base_version&&content_summary==o.content_summary&&vuln_report==o.vuln_reportend# @see the `==` method# @param [Object] Object to be compareddefeql?(o)self==oend# Calculates hash code according to all attributes.# @return [Integer] Hash codedefhash[pulp_href,prn,pulp_created,pulp_last_updated,number,repository,base_version,content_summary,vuln_report].hashend# Builds the object from hash# @param [Hash] attributes Model attributes in the form of hash# @return [Object] Returns the model itselfdefself.build_from_hash(attributes)returnnilunlessattributes.is_a?(Hash)attributes=attributes.transform_keys(&:to_sym)transformed_hash={}openapi_types.each_pairdo|key,type|ifattributes.key?(attribute_map[key])&&attributes[attribute_map[key]].nil?transformed_hash["#{key}"]=nilelsiftype=~/\AArray<(.*)>/i# check to ensure the input is an array given that the attribute# is documented as an array but the input is notifattributes[attribute_map[key]].is_a?(Array)transformed_hash["#{key}"]=attributes[attribute_map[key]].map{|v|_deserialize($1,v)}endelsif!attributes[attribute_map[key]].nil?transformed_hash["#{key}"]=_deserialize(type,attributes[attribute_map[key]])endendnew(transformed_hash)end# Deserializes the data based on type# @param string type Data type# @param string value Value to be deserialized# @return [Object] Deserialized datadefself._deserialize(type,value)casetype.to_symwhen:TimeTime.parse(value)when:DateDate.parse(value)when:Stringvalue.to_swhen:Integervalue.to_iwhen:Floatvalue.to_fwhen:Booleanifvalue.to_s=~/\A(true|t|yes|y|1)\z/itrueelsefalseendwhen:Object# generic object (usually a Hash), return directlyvaluewhen/\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]{}.tapdo|hash|value.eachdo|k,v|hash[_deserialize(k_type,k)]=_deserialize(v_type,v)endendelse# model# models (e.g. Pet) or oneOfklass=PulpPythonClient.const_get(type)klass.respond_to?(:openapi_any_of)||klass.respond_to?(:openapi_one_of)?klass.build(value):klass.build_from_hash(value)endend# Returns the string representation of the object# @return [String] String presentation of the objectdefto_sto_hash.to_send# to_body is an alias to to_hash (backward compatibility)# @return [Hash] Returns the object in the form of hashdefto_bodyto_hashend# Returns the object in the form of hash# @return [Hash] Returns the object in the form of hashdefto_hashhash={}self.class.attribute_map.each_pairdo|attr,param|value=self.send(attr)ifvalue.nil?is_nullable=self.class.openapi_nullable.include?(attr)nextif!is_nullable||(is_nullable&&!instance_variable_defined?(:"@#{attr}"))endhash[param]=_to_hash(value)endhashend# 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 hashdef_to_hash(value)ifvalue.is_a?(Array)value.compact.map{|v|_to_hash(v)}elsifvalue.is_a?(Hash){}.tapdo|hash|value.each{|k,v|hash[k]=_to_hash(v)}endelsifvalue.respond_to?:to_hashvalue.to_hashelsevalueendendendend