Skip to content

Update length validation for CatalogItem#description #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/connectwise-ruby-sdk/models/catalog_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ def list_invalid_properties
invalid_properties.push("invalid value for 'description', description cannot be nil.")
end

if @description.to_s.length > 50
invalid_properties.push("invalid value for 'description', the character length must be smaller than or equal to 50.")
if @description.to_s.length > 60
invalid_properties.push("invalid value for 'description', the character length must be smaller than or equal to 60.")
end

if @subcategory.nil?
Expand Down Expand Up @@ -325,7 +325,7 @@ def valid?
return false if @identifier.nil?
return false if @identifier.to_s.length > 60
return false if @description.nil?
return false if @description.to_s.length > 50
return false if @description.to_s.length > 60
return false if @subcategory.nil?
return false if @type.nil?
product_class_validator = EnumAttributeValidator.new('String', ["Agreement", "Bundle", "Inventory", "NonInventory", "Service"])
Expand Down Expand Up @@ -361,8 +361,8 @@ def description=(description)
fail ArgumentError, "description cannot be nil"
end

if description.to_s.length > 50
fail ArgumentError, "invalid value for 'description', the character length must be smaller than or equal to 50."
if description.to_s.length > 60
fail ArgumentError, "invalid value for 'description', the character length must be smaller than or equal to 60."
end

@description = description
Expand Down