=begin
#Harness feature flag service client apis
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0.0
Contact: cf@harness.io
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.2.1
=endrequire'date'require'time'moduleOpenapiClient# TBDclassProxyConfig# The version of this object. The version will be incremented each time the object is modifiedattr_accessor:version# The total number of pagesattr_accessor:page_count# The total number of itemsattr_accessor:item_count# The number of items per pageattr_accessor:page_size# The current pageattr_accessor:page_indexattr_accessor:environments# Attribute mapping from ruby-style variable name to JSON key.defself.attribute_map{:'version'=>:'version',:'page_count'=>:'pageCount',:'item_count'=>:'itemCount',:'page_size'=>:'pageSize',:'page_index'=>:'pageIndex',:'environments'=>:'environments'}end# Returns all the JSON keys this model knows aboutdefself.acceptable_attributesattribute_map.valuesend# Attribute type mapping.defself.openapi_types{:'version'=>:'Integer',:'page_count'=>:'Integer',:'item_count'=>:'Integer',:'page_size'=>:'Integer',:'page_index'=>:'Integer',:'environments'=>:'Array<ProxyConfigAllOfEnvironments>'}end# List of attributes with nullable: truedefself.openapi_nullableSet.new([])end# List of class defined in allOf (OpenAPI v3)defself.openapi_all_of[:'Pagination',:'ProxyConfigAllOf']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 `OpenapiClient::ProxyConfig` 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 `OpenapiClient::ProxyConfig`. 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?(:'version')self.version=attributes[:'version']endifattributes.key?(:'page_count')self.page_count=attributes[:'page_count']endifattributes.key?(:'item_count')self.item_count=attributes[:'item_count']endifattributes.key?(:'page_size')self.page_size=attributes[:'page_size']endifattributes.key?(:'page_index')self.page_index=attributes[:'page_index']endifattributes.key?(:'environments')if(value=attributes[:'environments']).is_a?(Array)self.environments=valueendendend# Show invalid properties with the reasons. Usually used together with valid?# @return Array for valid properties with the reasonsdeflist_invalid_propertiesinvalid_properties=Array.newif@page_count.nil?invalid_properties.push('invalid value for "page_count", page_count cannot be nil.')endif@item_count.nil?invalid_properties.push('invalid value for "item_count", item_count cannot be nil.')endif@page_size.nil?invalid_properties.push('invalid value for "page_size", page_size cannot be nil.')endif@page_index.nil?invalid_properties.push('invalid value for "page_index", page_index cannot be nil.')endinvalid_propertiesend# Check to see if the all the properties in the model are valid# @return true if the model is validdefvalid?returnfalseif@page_count.nil?returnfalseif@item_count.nil?returnfalseif@page_size.nil?returnfalseif@page_index.nil?trueend# Checks equality by comparing each attribute.# @param [Object] Object to be compareddef==(o)returntrueifself.equal?(o)self.class==o.class&&version==o.version&&page_count==o.page_count&&item_count==o.item_count&&page_size==o.page_size&&page_index==o.page_index&&environments==o.environmentsend# @see the `==` method# @param [Object] Object to be compareddefeql?(o)self==oend# Calculates hash code according to all attributes.# @return [Integer] Hash codedefhash[version,page_count,item_count,page_size,page_index,environments].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)new.build_from_hash(attributes)end# Builds the object from hash# @param [Hash] attributes Model attributes in the form of hash# @return [Object] Returns the model itselfdefbuild_from_hash(attributes)returnnilunlessattributes.is_a?(Hash)self.class.openapi_types.each_pairdo|key,type|ifattributes[self.class.attribute_map[key]].nil?&&self.class.openapi_nullable.include?(key)self.send("#{key}=",nil)elsiftype=~/\AArray<(.*)>/i# check to ensure the input is an array given that the attribute# is documented as an array but the input is notifattributes[self.class.attribute_map[key]].is_a?(Array)self.send("#{key}=",attributes[self.class.attribute_map[key]].map{|v|_deserialize($1,v)})endelsif!attributes[self.class.attribute_map[key]].nil?self.send("#{key}=",_deserialize(type,attributes[self.class.attribute_map[key]]))endendselfend# Deserializes the data based on type# @param string type Data type# @param string value Value to be deserialized# @return [Object] Deserialized datadef_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=OpenapiClient.const_get(type)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