ynab 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +6 -2
- data/Gemfile.lock +1 -1
- data/README.md +4 -2
- data/docs/BulkTransactions.md +1 -1
- data/docs/CategoriesApi.md +22 -0
- data/docs/ExistingTransaction.md +18 -0
- data/docs/HybridTransaction.md +3 -2
- data/docs/NewTransaction.md +19 -0
- data/docs/PatchCategoryWrapper.md +8 -0
- data/docs/PatchPayeeWrapper.md +8 -0
- data/docs/PatchTransactionsWrapper.md +1 -1
- data/docs/PayeesApi.md +22 -0
- data/docs/PostTransactionsWrapper.md +2 -2
- data/docs/PutTransactionWrapper.md +1 -1
- data/docs/SaveCategory.md +10 -0
- data/docs/SavePayee.md +8 -0
- data/docs/SavePayeeResponse.md +8 -0
- data/docs/SavePayeeResponseData.md +9 -0
- data/docs/SaveTransactionWithIdOrImportId.md +20 -0
- data/docs/SaveTransactionWithOptionalFields.md +2 -3
- data/docs/ScheduledTransactionDetail.md +2 -1
- data/docs/ScheduledTransactionSummary.md +2 -1
- data/docs/TransactionClearedStatus.md +7 -0
- data/docs/TransactionDetail.md +3 -2
- data/docs/TransactionFlagColor.md +7 -0
- data/docs/TransactionSummary.md +3 -2
- data/docs/TransactionsApi.md +7 -7
- data/lib/ynab/api/accounts_api.rb +2 -2
- data/lib/ynab/api/budgets_api.rb +2 -2
- data/lib/ynab/api/categories_api.rb +82 -2
- data/lib/ynab/api/months_api.rb +2 -2
- data/lib/ynab/api/payee_locations_api.rb +2 -2
- data/lib/ynab/api/payees_api.rb +82 -2
- data/lib/ynab/api/scheduled_transactions_api.rb +2 -2
- data/lib/ynab/api/transactions_api.rb +12 -28
- data/lib/ynab/api/user_api.rb +2 -2
- data/lib/ynab/api_client.rb +2 -2
- data/lib/ynab/configuration.rb +14 -11
- data/lib/ynab/models/account.rb +13 -56
- data/lib/ynab/models/account_response.rb +13 -24
- data/lib/ynab/models/account_response_data.rb +13 -24
- data/lib/ynab/models/account_type.rb +2 -2
- data/lib/ynab/models/accounts_response.rb +13 -24
- data/lib/ynab/models/accounts_response_data.rb +13 -28
- data/lib/ynab/models/budget_detail.rb +13 -29
- data/lib/ynab/models/budget_detail_response.rb +13 -24
- data/lib/ynab/models/budget_detail_response_data.rb +13 -28
- data/lib/ynab/models/budget_settings.rb +13 -20
- data/lib/ynab/models/budget_settings_response.rb +13 -24
- data/lib/ynab/models/budget_settings_response_data.rb +13 -24
- data/lib/ynab/models/budget_summary.rb +13 -28
- data/lib/ynab/models/budget_summary_response.rb +13 -24
- data/lib/ynab/models/budget_summary_response_data.rb +13 -24
- data/lib/ynab/models/bulk_response.rb +13 -24
- data/lib/ynab/models/bulk_response_data.rb +13 -24
- data/lib/ynab/models/bulk_response_data_bulk.rb +13 -28
- data/lib/ynab/models/bulk_transactions.rb +14 -25
- data/lib/ynab/models/categories_response.rb +13 -24
- data/lib/ynab/models/categories_response_data.rb +13 -28
- data/lib/ynab/models/category.rb +13 -56
- data/lib/ynab/models/category_group.rb +13 -36
- data/lib/ynab/models/category_group_with_categories.rb +14 -42
- data/lib/ynab/models/category_group_with_categories_all_of.rb +0 -4
- data/lib/ynab/models/category_response.rb +13 -24
- data/lib/ynab/models/category_response_data.rb +13 -24
- data/lib/ynab/models/currency_format.rb +13 -52
- data/lib/ynab/models/date_format.rb +13 -24
- data/lib/ynab/models/error_detail.rb +13 -32
- data/lib/ynab/models/error_response.rb +13 -24
- data/lib/ynab/models/existing_transaction.rb +359 -0
- data/lib/ynab/models/hybrid_transaction.rb +28 -95
- data/lib/ynab/models/hybrid_transaction_all_of.rb +0 -12
- data/lib/ynab/models/hybrid_transactions_response.rb +13 -24
- data/lib/ynab/models/hybrid_transactions_response_data.rb +13 -24
- data/lib/ynab/models/month_detail.rb +13 -49
- data/lib/ynab/models/month_detail_all_of.rb +0 -4
- data/lib/ynab/models/month_detail_response.rb +13 -24
- data/lib/ynab/models/month_detail_response_data.rb +13 -24
- data/lib/ynab/models/month_summaries_response.rb +13 -24
- data/lib/ynab/models/month_summaries_response_data.rb +13 -28
- data/lib/ynab/models/month_summary.rb +13 -44
- data/lib/ynab/models/new_transaction.rb +377 -0
- data/lib/ynab/models/patch_category_wrapper.rb +213 -0
- data/lib/ynab/models/patch_month_category_wrapper.rb +13 -24
- data/lib/ynab/models/patch_payee_wrapper.rb +213 -0
- data/lib/ynab/models/patch_transactions_wrapper.rb +14 -25
- data/lib/ynab/models/payee.rb +13 -32
- data/lib/ynab/models/payee_location.rb +13 -40
- data/lib/ynab/models/payee_location_response.rb +13 -24
- data/lib/ynab/models/payee_location_response_data.rb +13 -24
- data/lib/ynab/models/payee_locations_response.rb +13 -24
- data/lib/ynab/models/payee_locations_response_data.rb +13 -24
- data/lib/ynab/models/payee_response.rb +13 -24
- data/lib/ynab/models/payee_response_data.rb +13 -24
- data/lib/ynab/models/payees_response.rb +13 -24
- data/lib/ynab/models/payees_response_data.rb +13 -28
- data/lib/ynab/models/post_account_wrapper.rb +13 -24
- data/lib/ynab/models/post_transactions_wrapper.rb +15 -22
- data/lib/ynab/models/put_transaction_wrapper.rb +14 -25
- data/lib/ynab/models/save_account.rb +13 -32
- data/lib/ynab/models/save_category.rb +232 -0
- data/lib/ynab/models/save_category_response.rb +13 -24
- data/lib/ynab/models/save_category_response_data.rb +13 -28
- data/lib/ynab/models/save_month_category.rb +13 -24
- data/lib/ynab/models/save_payee.rb +220 -0
- data/lib/ynab/models/save_payee_response.rb +213 -0
- data/lib/ynab/models/save_payee_response_data.rb +224 -0
- data/lib/ynab/models/save_sub_transaction.rb +13 -40
- data/lib/ynab/models/save_transaction.rb +0 -32
- data/lib/ynab/models/save_transaction_with_id.rb +0 -32
- data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +388 -0
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +17 -91
- data/lib/ynab/models/save_transactions_response.rb +13 -24
- data/lib/ynab/models/save_transactions_response_data.rb +13 -28
- data/lib/ynab/models/scheduled_sub_transaction.rb +13 -36
- data/lib/ynab/models/scheduled_transaction_detail.rb +26 -76
- data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +0 -8
- data/lib/ynab/models/scheduled_transaction_response.rb +13 -24
- data/lib/ynab/models/scheduled_transaction_response_data.rb +13 -24
- data/lib/ynab/models/scheduled_transaction_summary.rb +26 -67
- data/lib/ynab/models/scheduled_transactions_response.rb +13 -24
- data/lib/ynab/models/scheduled_transactions_response_data.rb +13 -28
- data/lib/ynab/models/sub_transaction.rb +13 -36
- data/lib/ynab/models/transaction_cleared_status.rb +41 -0
- data/lib/ynab/models/transaction_detail.rb +28 -91
- data/lib/ynab/models/transaction_detail_all_of.rb +0 -8
- data/lib/ynab/models/transaction_flag_color.rb +45 -0
- data/lib/ynab/models/transaction_response.rb +13 -24
- data/lib/ynab/models/transaction_response_data.rb +13 -24
- data/lib/ynab/models/transaction_summary.rb +28 -82
- data/lib/ynab/models/transactions_import_response.rb +13 -24
- data/lib/ynab/models/transactions_import_response_data.rb +13 -24
- data/lib/ynab/models/transactions_response.rb +13 -24
- data/lib/ynab/models/transactions_response_data.rb +13 -28
- data/lib/ynab/models/user.rb +13 -24
- data/lib/ynab/models/user_response.rb +13 -24
- data/lib/ynab/models/user_response_data.rb +13 -24
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +13 -12
- data/open_api_spec.yaml +455 -343
- data/templates/api.mustache +213 -0
- data/templates/partial_model_generic.mustache +305 -0
- data/ynab.gemspec +4 -3
- metadata +31 -7
@@ -0,0 +1,224 @@
|
|
1
|
+
=begin
|
2
|
+
#YNAB API Endpoints
|
3
|
+
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.6.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module YNAB
|
17
|
+
class SavePayeeResponseData
|
18
|
+
attr_accessor :payee
|
19
|
+
|
20
|
+
# The knowledge of the server
|
21
|
+
attr_accessor :server_knowledge
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'payee' => :'payee',
|
27
|
+
:'server_knowledge' => :'server_knowledge'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns all the JSON keys this model knows about
|
32
|
+
def self.acceptable_attributes
|
33
|
+
attribute_map.values
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.openapi_types
|
38
|
+
{
|
39
|
+
:'payee' => :'Payee',
|
40
|
+
:'server_knowledge' => :'Integer'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# List of attributes with nullable: true
|
45
|
+
def self.openapi_nullable
|
46
|
+
Set.new([
|
47
|
+
])
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::SavePayeeResponseData` initialize method"
|
55
|
+
end
|
56
|
+
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SavePayeeResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
62
|
+
h[k.to_sym] = v
|
63
|
+
}
|
64
|
+
|
65
|
+
if attributes.key?(:'payee')
|
66
|
+
self.payee = attributes[:'payee']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:'server_knowledge')
|
70
|
+
self.server_knowledge = attributes[:'server_knowledge']
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
75
|
+
# @return Array for valid properties with the reasons
|
76
|
+
def list_invalid_properties
|
77
|
+
invalid_properties = Array.new
|
78
|
+
invalid_properties
|
79
|
+
end
|
80
|
+
|
81
|
+
# Check to see if the all the properties in the model are valid
|
82
|
+
# @return true if the model is valid
|
83
|
+
def valid?
|
84
|
+
return false if @payee.nil?
|
85
|
+
return false if @server_knowledge.nil?
|
86
|
+
true
|
87
|
+
end
|
88
|
+
|
89
|
+
# Checks equality by comparing each attribute.
|
90
|
+
# @param [Object] Object to be compared
|
91
|
+
def ==(o)
|
92
|
+
return true if self.equal?(o)
|
93
|
+
self.class == o.class &&
|
94
|
+
payee == o.payee &&
|
95
|
+
server_knowledge == o.server_knowledge
|
96
|
+
end
|
97
|
+
|
98
|
+
# @see the `==` method
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def eql?(o)
|
101
|
+
self == o
|
102
|
+
end
|
103
|
+
|
104
|
+
# Calculates hash code according to all attributes.
|
105
|
+
# @return [Integer] Hash code
|
106
|
+
def hash
|
107
|
+
[payee, server_knowledge].hash
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def self.build_from_hash(attributes)
|
114
|
+
return nil unless attributes.is_a?(Hash)
|
115
|
+
attributes = attributes.transform_keys(&:to_sym)
|
116
|
+
transformed_hash = {}
|
117
|
+
openapi_types.each_pair do |key, type|
|
118
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
119
|
+
transformed_hash["#{key}"] = nil
|
120
|
+
elsif type =~ /\AArray<(.*)>/i
|
121
|
+
# check to ensure the input is an array given that the attribute
|
122
|
+
# is documented as an array but the input is not
|
123
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
124
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
125
|
+
end
|
126
|
+
elsif !attributes[attribute_map[key]].nil?
|
127
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
128
|
+
end
|
129
|
+
end
|
130
|
+
new(transformed_hash)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Deserializes the data based on type
|
134
|
+
# @param string type Data type
|
135
|
+
# @param string value Value to be deserialized
|
136
|
+
# @return [Object] Deserialized data
|
137
|
+
def self._deserialize(type, value)
|
138
|
+
case type.to_sym
|
139
|
+
when :Time
|
140
|
+
Time.parse(value)
|
141
|
+
when :Date
|
142
|
+
Date.parse(value)
|
143
|
+
when :String
|
144
|
+
value.to_s
|
145
|
+
when :Integer
|
146
|
+
value.to_i
|
147
|
+
when :Float
|
148
|
+
value.to_f
|
149
|
+
when :Boolean
|
150
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
151
|
+
true
|
152
|
+
else
|
153
|
+
false
|
154
|
+
end
|
155
|
+
when :Object
|
156
|
+
# generic object (usually a Hash), return directly
|
157
|
+
value
|
158
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
159
|
+
inner_type = Regexp.last_match[:inner_type]
|
160
|
+
value.map { |v| _deserialize(inner_type, v) }
|
161
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
162
|
+
k_type = Regexp.last_match[:k_type]
|
163
|
+
v_type = Regexp.last_match[:v_type]
|
164
|
+
{}.tap do |hash|
|
165
|
+
value.each do |k, v|
|
166
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
else # model
|
170
|
+
# models (e.g. Pet) or oneOf
|
171
|
+
klass = YNAB.const_get(type)
|
172
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
# Returns the string representation of the object
|
177
|
+
# @return [String] String presentation of the object
|
178
|
+
def to_s
|
179
|
+
to_hash.to_s
|
180
|
+
end
|
181
|
+
|
182
|
+
# to_body is an alias to to_hash (backward compatibility)
|
183
|
+
# @return [Hash] Returns the object in the form of hash
|
184
|
+
def to_body
|
185
|
+
to_hash
|
186
|
+
end
|
187
|
+
|
188
|
+
# Returns the object in the form of hash
|
189
|
+
# @return [Hash] Returns the object in the form of hash
|
190
|
+
def to_hash
|
191
|
+
hash = {}
|
192
|
+
self.class.attribute_map.each_pair do |attr, param|
|
193
|
+
value = self.send(attr)
|
194
|
+
if value.nil?
|
195
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
196
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
197
|
+
end
|
198
|
+
|
199
|
+
hash[param] = _to_hash(value)
|
200
|
+
end
|
201
|
+
hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Outputs non-array value in the form of hash
|
205
|
+
# For object, use to_hash. Otherwise, just return the value
|
206
|
+
# @param [Object] value Any valid value
|
207
|
+
# @return [Hash] Returns the value in the form of hash
|
208
|
+
def _to_hash(value)
|
209
|
+
if value.is_a?(Array)
|
210
|
+
value.compact.map { |v| _to_hash(v) }
|
211
|
+
elsif value.is_a?(Hash)
|
212
|
+
{}.tap do |hash|
|
213
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
214
|
+
end
|
215
|
+
elsif value.respond_to? :to_hash
|
216
|
+
value.to_hash
|
217
|
+
else
|
218
|
+
value
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|
223
|
+
|
224
|
+
end
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -106,18 +106,6 @@ module YNAB
|
|
106
106
|
# @return Array for valid properties with the reasons
|
107
107
|
def list_invalid_properties
|
108
108
|
invalid_properties = Array.new
|
109
|
-
if @amount.nil?
|
110
|
-
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
111
|
-
end
|
112
|
-
|
113
|
-
if !@payee_name.nil? && @payee_name.to_s.length > 50
|
114
|
-
invalid_properties.push('invalid value for "payee_name", the character length must be smaller than or equal to 50.')
|
115
|
-
end
|
116
|
-
|
117
|
-
if !@memo.nil? && @memo.to_s.length > 200
|
118
|
-
invalid_properties.push('invalid value for "memo", the character length must be smaller than or equal to 200.')
|
119
|
-
end
|
120
|
-
|
121
109
|
invalid_properties
|
122
110
|
end
|
123
111
|
|
@@ -133,20 +121,12 @@ module YNAB
|
|
133
121
|
# Custom attribute writer method with validation
|
134
122
|
# @param [Object] payee_name Value to be assigned
|
135
123
|
def payee_name=(payee_name)
|
136
|
-
if !payee_name.nil? && payee_name.to_s.length > 50
|
137
|
-
fail ArgumentError, 'invalid value for "payee_name", the character length must be smaller than or equal to 50.'
|
138
|
-
end
|
139
|
-
|
140
124
|
@payee_name = payee_name
|
141
125
|
end
|
142
126
|
|
143
127
|
# Custom attribute writer method with validation
|
144
128
|
# @param [Object] memo Value to be assigned
|
145
129
|
def memo=(memo)
|
146
|
-
if !memo.nil? && memo.to_s.length > 200
|
147
|
-
fail ArgumentError, 'invalid value for "memo", the character length must be smaller than or equal to 200.'
|
148
|
-
end
|
149
|
-
|
150
130
|
@memo = memo
|
151
131
|
end
|
152
132
|
|
@@ -178,37 +158,30 @@ module YNAB
|
|
178
158
|
# @param [Hash] attributes Model attributes in the form of hash
|
179
159
|
# @return [Object] Returns the model itself
|
180
160
|
def self.build_from_hash(attributes)
|
181
|
-
new.build_from_hash(attributes)
|
182
|
-
end
|
183
|
-
|
184
|
-
# Builds the object from hash
|
185
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
186
|
-
# @return [Object] Returns the model itself
|
187
|
-
def build_from_hash(attributes)
|
188
161
|
return nil unless attributes.is_a?(Hash)
|
189
162
|
attributes = attributes.transform_keys(&:to_sym)
|
190
|
-
|
191
|
-
|
192
|
-
|
163
|
+
transformed_hash = {}
|
164
|
+
openapi_types.each_pair do |key, type|
|
165
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
166
|
+
transformed_hash["#{key}"] = nil
|
193
167
|
elsif type =~ /\AArray<(.*)>/i
|
194
168
|
# check to ensure the input is an array given that the attribute
|
195
169
|
# is documented as an array but the input is not
|
196
|
-
if attributes[
|
197
|
-
|
170
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
171
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
198
172
|
end
|
199
|
-
elsif !attributes[
|
200
|
-
|
173
|
+
elsif !attributes[attribute_map[key]].nil?
|
174
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
201
175
|
end
|
202
176
|
end
|
203
|
-
|
204
|
-
self
|
177
|
+
new(transformed_hash)
|
205
178
|
end
|
206
179
|
|
207
180
|
# Deserializes the data based on type
|
208
181
|
# @param string type Data type
|
209
182
|
# @param string value Value to be deserialized
|
210
183
|
# @return [Object] Deserialized data
|
211
|
-
def _deserialize(type, value)
|
184
|
+
def self._deserialize(type, value)
|
212
185
|
case type.to_sym
|
213
186
|
when :Time
|
214
187
|
Time.parse(value)
|
@@ -243,7 +216,7 @@ module YNAB
|
|
243
216
|
else # model
|
244
217
|
# models (e.g. Pet) or oneOf
|
245
218
|
klass = YNAB.const_get(type)
|
246
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
219
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
247
220
|
end
|
248
221
|
end
|
249
222
|
|
@@ -200,18 +200,6 @@ module YNAB
|
|
200
200
|
# @return Array for valid properties with the reasons
|
201
201
|
def list_invalid_properties
|
202
202
|
invalid_properties = Array.new
|
203
|
-
if !@payee_name.nil? && @payee_name.to_s.length > 50
|
204
|
-
invalid_properties.push('invalid value for "payee_name", the character length must be smaller than or equal to 50.')
|
205
|
-
end
|
206
|
-
|
207
|
-
if !@memo.nil? && @memo.to_s.length > 200
|
208
|
-
invalid_properties.push('invalid value for "memo", the character length must be smaller than or equal to 200.')
|
209
|
-
end
|
210
|
-
|
211
|
-
if !@import_id.nil? && @import_id.to_s.length > 36
|
212
|
-
invalid_properties.push('invalid value for "import_id", the character length must be smaller than or equal to 36.')
|
213
|
-
end
|
214
|
-
|
215
203
|
invalid_properties
|
216
204
|
end
|
217
205
|
|
@@ -231,50 +219,30 @@ module YNAB
|
|
231
219
|
# Custom attribute writer method with validation
|
232
220
|
# @param [Object] payee_name Value to be assigned
|
233
221
|
def payee_name=(payee_name)
|
234
|
-
if !payee_name.nil? && payee_name.to_s.length > 50
|
235
|
-
fail ArgumentError, 'invalid value for "payee_name", the character length must be smaller than or equal to 50.'
|
236
|
-
end
|
237
|
-
|
238
222
|
@payee_name = payee_name
|
239
223
|
end
|
240
224
|
|
241
225
|
# Custom attribute writer method with validation
|
242
226
|
# @param [Object] memo Value to be assigned
|
243
227
|
def memo=(memo)
|
244
|
-
if !memo.nil? && memo.to_s.length > 200
|
245
|
-
fail ArgumentError, 'invalid value for "memo", the character length must be smaller than or equal to 200.'
|
246
|
-
end
|
247
|
-
|
248
228
|
@memo = memo
|
249
229
|
end
|
250
230
|
|
251
231
|
# Custom attribute writer method checking allowed values (enum).
|
252
232
|
# @param [Object] cleared Object to be assigned
|
253
233
|
def cleared=(cleared)
|
254
|
-
validator = EnumAttributeValidator.new('String', ["cleared", "uncleared", "reconciled"])
|
255
|
-
unless validator.valid?(cleared)
|
256
|
-
fail ArgumentError, "invalid value for \"cleared\", must be one of #{validator.allowable_values}."
|
257
|
-
end
|
258
234
|
@cleared = cleared
|
259
235
|
end
|
260
236
|
|
261
237
|
# Custom attribute writer method checking allowed values (enum).
|
262
238
|
# @param [Object] flag_color Object to be assigned
|
263
239
|
def flag_color=(flag_color)
|
264
|
-
validator = EnumAttributeValidator.new('String', ["red", "orange", "yellow", "green", "blue", "purple", "null"])
|
265
|
-
unless validator.valid?(flag_color)
|
266
|
-
fail ArgumentError, "invalid value for \"flag_color\", must be one of #{validator.allowable_values}."
|
267
|
-
end
|
268
240
|
@flag_color = flag_color
|
269
241
|
end
|
270
242
|
|
271
243
|
# Custom attribute writer method with validation
|
272
244
|
# @param [Object] import_id Value to be assigned
|
273
245
|
def import_id=(import_id)
|
274
|
-
if !import_id.nil? && import_id.to_s.length > 36
|
275
|
-
fail ArgumentError, 'invalid value for "import_id", the character length must be smaller than or equal to 36.'
|
276
|
-
end
|
277
|
-
|
278
246
|
@import_id = import_id
|
279
247
|
end
|
280
248
|
|
@@ -209,18 +209,6 @@ module YNAB
|
|
209
209
|
# @return Array for valid properties with the reasons
|
210
210
|
def list_invalid_properties
|
211
211
|
invalid_properties = Array.new
|
212
|
-
if !@payee_name.nil? && @payee_name.to_s.length > 50
|
213
|
-
invalid_properties.push('invalid value for "payee_name", the character length must be smaller than or equal to 50.')
|
214
|
-
end
|
215
|
-
|
216
|
-
if !@memo.nil? && @memo.to_s.length > 200
|
217
|
-
invalid_properties.push('invalid value for "memo", the character length must be smaller than or equal to 200.')
|
218
|
-
end
|
219
|
-
|
220
|
-
if !@import_id.nil? && @import_id.to_s.length > 36
|
221
|
-
invalid_properties.push('invalid value for "import_id", the character length must be smaller than or equal to 36.')
|
222
|
-
end
|
223
|
-
|
224
212
|
invalid_properties
|
225
213
|
end
|
226
214
|
|
@@ -240,50 +228,30 @@ module YNAB
|
|
240
228
|
# Custom attribute writer method with validation
|
241
229
|
# @param [Object] payee_name Value to be assigned
|
242
230
|
def payee_name=(payee_name)
|
243
|
-
if !payee_name.nil? && payee_name.to_s.length > 50
|
244
|
-
fail ArgumentError, 'invalid value for "payee_name", the character length must be smaller than or equal to 50.'
|
245
|
-
end
|
246
|
-
|
247
231
|
@payee_name = payee_name
|
248
232
|
end
|
249
233
|
|
250
234
|
# Custom attribute writer method with validation
|
251
235
|
# @param [Object] memo Value to be assigned
|
252
236
|
def memo=(memo)
|
253
|
-
if !memo.nil? && memo.to_s.length > 200
|
254
|
-
fail ArgumentError, 'invalid value for "memo", the character length must be smaller than or equal to 200.'
|
255
|
-
end
|
256
|
-
|
257
237
|
@memo = memo
|
258
238
|
end
|
259
239
|
|
260
240
|
# Custom attribute writer method checking allowed values (enum).
|
261
241
|
# @param [Object] cleared Object to be assigned
|
262
242
|
def cleared=(cleared)
|
263
|
-
validator = EnumAttributeValidator.new('String', ["cleared", "uncleared", "reconciled"])
|
264
|
-
unless validator.valid?(cleared)
|
265
|
-
fail ArgumentError, "invalid value for \"cleared\", must be one of #{validator.allowable_values}."
|
266
|
-
end
|
267
243
|
@cleared = cleared
|
268
244
|
end
|
269
245
|
|
270
246
|
# Custom attribute writer method checking allowed values (enum).
|
271
247
|
# @param [Object] flag_color Object to be assigned
|
272
248
|
def flag_color=(flag_color)
|
273
|
-
validator = EnumAttributeValidator.new('String', ["red", "orange", "yellow", "green", "blue", "purple", "null"])
|
274
|
-
unless validator.valid?(flag_color)
|
275
|
-
fail ArgumentError, "invalid value for \"flag_color\", must be one of #{validator.allowable_values}."
|
276
|
-
end
|
277
249
|
@flag_color = flag_color
|
278
250
|
end
|
279
251
|
|
280
252
|
# Custom attribute writer method with validation
|
281
253
|
# @param [Object] import_id Value to be assigned
|
282
254
|
def import_id=(import_id)
|
283
|
-
if !import_id.nil? && import_id.to_s.length > 36
|
284
|
-
fail ArgumentError, 'invalid value for "import_id", the character length must be smaller than or equal to 36.'
|
285
|
-
end
|
286
|
-
|
287
255
|
@import_id = import_id
|
288
256
|
end
|
289
257
|
|