ynab 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +6 -3
- data/Gemfile.lock +21 -19
- data/Rakefile +9 -8
- data/docs/ExistingCategory.md +4 -3
- data/docs/ExistingTransaction.md +1 -1
- data/docs/NewCategory.md +4 -3
- data/docs/NewTransaction.md +1 -1
- data/docs/SaveCategory.md +4 -3
- data/docs/SaveTransactionWithIdOrImportId.md +1 -1
- data/docs/SaveTransactionWithOptionalFields.md +1 -1
- data/docs/TransactionsApi.md +1 -1
- data/lib/ynab/api/accounts_api.rb +1 -1
- data/lib/ynab/api/categories_api.rb +1 -1
- data/lib/ynab/api/money_movements_api.rb +1 -1
- data/lib/ynab/api/months_api.rb +1 -1
- data/lib/ynab/api/payee_locations_api.rb +1 -1
- data/lib/ynab/api/payees_api.rb +1 -1
- data/lib/ynab/api/plans_api.rb +1 -1
- data/lib/ynab/api/scheduled_transactions_api.rb +1 -1
- data/lib/ynab/api/transactions_api.rb +3 -3
- data/lib/ynab/api/user_api.rb +1 -1
- data/lib/ynab/api_client.rb +1 -1
- data/lib/ynab/api_model_base.rb +1 -1
- data/lib/ynab/configuration.rb +1 -1
- data/lib/ynab/models/account.rb +38 -13
- data/lib/ynab/models/account_base.rb +34 -12
- data/lib/ynab/models/account_response.rb +31 -12
- data/lib/ynab/models/account_response_data.rb +31 -12
- data/lib/ynab/models/account_type.rb +1 -1
- data/lib/ynab/models/accounts_response.rb +31 -12
- data/lib/ynab/models/accounts_response_data.rb +31 -12
- data/lib/ynab/models/bulk_response.rb +31 -12
- data/lib/ynab/models/bulk_response_data.rb +31 -12
- data/lib/ynab/models/bulk_response_data_bulk.rb +31 -12
- data/lib/ynab/models/bulk_transactions.rb +31 -12
- data/lib/ynab/models/categories_response.rb +31 -12
- data/lib/ynab/models/categories_response_data.rb +31 -12
- data/lib/ynab/models/category.rb +47 -12
- data/lib/ynab/models/category_base.rb +31 -12
- data/lib/ynab/models/category_group.rb +31 -12
- data/lib/ynab/models/category_group_with_categories.rb +31 -12
- data/lib/ynab/models/category_response.rb +31 -12
- data/lib/ynab/models/category_response_data.rb +31 -12
- data/lib/ynab/models/currency_format.rb +31 -12
- data/lib/ynab/models/date_format.rb +31 -12
- data/lib/ynab/models/error_detail.rb +31 -12
- data/lib/ynab/models/error_response.rb +31 -12
- data/lib/ynab/models/existing_category.rb +83 -19
- data/lib/ynab/models/existing_transaction.rb +36 -13
- data/lib/ynab/models/hybrid_transaction.rb +41 -12
- data/lib/ynab/models/hybrid_transactions_response.rb +31 -12
- data/lib/ynab/models/hybrid_transactions_response_data.rb +31 -12
- data/lib/ynab/models/money_movement.rb +38 -12
- data/lib/ynab/models/money_movement_base.rb +31 -12
- data/lib/ynab/models/money_movement_group.rb +31 -12
- data/lib/ynab/models/money_movement_groups_response.rb +31 -12
- data/lib/ynab/models/money_movement_groups_response_data.rb +31 -12
- data/lib/ynab/models/money_movements_response.rb +31 -12
- data/lib/ynab/models/money_movements_response_data.rb +31 -12
- data/lib/ynab/models/month_detail.rb +33 -12
- data/lib/ynab/models/month_detail_base.rb +33 -12
- data/lib/ynab/models/month_detail_response.rb +31 -12
- data/lib/ynab/models/month_detail_response_data.rb +31 -12
- data/lib/ynab/models/month_summaries_response.rb +31 -12
- data/lib/ynab/models/month_summaries_response_data.rb +31 -12
- data/lib/ynab/models/month_summary.rb +33 -12
- data/lib/ynab/models/month_summary_base.rb +31 -12
- data/lib/ynab/models/new_category.rb +83 -19
- data/lib/ynab/models/new_transaction.rb +36 -13
- data/lib/ynab/models/patch_category_group_wrapper.rb +31 -12
- data/lib/ynab/models/patch_category_wrapper.rb +31 -12
- data/lib/ynab/models/patch_month_category_wrapper.rb +31 -12
- data/lib/ynab/models/patch_payee_wrapper.rb +31 -12
- data/lib/ynab/models/patch_transactions_wrapper.rb +31 -12
- data/lib/ynab/models/payee.rb +31 -12
- data/lib/ynab/models/payee_location.rb +31 -12
- data/lib/ynab/models/payee_location_response.rb +31 -12
- data/lib/ynab/models/payee_location_response_data.rb +31 -12
- data/lib/ynab/models/payee_locations_response.rb +31 -12
- data/lib/ynab/models/payee_locations_response_data.rb +31 -12
- data/lib/ynab/models/payee_response.rb +31 -12
- data/lib/ynab/models/payee_response_data.rb +31 -12
- data/lib/ynab/models/payees_response.rb +31 -12
- data/lib/ynab/models/payees_response_data.rb +31 -12
- data/lib/ynab/models/plan_detail.rb +33 -12
- data/lib/ynab/models/plan_detail_response.rb +31 -12
- data/lib/ynab/models/plan_detail_response_data.rb +31 -12
- data/lib/ynab/models/plan_settings.rb +33 -14
- data/lib/ynab/models/plan_settings_response.rb +31 -12
- data/lib/ynab/models/plan_settings_response_data.rb +31 -12
- data/lib/ynab/models/plan_summary.rb +33 -12
- data/lib/ynab/models/plan_summary_response.rb +31 -12
- data/lib/ynab/models/plan_summary_response_data.rb +31 -12
- data/lib/ynab/models/post_account_wrapper.rb +31 -12
- data/lib/ynab/models/post_category_group_wrapper.rb +31 -12
- data/lib/ynab/models/post_category_wrapper.rb +31 -12
- data/lib/ynab/models/post_payee.rb +31 -12
- data/lib/ynab/models/post_payee_wrapper.rb +31 -12
- data/lib/ynab/models/post_scheduled_transaction_wrapper.rb +31 -12
- data/lib/ynab/models/post_transactions_wrapper.rb +31 -12
- data/lib/ynab/models/put_scheduled_transaction_wrapper.rb +31 -12
- data/lib/ynab/models/put_transaction_wrapper.rb +31 -12
- data/lib/ynab/models/save_account.rb +31 -12
- data/lib/ynab/models/save_account_type.rb +1 -1
- data/lib/ynab/models/save_category.rb +79 -20
- data/lib/ynab/models/save_category_group.rb +31 -12
- data/lib/ynab/models/save_category_group_response.rb +31 -12
- data/lib/ynab/models/save_category_group_response_data.rb +31 -12
- data/lib/ynab/models/save_category_response.rb +31 -12
- data/lib/ynab/models/save_category_response_data.rb +31 -12
- data/lib/ynab/models/save_month_category.rb +31 -12
- data/lib/ynab/models/save_payee.rb +31 -12
- data/lib/ynab/models/save_payee_response.rb +31 -12
- data/lib/ynab/models/save_payee_response_data.rb +31 -12
- data/lib/ynab/models/save_scheduled_transaction.rb +31 -12
- data/lib/ynab/models/save_sub_transaction.rb +31 -12
- data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +36 -13
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +32 -13
- data/lib/ynab/models/save_transactions_response.rb +31 -12
- data/lib/ynab/models/save_transactions_response_data.rb +31 -12
- data/lib/ynab/models/scheduled_sub_transaction.rb +37 -12
- data/lib/ynab/models/scheduled_sub_transaction_base.rb +31 -12
- data/lib/ynab/models/scheduled_transaction_detail.rb +36 -12
- data/lib/ynab/models/scheduled_transaction_frequency.rb +1 -1
- data/lib/ynab/models/scheduled_transaction_response.rb +31 -12
- data/lib/ynab/models/scheduled_transaction_response_data.rb +31 -12
- data/lib/ynab/models/scheduled_transaction_summary.rb +36 -12
- data/lib/ynab/models/scheduled_transaction_summary_base.rb +31 -12
- data/lib/ynab/models/scheduled_transactions_response.rb +31 -12
- data/lib/ynab/models/scheduled_transactions_response_data.rb +31 -12
- data/lib/ynab/models/sub_transaction.rb +38 -12
- data/lib/ynab/models/sub_transaction_base.rb +31 -12
- data/lib/ynab/models/transaction_cleared_status.rb +1 -1
- data/lib/ynab/models/transaction_detail.rb +41 -12
- data/lib/ynab/models/transaction_flag_color.rb +1 -1
- data/lib/ynab/models/transaction_response.rb +31 -12
- data/lib/ynab/models/transaction_response_data.rb +31 -12
- data/lib/ynab/models/transaction_summary.rb +41 -12
- data/lib/ynab/models/transaction_summary_base.rb +31 -12
- data/lib/ynab/models/transactions_import_response.rb +31 -12
- data/lib/ynab/models/transactions_import_response_data.rb +31 -12
- data/lib/ynab/models/transactions_response.rb +31 -12
- data/lib/ynab/models/transactions_response_data.rb +31 -12
- data/lib/ynab/models/user.rb +31 -12
- data/lib/ynab/models/user_response.rb +31 -12
- data/lib/ynab/models/user_response_data.rb +31 -12
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +1 -1
- data/open_api_spec.yaml +61 -30
- data/templates/partial_model_generic.mustache +37 -11
- data/ynab.gemspec +2 -2
- metadata +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -26,9 +26,14 @@ module YNAB
|
|
|
26
26
|
}
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
# Returns attribute mapping this model knows about
|
|
30
|
+
def self.acceptable_attribute_map
|
|
31
|
+
attribute_map
|
|
32
|
+
end
|
|
33
|
+
|
|
29
34
|
# Returns all the JSON keys this model knows about
|
|
30
35
|
def self.acceptable_attributes
|
|
31
|
-
|
|
36
|
+
acceptable_attribute_map.values
|
|
32
37
|
end
|
|
33
38
|
|
|
34
39
|
# Attribute type mapping.
|
|
@@ -45,6 +50,16 @@ module YNAB
|
|
|
45
50
|
])
|
|
46
51
|
end
|
|
47
52
|
|
|
53
|
+
# Returns attribute type mapping
|
|
54
|
+
def self.acceptable_openapi_types
|
|
55
|
+
openapi_types
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns the nullable attributes
|
|
59
|
+
def self.acceptable_openapi_nullable
|
|
60
|
+
openapi_nullable
|
|
61
|
+
end
|
|
62
|
+
|
|
48
63
|
# Initializes the object
|
|
49
64
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
50
65
|
def initialize(attributes = {})
|
|
@@ -53,9 +68,10 @@ module YNAB
|
|
|
53
68
|
end
|
|
54
69
|
|
|
55
70
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
71
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
56
72
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
57
|
-
if (!
|
|
58
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::BulkResponseDataBulk`. Please check the name to make sure it's valid. List of attributes: " +
|
|
73
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
74
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::BulkResponseDataBulk`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
59
75
|
end
|
|
60
76
|
h[k.to_sym] = v
|
|
61
77
|
}
|
|
@@ -115,18 +131,20 @@ module YNAB
|
|
|
115
131
|
def self.build_from_hash(attributes)
|
|
116
132
|
return nil unless attributes.is_a?(Hash)
|
|
117
133
|
attributes = attributes.transform_keys(&:to_sym)
|
|
134
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
135
|
+
map = acceptable_attribute_map
|
|
118
136
|
transformed_hash = {}
|
|
119
|
-
|
|
120
|
-
if attributes.key?(
|
|
137
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
138
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
121
139
|
transformed_hash["#{key}"] = nil
|
|
122
140
|
elsif type =~ /\AArray<(.*)>/i
|
|
123
141
|
# check to ensure the input is an array given that the attribute
|
|
124
142
|
# is documented as an array but the input is not
|
|
125
|
-
if attributes[
|
|
126
|
-
transformed_hash["#{key}"] = attributes[
|
|
143
|
+
if attributes[map[key]].is_a?(Array)
|
|
144
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
127
145
|
end
|
|
128
|
-
elsif !attributes[
|
|
129
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
146
|
+
elsif !attributes[map[key]].nil?
|
|
147
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
130
148
|
end
|
|
131
149
|
end
|
|
132
150
|
new(transformed_hash)
|
|
@@ -136,10 +154,11 @@ module YNAB
|
|
|
136
154
|
# @return [Hash] Returns the object in the form of hash
|
|
137
155
|
def to_hash
|
|
138
156
|
hash = {}
|
|
139
|
-
|
|
157
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
158
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
140
159
|
value = self.send(attr)
|
|
141
160
|
if value.nil?
|
|
142
|
-
is_nullable = self.class.
|
|
161
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
143
162
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
144
163
|
end
|
|
145
164
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -21,9 +21,14 @@ module YNAB
|
|
|
21
21
|
}
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
# Returns attribute mapping this model knows about
|
|
25
|
+
def self.acceptable_attribute_map
|
|
26
|
+
attribute_map
|
|
27
|
+
end
|
|
28
|
+
|
|
24
29
|
# Returns all the JSON keys this model knows about
|
|
25
30
|
def self.acceptable_attributes
|
|
26
|
-
|
|
31
|
+
acceptable_attribute_map.values
|
|
27
32
|
end
|
|
28
33
|
|
|
29
34
|
# Attribute type mapping.
|
|
@@ -39,6 +44,16 @@ module YNAB
|
|
|
39
44
|
])
|
|
40
45
|
end
|
|
41
46
|
|
|
47
|
+
# Returns attribute type mapping
|
|
48
|
+
def self.acceptable_openapi_types
|
|
49
|
+
openapi_types
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns the nullable attributes
|
|
53
|
+
def self.acceptable_openapi_nullable
|
|
54
|
+
openapi_nullable
|
|
55
|
+
end
|
|
56
|
+
|
|
42
57
|
# Initializes the object
|
|
43
58
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
44
59
|
def initialize(attributes = {})
|
|
@@ -47,9 +62,10 @@ module YNAB
|
|
|
47
62
|
end
|
|
48
63
|
|
|
49
64
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
50
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
51
|
-
if (!
|
|
52
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::BulkTransactions`. Please check the name to make sure it's valid. List of attributes: " +
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::BulkTransactions`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
53
69
|
end
|
|
54
70
|
h[k.to_sym] = v
|
|
55
71
|
}
|
|
@@ -101,18 +117,20 @@ module YNAB
|
|
|
101
117
|
def self.build_from_hash(attributes)
|
|
102
118
|
return nil unless attributes.is_a?(Hash)
|
|
103
119
|
attributes = attributes.transform_keys(&:to_sym)
|
|
120
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
121
|
+
map = acceptable_attribute_map
|
|
104
122
|
transformed_hash = {}
|
|
105
|
-
|
|
106
|
-
if attributes.key?(
|
|
123
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
124
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
107
125
|
transformed_hash["#{key}"] = nil
|
|
108
126
|
elsif type =~ /\AArray<(.*)>/i
|
|
109
127
|
# check to ensure the input is an array given that the attribute
|
|
110
128
|
# is documented as an array but the input is not
|
|
111
|
-
if attributes[
|
|
112
|
-
transformed_hash["#{key}"] = attributes[
|
|
129
|
+
if attributes[map[key]].is_a?(Array)
|
|
130
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
113
131
|
end
|
|
114
|
-
elsif !attributes[
|
|
115
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
132
|
+
elsif !attributes[map[key]].nil?
|
|
133
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
116
134
|
end
|
|
117
135
|
end
|
|
118
136
|
new(transformed_hash)
|
|
@@ -122,10 +140,11 @@ module YNAB
|
|
|
122
140
|
# @return [Hash] Returns the object in the form of hash
|
|
123
141
|
def to_hash
|
|
124
142
|
hash = {}
|
|
125
|
-
|
|
143
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
144
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
126
145
|
value = self.send(attr)
|
|
127
146
|
if value.nil?
|
|
128
|
-
is_nullable = self.class.
|
|
147
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
129
148
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
130
149
|
end
|
|
131
150
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -21,9 +21,14 @@ module YNAB
|
|
|
21
21
|
}
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
# Returns attribute mapping this model knows about
|
|
25
|
+
def self.acceptable_attribute_map
|
|
26
|
+
attribute_map
|
|
27
|
+
end
|
|
28
|
+
|
|
24
29
|
# Returns all the JSON keys this model knows about
|
|
25
30
|
def self.acceptable_attributes
|
|
26
|
-
|
|
31
|
+
acceptable_attribute_map.values
|
|
27
32
|
end
|
|
28
33
|
|
|
29
34
|
# Attribute type mapping.
|
|
@@ -39,6 +44,16 @@ module YNAB
|
|
|
39
44
|
])
|
|
40
45
|
end
|
|
41
46
|
|
|
47
|
+
# Returns attribute type mapping
|
|
48
|
+
def self.acceptable_openapi_types
|
|
49
|
+
openapi_types
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns the nullable attributes
|
|
53
|
+
def self.acceptable_openapi_nullable
|
|
54
|
+
openapi_nullable
|
|
55
|
+
end
|
|
56
|
+
|
|
42
57
|
# Initializes the object
|
|
43
58
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
44
59
|
def initialize(attributes = {})
|
|
@@ -47,9 +62,10 @@ module YNAB
|
|
|
47
62
|
end
|
|
48
63
|
|
|
49
64
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
50
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
51
|
-
if (!
|
|
52
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoriesResponse`. Please check the name to make sure it's valid. List of attributes: " +
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoriesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
53
69
|
end
|
|
54
70
|
h[k.to_sym] = v
|
|
55
71
|
}
|
|
@@ -99,18 +115,20 @@ module YNAB
|
|
|
99
115
|
def self.build_from_hash(attributes)
|
|
100
116
|
return nil unless attributes.is_a?(Hash)
|
|
101
117
|
attributes = attributes.transform_keys(&:to_sym)
|
|
118
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
119
|
+
map = acceptable_attribute_map
|
|
102
120
|
transformed_hash = {}
|
|
103
|
-
|
|
104
|
-
if attributes.key?(
|
|
121
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
122
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
105
123
|
transformed_hash["#{key}"] = nil
|
|
106
124
|
elsif type =~ /\AArray<(.*)>/i
|
|
107
125
|
# check to ensure the input is an array given that the attribute
|
|
108
126
|
# is documented as an array but the input is not
|
|
109
|
-
if attributes[
|
|
110
|
-
transformed_hash["#{key}"] = attributes[
|
|
127
|
+
if attributes[map[key]].is_a?(Array)
|
|
128
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
111
129
|
end
|
|
112
|
-
elsif !attributes[
|
|
113
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
130
|
+
elsif !attributes[map[key]].nil?
|
|
131
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
114
132
|
end
|
|
115
133
|
end
|
|
116
134
|
new(transformed_hash)
|
|
@@ -120,10 +138,11 @@ module YNAB
|
|
|
120
138
|
# @return [Hash] Returns the object in the form of hash
|
|
121
139
|
def to_hash
|
|
122
140
|
hash = {}
|
|
123
|
-
|
|
141
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
142
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
124
143
|
value = self.send(attr)
|
|
125
144
|
if value.nil?
|
|
126
|
-
is_nullable = self.class.
|
|
145
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
127
146
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
128
147
|
end
|
|
129
148
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -25,9 +25,14 @@ module YNAB
|
|
|
25
25
|
}
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
28
33
|
# Returns all the JSON keys this model knows about
|
|
29
34
|
def self.acceptable_attributes
|
|
30
|
-
|
|
35
|
+
acceptable_attribute_map.values
|
|
31
36
|
end
|
|
32
37
|
|
|
33
38
|
# Attribute type mapping.
|
|
@@ -44,6 +49,16 @@ module YNAB
|
|
|
44
49
|
])
|
|
45
50
|
end
|
|
46
51
|
|
|
52
|
+
# Returns attribute type mapping
|
|
53
|
+
def self.acceptable_openapi_types
|
|
54
|
+
openapi_types
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns the nullable attributes
|
|
58
|
+
def self.acceptable_openapi_nullable
|
|
59
|
+
openapi_nullable
|
|
60
|
+
end
|
|
61
|
+
|
|
47
62
|
# Initializes the object
|
|
48
63
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
49
64
|
def initialize(attributes = {})
|
|
@@ -52,9 +67,10 @@ module YNAB
|
|
|
52
67
|
end
|
|
53
68
|
|
|
54
69
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
55
71
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
56
|
-
if (!
|
|
57
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoriesResponseData`. Please check the name to make sure it's valid. List of attributes: " +
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoriesResponseData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
58
74
|
end
|
|
59
75
|
h[k.to_sym] = v
|
|
60
76
|
}
|
|
@@ -112,18 +128,20 @@ module YNAB
|
|
|
112
128
|
def self.build_from_hash(attributes)
|
|
113
129
|
return nil unless attributes.is_a?(Hash)
|
|
114
130
|
attributes = attributes.transform_keys(&:to_sym)
|
|
131
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
132
|
+
map = acceptable_attribute_map
|
|
115
133
|
transformed_hash = {}
|
|
116
|
-
|
|
117
|
-
if attributes.key?(
|
|
134
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
135
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
118
136
|
transformed_hash["#{key}"] = nil
|
|
119
137
|
elsif type =~ /\AArray<(.*)>/i
|
|
120
138
|
# check to ensure the input is an array given that the attribute
|
|
121
139
|
# is documented as an array but the input is not
|
|
122
|
-
if attributes[
|
|
123
|
-
transformed_hash["#{key}"] = attributes[
|
|
140
|
+
if attributes[map[key]].is_a?(Array)
|
|
141
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
124
142
|
end
|
|
125
|
-
elsif !attributes[
|
|
126
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
143
|
+
elsif !attributes[map[key]].nil?
|
|
144
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
127
145
|
end
|
|
128
146
|
end
|
|
129
147
|
new(transformed_hash)
|
|
@@ -133,10 +151,11 @@ module YNAB
|
|
|
133
151
|
# @return [Hash] Returns the object in the form of hash
|
|
134
152
|
def to_hash
|
|
135
153
|
hash = {}
|
|
136
|
-
|
|
154
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
155
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
137
156
|
value = self.send(attr)
|
|
138
157
|
if value.nil?
|
|
139
|
-
is_nullable = self.class.
|
|
158
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
140
159
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
141
160
|
end
|
|
142
161
|
|
data/lib/ynab/models/category.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -199,9 +199,14 @@ module YNAB
|
|
|
199
199
|
}
|
|
200
200
|
end
|
|
201
201
|
|
|
202
|
+
# Returns attribute mapping this model knows about
|
|
203
|
+
def self.acceptable_attribute_map
|
|
204
|
+
attribute_map
|
|
205
|
+
end
|
|
206
|
+
|
|
202
207
|
# Returns all the JSON keys this model knows about
|
|
203
208
|
def self.acceptable_attributes
|
|
204
|
-
|
|
209
|
+
acceptable_attribute_map.values
|
|
205
210
|
end
|
|
206
211
|
|
|
207
212
|
# Attribute type mapping.
|
|
@@ -254,7 +259,23 @@ module YNAB
|
|
|
254
259
|
# List of attributes with nullable: true
|
|
255
260
|
def self.openapi_nullable
|
|
256
261
|
Set.new([
|
|
262
|
+
:'original_category_group_id',
|
|
263
|
+
:'note',
|
|
257
264
|
:'goal_type',
|
|
265
|
+
:'goal_needs_whole_amount',
|
|
266
|
+
:'goal_day',
|
|
267
|
+
:'goal_cadence',
|
|
268
|
+
:'goal_cadence_frequency',
|
|
269
|
+
:'goal_creation_month',
|
|
270
|
+
:'goal_target',
|
|
271
|
+
:'goal_target_month',
|
|
272
|
+
:'goal_target_date',
|
|
273
|
+
:'goal_percentage_complete',
|
|
274
|
+
:'goal_months_to_budget',
|
|
275
|
+
:'goal_under_funded',
|
|
276
|
+
:'goal_overall_funded',
|
|
277
|
+
:'goal_overall_left',
|
|
278
|
+
:'goal_snoozed_at',
|
|
258
279
|
:'goal_target_formatted',
|
|
259
280
|
:'goal_target_currency',
|
|
260
281
|
:'goal_under_funded_formatted',
|
|
@@ -266,6 +287,16 @@ module YNAB
|
|
|
266
287
|
])
|
|
267
288
|
end
|
|
268
289
|
|
|
290
|
+
# Returns attribute type mapping
|
|
291
|
+
def self.acceptable_openapi_types
|
|
292
|
+
openapi_types
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Returns the nullable attributes
|
|
296
|
+
def self.acceptable_openapi_nullable
|
|
297
|
+
openapi_nullable
|
|
298
|
+
end
|
|
299
|
+
|
|
269
300
|
# List of class defined in allOf (OpenAPI v3)
|
|
270
301
|
def self.openapi_all_of
|
|
271
302
|
[
|
|
@@ -281,9 +312,10 @@ module YNAB
|
|
|
281
312
|
end
|
|
282
313
|
|
|
283
314
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
315
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
284
316
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
285
|
-
if (!
|
|
286
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::Category`. Please check the name to make sure it's valid. List of attributes: " +
|
|
317
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
318
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::Category`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
287
319
|
end
|
|
288
320
|
h[k.to_sym] = v
|
|
289
321
|
}
|
|
@@ -549,18 +581,20 @@ module YNAB
|
|
|
549
581
|
def self.build_from_hash(attributes)
|
|
550
582
|
return nil unless attributes.is_a?(Hash)
|
|
551
583
|
attributes = attributes.transform_keys(&:to_sym)
|
|
584
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
585
|
+
map = acceptable_attribute_map
|
|
552
586
|
transformed_hash = {}
|
|
553
|
-
|
|
554
|
-
if attributes.key?(
|
|
587
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
588
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
555
589
|
transformed_hash["#{key}"] = nil
|
|
556
590
|
elsif type =~ /\AArray<(.*)>/i
|
|
557
591
|
# check to ensure the input is an array given that the attribute
|
|
558
592
|
# is documented as an array but the input is not
|
|
559
|
-
if attributes[
|
|
560
|
-
transformed_hash["#{key}"] = attributes[
|
|
593
|
+
if attributes[map[key]].is_a?(Array)
|
|
594
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
561
595
|
end
|
|
562
|
-
elsif !attributes[
|
|
563
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
596
|
+
elsif !attributes[map[key]].nil?
|
|
597
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
564
598
|
end
|
|
565
599
|
end
|
|
566
600
|
new(transformed_hash)
|
|
@@ -570,10 +604,11 @@ module YNAB
|
|
|
570
604
|
# @return [Hash] Returns the object in the form of hash
|
|
571
605
|
def to_hash
|
|
572
606
|
hash = {}
|
|
573
|
-
|
|
607
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
608
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
574
609
|
value = self.send(attr)
|
|
575
610
|
if value.nil?
|
|
576
|
-
is_nullable = self.class.
|
|
611
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
577
612
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
578
613
|
end
|
|
579
614
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
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
|
|
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. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -143,9 +143,14 @@ module YNAB
|
|
|
143
143
|
}
|
|
144
144
|
end
|
|
145
145
|
|
|
146
|
+
# Returns attribute mapping this model knows about
|
|
147
|
+
def self.acceptable_attribute_map
|
|
148
|
+
attribute_map
|
|
149
|
+
end
|
|
150
|
+
|
|
146
151
|
# Returns all the JSON keys this model knows about
|
|
147
152
|
def self.acceptable_attributes
|
|
148
|
-
|
|
153
|
+
acceptable_attribute_map.values
|
|
149
154
|
end
|
|
150
155
|
|
|
151
156
|
# Attribute type mapping.
|
|
@@ -204,6 +209,16 @@ module YNAB
|
|
|
204
209
|
])
|
|
205
210
|
end
|
|
206
211
|
|
|
212
|
+
# Returns attribute type mapping
|
|
213
|
+
def self.acceptable_openapi_types
|
|
214
|
+
openapi_types
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Returns the nullable attributes
|
|
218
|
+
def self.acceptable_openapi_nullable
|
|
219
|
+
openapi_nullable
|
|
220
|
+
end
|
|
221
|
+
|
|
207
222
|
# Initializes the object
|
|
208
223
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
209
224
|
def initialize(attributes = {})
|
|
@@ -212,9 +227,10 @@ module YNAB
|
|
|
212
227
|
end
|
|
213
228
|
|
|
214
229
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
230
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
215
231
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
216
|
-
if (!
|
|
217
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoryBase`. Please check the name to make sure it's valid. List of attributes: " +
|
|
232
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
233
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::CategoryBase`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
218
234
|
end
|
|
219
235
|
h[k.to_sym] = v
|
|
220
236
|
}
|
|
@@ -410,18 +426,20 @@ module YNAB
|
|
|
410
426
|
def self.build_from_hash(attributes)
|
|
411
427
|
return nil unless attributes.is_a?(Hash)
|
|
412
428
|
attributes = attributes.transform_keys(&:to_sym)
|
|
429
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
430
|
+
map = acceptable_attribute_map
|
|
413
431
|
transformed_hash = {}
|
|
414
|
-
|
|
415
|
-
if attributes.key?(
|
|
432
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
433
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
416
434
|
transformed_hash["#{key}"] = nil
|
|
417
435
|
elsif type =~ /\AArray<(.*)>/i
|
|
418
436
|
# check to ensure the input is an array given that the attribute
|
|
419
437
|
# is documented as an array but the input is not
|
|
420
|
-
if attributes[
|
|
421
|
-
transformed_hash["#{key}"] = attributes[
|
|
438
|
+
if attributes[map[key]].is_a?(Array)
|
|
439
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
422
440
|
end
|
|
423
|
-
elsif !attributes[
|
|
424
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
441
|
+
elsif !attributes[map[key]].nil?
|
|
442
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
425
443
|
end
|
|
426
444
|
end
|
|
427
445
|
new(transformed_hash)
|
|
@@ -431,10 +449,11 @@ module YNAB
|
|
|
431
449
|
# @return [Hash] Returns the object in the form of hash
|
|
432
450
|
def to_hash
|
|
433
451
|
hash = {}
|
|
434
|
-
|
|
452
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
453
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
435
454
|
value = self.send(attr)
|
|
436
455
|
if value.nil?
|
|
437
|
-
is_nullable = self.class.
|
|
456
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
438
457
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
439
458
|
end
|
|
440
459
|
|