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
|
|
|
@@ -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::PutScheduledTransactionWrapper`. 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::PutScheduledTransactionWrapper`. 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
|
|
|
@@ -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::PutTransactionWrapper`. 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::PutTransactionWrapper`. 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
|
|
|
@@ -51,9 +51,14 @@ module YNAB
|
|
|
51
51
|
}
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
+
# Returns attribute mapping this model knows about
|
|
55
|
+
def self.acceptable_attribute_map
|
|
56
|
+
attribute_map
|
|
57
|
+
end
|
|
58
|
+
|
|
54
59
|
# Returns all the JSON keys this model knows about
|
|
55
60
|
def self.acceptable_attributes
|
|
56
|
-
|
|
61
|
+
acceptable_attribute_map.values
|
|
57
62
|
end
|
|
58
63
|
|
|
59
64
|
# Attribute type mapping.
|
|
@@ -71,6 +76,16 @@ module YNAB
|
|
|
71
76
|
])
|
|
72
77
|
end
|
|
73
78
|
|
|
79
|
+
# Returns attribute type mapping
|
|
80
|
+
def self.acceptable_openapi_types
|
|
81
|
+
openapi_types
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Returns the nullable attributes
|
|
85
|
+
def self.acceptable_openapi_nullable
|
|
86
|
+
openapi_nullable
|
|
87
|
+
end
|
|
88
|
+
|
|
74
89
|
# Initializes the object
|
|
75
90
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
76
91
|
def initialize(attributes = {})
|
|
@@ -79,9 +94,10 @@ module YNAB
|
|
|
79
94
|
end
|
|
80
95
|
|
|
81
96
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
97
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
82
98
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
83
|
-
if (!
|
|
84
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveAccount`. Please check the name to make sure it's valid. List of attributes: " +
|
|
99
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
100
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveAccount`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
85
101
|
end
|
|
86
102
|
h[k.to_sym] = v
|
|
87
103
|
}
|
|
@@ -143,18 +159,20 @@ module YNAB
|
|
|
143
159
|
def self.build_from_hash(attributes)
|
|
144
160
|
return nil unless attributes.is_a?(Hash)
|
|
145
161
|
attributes = attributes.transform_keys(&:to_sym)
|
|
162
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
163
|
+
map = acceptable_attribute_map
|
|
146
164
|
transformed_hash = {}
|
|
147
|
-
|
|
148
|
-
if attributes.key?(
|
|
165
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
166
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
149
167
|
transformed_hash["#{key}"] = nil
|
|
150
168
|
elsif type =~ /\AArray<(.*)>/i
|
|
151
169
|
# check to ensure the input is an array given that the attribute
|
|
152
170
|
# is documented as an array but the input is not
|
|
153
|
-
if attributes[
|
|
154
|
-
transformed_hash["#{key}"] = attributes[
|
|
171
|
+
if attributes[map[key]].is_a?(Array)
|
|
172
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
155
173
|
end
|
|
156
|
-
elsif !attributes[
|
|
157
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
174
|
+
elsif !attributes[map[key]].nil?
|
|
175
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
158
176
|
end
|
|
159
177
|
end
|
|
160
178
|
new(transformed_hash)
|
|
@@ -164,10 +182,11 @@ module YNAB
|
|
|
164
182
|
# @return [Hash] Returns the object in the form of hash
|
|
165
183
|
def to_hash
|
|
166
184
|
hash = {}
|
|
167
|
-
|
|
185
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
186
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
168
187
|
value = self.send(attr)
|
|
169
188
|
if value.nil?
|
|
170
|
-
is_nullable = self.class.
|
|
189
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
171
190
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
172
191
|
end
|
|
173
192
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -19,15 +19,40 @@ module YNAB
|
|
|
19
19
|
# The id of the category group to which this category belongs. An internal category group may not be specified.
|
|
20
20
|
attr_accessor :category_group_id
|
|
21
21
|
|
|
22
|
-
# The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly goal will be created for the category with this target amount. If goal_type is not specified, it will default to 'NEED' or 'MF' for Credit Card Payment categories.
|
|
22
|
+
# The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly goal will be created for the category with this target amount. If goal_type is not specified, it will default to 'NEED', or to 'MF' for Credit Card Payment categories and 'DEBT' for categories paired to a loan account. When updating a category, passing null removes any existing target.
|
|
23
23
|
attr_accessor :goal_target
|
|
24
24
|
|
|
25
|
-
# The goal target date in ISO format (e.g. 2016-12-01).
|
|
25
|
+
# The goal target date in ISO format (e.g. 2016-12-01). Not supported for categories paired to a loan account.
|
|
26
26
|
attr_accessor :goal_target_date
|
|
27
27
|
|
|
28
|
-
# Whether the goal requires the full target amount each period. Only supported for 'NEED' goals. When true, the goal is configured as 'Set aside another...'. When false, the goal is configured as 'Refill up to...'.
|
|
28
|
+
# Whether the goal requires the full target amount each period. Only supported for 'NEED' goals, and not supported for Credit Card Payment categories or categories paired to a loan account. When true, the goal is configured as 'Set aside another...'. When false, the goal is configured as 'Refill up to...'.
|
|
29
29
|
attr_accessor :goal_needs_whole_amount
|
|
30
30
|
|
|
31
|
+
# When specified, configures a recurring 'NEED' target of goal_target that repeats at this frequency, replacing any existing target. Requires goal_target. Cannot be combined with goal_target_date and is not supported for Credit Card Payment categories or categories paired to a loan account. Omit to leave an existing target's cadence unchanged.
|
|
32
|
+
attr_accessor :goal_frequency
|
|
33
|
+
|
|
34
|
+
class EnumAttributeValidator
|
|
35
|
+
attr_reader :datatype
|
|
36
|
+
attr_reader :allowable_values
|
|
37
|
+
|
|
38
|
+
def initialize(datatype, allowable_values)
|
|
39
|
+
@allowable_values = allowable_values.map do |value|
|
|
40
|
+
case datatype.to_s
|
|
41
|
+
when /Integer/i
|
|
42
|
+
value.to_i
|
|
43
|
+
when /Float/i
|
|
44
|
+
value.to_f
|
|
45
|
+
else
|
|
46
|
+
value
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def valid?(value)
|
|
52
|
+
!value || allowable_values.include?(value)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
31
56
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
57
|
def self.attribute_map
|
|
33
58
|
{
|
|
@@ -36,13 +61,19 @@ module YNAB
|
|
|
36
61
|
:'category_group_id' => :'category_group_id',
|
|
37
62
|
:'goal_target' => :'goal_target',
|
|
38
63
|
:'goal_target_date' => :'goal_target_date',
|
|
39
|
-
:'goal_needs_whole_amount' => :'goal_needs_whole_amount'
|
|
64
|
+
:'goal_needs_whole_amount' => :'goal_needs_whole_amount',
|
|
65
|
+
:'goal_frequency' => :'goal_frequency'
|
|
40
66
|
}
|
|
41
67
|
end
|
|
42
68
|
|
|
69
|
+
# Returns attribute mapping this model knows about
|
|
70
|
+
def self.acceptable_attribute_map
|
|
71
|
+
attribute_map
|
|
72
|
+
end
|
|
73
|
+
|
|
43
74
|
# Returns all the JSON keys this model knows about
|
|
44
75
|
def self.acceptable_attributes
|
|
45
|
-
|
|
76
|
+
acceptable_attribute_map.values
|
|
46
77
|
end
|
|
47
78
|
|
|
48
79
|
# Attribute type mapping.
|
|
@@ -53,7 +84,8 @@ module YNAB
|
|
|
53
84
|
:'category_group_id' => :'String',
|
|
54
85
|
:'goal_target' => :'Integer',
|
|
55
86
|
:'goal_target_date' => :'Date',
|
|
56
|
-
:'goal_needs_whole_amount' => :'Boolean'
|
|
87
|
+
:'goal_needs_whole_amount' => :'Boolean',
|
|
88
|
+
:'goal_frequency' => :'String'
|
|
57
89
|
}
|
|
58
90
|
end
|
|
59
91
|
|
|
@@ -64,10 +96,20 @@ module YNAB
|
|
|
64
96
|
:'note',
|
|
65
97
|
:'goal_target',
|
|
66
98
|
:'goal_target_date',
|
|
67
|
-
:'goal_needs_whole_amount'
|
|
99
|
+
:'goal_needs_whole_amount',
|
|
68
100
|
])
|
|
69
101
|
end
|
|
70
102
|
|
|
103
|
+
# Returns attribute type mapping
|
|
104
|
+
def self.acceptable_openapi_types
|
|
105
|
+
openapi_types
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Returns the nullable attributes
|
|
109
|
+
def self.acceptable_openapi_nullable
|
|
110
|
+
openapi_nullable
|
|
111
|
+
end
|
|
112
|
+
|
|
71
113
|
# Initializes the object
|
|
72
114
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
73
115
|
def initialize(attributes = {})
|
|
@@ -76,9 +118,10 @@ module YNAB
|
|
|
76
118
|
end
|
|
77
119
|
|
|
78
120
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
121
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
79
122
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
80
|
-
if (!
|
|
81
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveCategory`. Please check the name to make sure it's valid. List of attributes: " +
|
|
123
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
124
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveCategory`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
82
125
|
end
|
|
83
126
|
h[k.to_sym] = v
|
|
84
127
|
}
|
|
@@ -106,6 +149,10 @@ module YNAB
|
|
|
106
149
|
if attributes.key?(:'goal_needs_whole_amount')
|
|
107
150
|
self.goal_needs_whole_amount = attributes[:'goal_needs_whole_amount']
|
|
108
151
|
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'goal_frequency')
|
|
154
|
+
self.goal_frequency = attributes[:'goal_frequency']
|
|
155
|
+
end
|
|
109
156
|
end
|
|
110
157
|
|
|
111
158
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -118,9 +165,17 @@ module YNAB
|
|
|
118
165
|
# Check to see if the all the properties in the model are valid
|
|
119
166
|
# @return true if the model is valid
|
|
120
167
|
def valid?
|
|
168
|
+
goal_frequency_validator = EnumAttributeValidator.new('String', ["monthly", "weekly", "yearly"])
|
|
169
|
+
return false unless goal_frequency_validator.valid?(@goal_frequency)
|
|
121
170
|
true
|
|
122
171
|
end
|
|
123
172
|
|
|
173
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
174
|
+
# @param [Object] goal_frequency Object to be assigned
|
|
175
|
+
def goal_frequency=(goal_frequency)
|
|
176
|
+
@goal_frequency = goal_frequency
|
|
177
|
+
end
|
|
178
|
+
|
|
124
179
|
# Checks equality by comparing each attribute.
|
|
125
180
|
# @param [Object] Object to be compared
|
|
126
181
|
def ==(o)
|
|
@@ -131,7 +186,8 @@ module YNAB
|
|
|
131
186
|
category_group_id == o.category_group_id &&
|
|
132
187
|
goal_target == o.goal_target &&
|
|
133
188
|
goal_target_date == o.goal_target_date &&
|
|
134
|
-
goal_needs_whole_amount == o.goal_needs_whole_amount
|
|
189
|
+
goal_needs_whole_amount == o.goal_needs_whole_amount &&
|
|
190
|
+
goal_frequency == o.goal_frequency
|
|
135
191
|
end
|
|
136
192
|
|
|
137
193
|
# @see the `==` method
|
|
@@ -143,7 +199,7 @@ module YNAB
|
|
|
143
199
|
# Calculates hash code according to all attributes.
|
|
144
200
|
# @return [Integer] Hash code
|
|
145
201
|
def hash
|
|
146
|
-
[name, note, category_group_id, goal_target, goal_target_date, goal_needs_whole_amount].hash
|
|
202
|
+
[name, note, category_group_id, goal_target, goal_target_date, goal_needs_whole_amount, goal_frequency].hash
|
|
147
203
|
end
|
|
148
204
|
|
|
149
205
|
# Builds the object from hash
|
|
@@ -152,18 +208,20 @@ module YNAB
|
|
|
152
208
|
def self.build_from_hash(attributes)
|
|
153
209
|
return nil unless attributes.is_a?(Hash)
|
|
154
210
|
attributes = attributes.transform_keys(&:to_sym)
|
|
211
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
212
|
+
map = acceptable_attribute_map
|
|
155
213
|
transformed_hash = {}
|
|
156
|
-
|
|
157
|
-
if attributes.key?(
|
|
214
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
215
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
158
216
|
transformed_hash["#{key}"] = nil
|
|
159
217
|
elsif type =~ /\AArray<(.*)>/i
|
|
160
218
|
# check to ensure the input is an array given that the attribute
|
|
161
219
|
# is documented as an array but the input is not
|
|
162
|
-
if attributes[
|
|
163
|
-
transformed_hash["#{key}"] = attributes[
|
|
220
|
+
if attributes[map[key]].is_a?(Array)
|
|
221
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
164
222
|
end
|
|
165
|
-
elsif !attributes[
|
|
166
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
223
|
+
elsif !attributes[map[key]].nil?
|
|
224
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
167
225
|
end
|
|
168
226
|
end
|
|
169
227
|
new(transformed_hash)
|
|
@@ -173,10 +231,11 @@ module YNAB
|
|
|
173
231
|
# @return [Hash] Returns the object in the form of hash
|
|
174
232
|
def to_hash
|
|
175
233
|
hash = {}
|
|
176
|
-
|
|
234
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
235
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
177
236
|
value = self.send(attr)
|
|
178
237
|
if value.nil?
|
|
179
|
-
is_nullable = self.class.
|
|
238
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
180
239
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
240
|
end
|
|
182
241
|
|
|
@@ -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
|
|
|
@@ -22,9 +22,14 @@ module YNAB
|
|
|
22
22
|
}
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
# Returns attribute mapping this model knows about
|
|
26
|
+
def self.acceptable_attribute_map
|
|
27
|
+
attribute_map
|
|
28
|
+
end
|
|
29
|
+
|
|
25
30
|
# Returns all the JSON keys this model knows about
|
|
26
31
|
def self.acceptable_attributes
|
|
27
|
-
|
|
32
|
+
acceptable_attribute_map.values
|
|
28
33
|
end
|
|
29
34
|
|
|
30
35
|
# Attribute type mapping.
|
|
@@ -40,6 +45,16 @@ module YNAB
|
|
|
40
45
|
])
|
|
41
46
|
end
|
|
42
47
|
|
|
48
|
+
# Returns attribute type mapping
|
|
49
|
+
def self.acceptable_openapi_types
|
|
50
|
+
openapi_types
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns the nullable attributes
|
|
54
|
+
def self.acceptable_openapi_nullable
|
|
55
|
+
openapi_nullable
|
|
56
|
+
end
|
|
57
|
+
|
|
43
58
|
# Initializes the object
|
|
44
59
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
45
60
|
def initialize(attributes = {})
|
|
@@ -48,9 +63,10 @@ module YNAB
|
|
|
48
63
|
end
|
|
49
64
|
|
|
50
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
51
67
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
52
|
-
if (!
|
|
53
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveCategoryGroup`. Please check the name to make sure it's valid. List of attributes: " +
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::SaveCategoryGroup`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
54
70
|
end
|
|
55
71
|
h[k.to_sym] = v
|
|
56
72
|
}
|
|
@@ -111,18 +127,20 @@ module YNAB
|
|
|
111
127
|
def self.build_from_hash(attributes)
|
|
112
128
|
return nil unless attributes.is_a?(Hash)
|
|
113
129
|
attributes = attributes.transform_keys(&:to_sym)
|
|
130
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
131
|
+
map = acceptable_attribute_map
|
|
114
132
|
transformed_hash = {}
|
|
115
|
-
|
|
116
|
-
if attributes.key?(
|
|
133
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
134
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
117
135
|
transformed_hash["#{key}"] = nil
|
|
118
136
|
elsif type =~ /\AArray<(.*)>/i
|
|
119
137
|
# check to ensure the input is an array given that the attribute
|
|
120
138
|
# is documented as an array but the input is not
|
|
121
|
-
if attributes[
|
|
122
|
-
transformed_hash["#{key}"] = attributes[
|
|
139
|
+
if attributes[map[key]].is_a?(Array)
|
|
140
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
123
141
|
end
|
|
124
|
-
elsif !attributes[
|
|
125
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
142
|
+
elsif !attributes[map[key]].nil?
|
|
143
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
126
144
|
end
|
|
127
145
|
end
|
|
128
146
|
new(transformed_hash)
|
|
@@ -132,10 +150,11 @@ module YNAB
|
|
|
132
150
|
# @return [Hash] Returns the object in the form of hash
|
|
133
151
|
def to_hash
|
|
134
152
|
hash = {}
|
|
135
|
-
|
|
153
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
154
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
136
155
|
value = self.send(attr)
|
|
137
156
|
if value.nil?
|
|
138
|
-
is_nullable = self.class.
|
|
157
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
139
158
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
140
159
|
end
|
|
141
160
|
|