lib/svix/models/endpoint_in.rb in svix-0.83.1 vs lib/svix/models/endpoint_in.rb in svix-0.84.0

- old
+ new

@@ -78,11 +78,10 @@ # List of attributes with nullable: true def self.openapi_nullable Set.new([ :'channels', :'filter_types', - :'metadata', :'rate_limit', :'secret', :'uid', ]) end @@ -167,14 +166,10 @@ if !@filter_types.nil? && @filter_types.length < 1 invalid_properties.push('invalid value for "filter_types", number of items must be greater than or equal to 1.') end - if !@rate_limit.nil? && @rate_limit > 65535 - invalid_properties.push('invalid value for "rate_limit", must be smaller than or equal to 65535.') - end - if !@rate_limit.nil? && @rate_limit < 1 invalid_properties.push('invalid value for "rate_limit", must be greater than or equal to 1.') end pattern = Regexp.new(/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/) @@ -209,29 +204,33 @@ if @version.nil? invalid_properties.push('invalid value for "version", version cannot be nil.') end + if @version < 1 + invalid_properties.push('invalid value for "version", must be greater than or equal to 1.') + end + 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 false if !@channels.nil? && @channels.length > 10 return false if !@channels.nil? && @channels.length < 1 return false if !@filter_types.nil? && @filter_types.length < 1 - return false if !@rate_limit.nil? && @rate_limit > 65535 return false if !@rate_limit.nil? && @rate_limit < 1 return false if !@secret.nil? && @secret !~ Regexp.new(/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/) return false if !@uid.nil? && @uid.to_s.length > 256 return false if !@uid.nil? && @uid.to_s.length < 1 return false if !@uid.nil? && @uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/) return false if @url.nil? return false if @url.to_s.length > 65536 return false if @url.to_s.length < 1 return false if @version.nil? + return false if @version < 1 true end # Custom attribute writer method with validation # @param [Object] channels Value to be assigned @@ -258,14 +257,10 @@ end # Custom attribute writer method with validation # @param [Object] rate_limit Value to be assigned def rate_limit=(rate_limit) - if !rate_limit.nil? && rate_limit > 65535 - fail ArgumentError, 'invalid value for "rate_limit", must be smaller than or equal to 65535.' - end - if !rate_limit.nil? && rate_limit < 1 fail ArgumentError, 'invalid value for "rate_limit", must be greater than or equal to 1.' end @rate_limit = rate_limit @@ -315,9 +310,23 @@ if url.to_s.length < 1 fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.' end @url = url + end + + # Custom attribute writer method with validation + # @param [Object] version Value to be assigned + def version=(version) + if version.nil? + fail ArgumentError, 'version cannot be nil' + end + + if version < 1 + fail ArgumentError, 'invalid value for "version", must be greater than or equal to 1.' + end + + @version = version end # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o)