lib/connectwise-ruby-sdk/models/manufacturer.rb in connectwise-ruby-sdk-1.0.1 vs lib/connectwise-ruby-sdk/models/manufacturer.rb in connectwise-ruby-sdk-1.0.2
- old
+ new
@@ -84,29 +84,37 @@
# Show invalid properties with the reasons. Usually used together with valid?
# @return Array for valid properies with the reasons
def list_invalid_properties
invalid_properties = Array.new
+ if @name.nil?
+ invalid_properties.push("invalid value for 'name', name cannot be nil.")
+ end
+
+ if @name.to_s.length > 50
+ invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 50.")
+ end
+
return 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 @name.nil?
- return false if @name.to_s.length <
+ return false if @name.to_s.length > 50
return true
end
# Custom attribute writer method with validation
# @param [Object] name Value to be assigned
def name=(name)
if name.nil?
fail ArgumentError, "name cannot be nil"
end
- if name.to_s.length <
- fail ArgumentError, "invalid value for 'name', the character length must be great than or equal to ."
+ if name.to_s.length > 50
+ fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 50."
end
@name = name
end