Skip to content

Commit

Permalink
Merge pull request #81 from XeroAPI/tracking_category_option_fix
Browse files Browse the repository at this point in the history
fix tracking category option length
  • Loading branch information
SerKnight authored Sep 29, 2020
2 parents 995c4d4 + ba4e486 commit 16ee559
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions docs/accounting/TrackingOption.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**tracking_option_id** | **String** | The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a | [optional]
**name** | **String** | The name of the tracking option e.g. Marketing, East (max length = 50) | [optional]
**tracking_option_id** | **String** | The Xero identifier for a tracking option e.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a | [optional]
**name** | **String** | The name of the tracking option e.g. Marketing, East (max length = 100) | [optional]
**status** | **String** | The status of a tracking option | [optional]
**tracking_category_id** | **String** | Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional]
**tracking_category_id** | **String** | Filter by a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional]

## Code Sample

Expand Down
16 changes: 8 additions & 8 deletions lib/xero-ruby/models/accounting/tracking_option.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ module XeroRuby::Accounting
require 'bigdecimal'

class TrackingOption
# The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a
# The Xero identifier for a tracking option e.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a
attr_accessor :tracking_option_id

# The name of the tracking option e.g. Marketing, East (max length = 50)
# The name of the tracking option e.g. Marketing, East (max length = 100)
attr_accessor :name

# The status of a tracking option
Expand All @@ -29,7 +29,7 @@ class TrackingOption
ARCHIVED = "ARCHIVED".freeze
DELETED = "DELETED".freeze

# Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
# Filter by a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
attr_accessor :tracking_category_id

class EnumAttributeValidator
Expand Down Expand Up @@ -110,8 +110,8 @@ def initialize(attributes = {})
# @return Array for valid properties with the reasons
def list_invalid_properties
invalid_properties = Array.new
if !@name.nil? && @name.to_s.length > 50
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 50.')
if !@name.nil? && @name.to_s.length > 100
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
end

invalid_properties
Expand All @@ -120,7 +120,7 @@ def list_invalid_properties
# 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? && @name.to_s.length > 50
return false if !@name.nil? && @name.to_s.length > 100
status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"])
return false unless status_validator.valid?(@status)
true
Expand All @@ -129,8 +129,8 @@ def valid?
# Custom attribute writer method with validation
# @param [Object] name Value to be assigned
def name=(name)
if !name.nil? && name.to_s.length > 50
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 50.'
if !name.nil? && name.to_s.length > 100
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
end

@name = name
Expand Down
2 changes: 1 addition & 1 deletion lib/xero-ruby/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module XeroRuby
VERSION = '2.2.3'
VERSION = '2.2.4'
end

0 comments on commit 16ee559

Please sign in to comment.