ynab 1.16.0 → 1.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ynab.rb +3 -1
  3. data/lib/ynab/api/accounts_api.rb +1 -1
  4. data/lib/ynab/api/budgets_api.rb +1 -1
  5. data/lib/ynab/api/categories_api.rb +1 -1
  6. data/lib/ynab/api/deprecated_api.rb +1 -1
  7. data/lib/ynab/api/months_api.rb +1 -1
  8. data/lib/ynab/api/payee_locations_api.rb +1 -1
  9. data/lib/ynab/api/payees_api.rb +1 -1
  10. data/lib/ynab/api/scheduled_transactions_api.rb +1 -1
  11. data/lib/ynab/api/transactions_api.rb +53 -1
  12. data/lib/ynab/api/user_api.rb +1 -1
  13. data/lib/ynab/api_client.rb +1 -1
  14. data/lib/ynab/configuration.rb +1 -1
  15. data/lib/ynab/models/account.rb +3 -2
  16. data/lib/ynab/models/account_response.rb +3 -2
  17. data/lib/ynab/models/account_response_data.rb +3 -2
  18. data/lib/ynab/models/accounts_response.rb +3 -2
  19. data/lib/ynab/models/accounts_response_data.rb +3 -2
  20. data/lib/ynab/models/budget_detail.rb +3 -2
  21. data/lib/ynab/models/budget_detail_response.rb +3 -2
  22. data/lib/ynab/models/budget_detail_response_data.rb +3 -2
  23. data/lib/ynab/models/budget_settings.rb +3 -2
  24. data/lib/ynab/models/budget_settings_response.rb +3 -2
  25. data/lib/ynab/models/budget_settings_response_data.rb +3 -2
  26. data/lib/ynab/models/budget_summary.rb +3 -2
  27. data/lib/ynab/models/budget_summary_response.rb +3 -2
  28. data/lib/ynab/models/budget_summary_response_data.rb +3 -2
  29. data/lib/ynab/models/bulk_response.rb +3 -2
  30. data/lib/ynab/models/bulk_response_data.rb +3 -2
  31. data/lib/ynab/models/bulk_response_data_bulk.rb +3 -2
  32. data/lib/ynab/models/bulk_transactions.rb +3 -2
  33. data/lib/ynab/models/categories_response.rb +3 -2
  34. data/lib/ynab/models/categories_response_data.rb +3 -2
  35. data/lib/ynab/models/category.rb +3 -2
  36. data/lib/ynab/models/category_group.rb +3 -2
  37. data/lib/ynab/models/category_group_with_categories.rb +3 -2
  38. data/lib/ynab/models/category_response.rb +3 -2
  39. data/lib/ynab/models/category_response_data.rb +3 -2
  40. data/lib/ynab/models/currency_format.rb +3 -2
  41. data/lib/ynab/models/date_format.rb +3 -2
  42. data/lib/ynab/models/error_detail.rb +3 -2
  43. data/lib/ynab/models/error_response.rb +3 -2
  44. data/lib/ynab/models/hybrid_transaction.rb +3 -2
  45. data/lib/ynab/models/hybrid_transactions_response.rb +3 -2
  46. data/lib/ynab/models/hybrid_transactions_response_data.rb +3 -2
  47. data/lib/ynab/models/month_detail.rb +3 -2
  48. data/lib/ynab/models/month_detail_response.rb +3 -2
  49. data/lib/ynab/models/month_detail_response_data.rb +3 -2
  50. data/lib/ynab/models/month_summaries_response.rb +3 -2
  51. data/lib/ynab/models/month_summaries_response_data.rb +3 -2
  52. data/lib/ynab/models/month_summary.rb +3 -2
  53. data/lib/ynab/models/payee.rb +3 -2
  54. data/lib/ynab/models/payee_location.rb +3 -2
  55. data/lib/ynab/models/payee_location_response.rb +3 -2
  56. data/lib/ynab/models/payee_location_response_data.rb +3 -2
  57. data/lib/ynab/models/payee_locations_response.rb +3 -2
  58. data/lib/ynab/models/payee_locations_response_data.rb +3 -2
  59. data/lib/ynab/models/payee_response.rb +3 -2
  60. data/lib/ynab/models/payee_response_data.rb +3 -2
  61. data/lib/ynab/models/payees_response.rb +3 -2
  62. data/lib/ynab/models/payees_response_data.rb +3 -2
  63. data/lib/ynab/models/save_category_response.rb +3 -2
  64. data/lib/ynab/models/save_category_response_data.rb +3 -2
  65. data/lib/ynab/models/save_month_category.rb +3 -2
  66. data/lib/ynab/models/save_month_category_wrapper.rb +3 -2
  67. data/lib/ynab/models/save_sub_transaction.rb +4 -3
  68. data/lib/ynab/models/save_transaction.rb +3 -2
  69. data/lib/ynab/models/save_transaction_wrapper.rb +3 -2
  70. data/lib/ynab/models/save_transactions_response.rb +3 -2
  71. data/lib/ynab/models/save_transactions_response_data.rb +3 -2
  72. data/lib/ynab/models/save_transactions_wrapper.rb +3 -2
  73. data/lib/ynab/models/scheduled_sub_transaction.rb +3 -2
  74. data/lib/ynab/models/scheduled_transaction_detail.rb +3 -2
  75. data/lib/ynab/models/scheduled_transaction_response.rb +3 -2
  76. data/lib/ynab/models/scheduled_transaction_response_data.rb +3 -2
  77. data/lib/ynab/models/scheduled_transaction_summary.rb +3 -2
  78. data/lib/ynab/models/scheduled_transactions_response.rb +3 -2
  79. data/lib/ynab/models/scheduled_transactions_response_data.rb +3 -2
  80. data/lib/ynab/models/sub_transaction.rb +3 -2
  81. data/lib/ynab/models/transaction_detail.rb +3 -2
  82. data/lib/ynab/models/transaction_response.rb +3 -2
  83. data/lib/ynab/models/transaction_response_data.rb +3 -2
  84. data/lib/ynab/models/transaction_summary.rb +3 -2
  85. data/lib/ynab/models/transactions_import_response.rb +189 -0
  86. data/lib/ynab/models/transactions_import_response_data.rb +192 -0
  87. data/lib/ynab/models/transactions_response.rb +3 -2
  88. data/lib/ynab/models/transactions_response_data.rb +3 -2
  89. data/lib/ynab/models/update_transaction.rb +3 -2
  90. data/lib/ynab/models/update_transactions_wrapper.rb +3 -2
  91. data/lib/ynab/models/user.rb +3 -2
  92. data/lib/ynab/models/user_response.rb +3 -2
  93. data/lib/ynab/models/user_response_data.rb +3 -2
  94. data/lib/ynab/version.rb +1 -1
  95. metadata +4 -2
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.12
9
+ Swagger Codegen version: 2.4.13
10
10
 
11
11
  =end
12
12
 
@@ -349,7 +349,7 @@ module YNAB
349
349
  return nil unless attributes.is_a?(Hash)
350
350
  self.class.swagger_types.each_pair do |key, type|
351
351
  if type =~ /\AArray<(.*)>/i
352
- # check to ensure the input is an array given that the the attribute
352
+ # check to ensure the input is an array given that the attribute
353
353
  # is documented as an array but the input is not
354
354
  if attributes[self.class.attribute_map[key]].is_a?(Array)
355
355
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -445,5 +445,6 @@ module YNAB
445
445
  value
446
446
  end
447
447
  end
448
+
448
449
  end
449
450
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.12
9
+ Swagger Codegen version: 2.4.13
10
10
 
11
11
  =end
12
12
 
@@ -88,7 +88,7 @@ module YNAB
88
88
  return nil unless attributes.is_a?(Hash)
89
89
  self.class.swagger_types.each_pair do |key, type|
90
90
  if type =~ /\AArray<(.*)>/i
91
- # check to ensure the input is an array given that the the attribute
91
+ # check to ensure the input is an array given that the attribute
92
92
  # is documented as an array but the input is not
93
93
  if attributes[self.class.attribute_map[key]].is_a?(Array)
94
94
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -184,5 +184,6 @@ module YNAB
184
184
  value
185
185
  end
186
186
  end
187
+
187
188
  end
188
189
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.12
9
+ Swagger Codegen version: 2.4.13
10
10
 
11
11
  =end
12
12
 
@@ -88,7 +88,7 @@ module YNAB
88
88
  return nil unless attributes.is_a?(Hash)
89
89
  self.class.swagger_types.each_pair do |key, type|
90
90
  if type =~ /\AArray<(.*)>/i
91
- # check to ensure the input is an array given that the the attribute
91
+ # check to ensure the input is an array given that the attribute
92
92
  # is documented as an array but the input is not
93
93
  if attributes[self.class.attribute_map[key]].is_a?(Array)
94
94
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -184,5 +184,6 @@ module YNAB
184
184
  value
185
185
  end
186
186
  end
187
+
187
188
  end
188
189
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.12
9
+ Swagger Codegen version: 2.4.13
10
10
 
11
11
  =end
12
12
 
@@ -300,7 +300,7 @@ module YNAB
300
300
  return nil unless attributes.is_a?(Hash)
301
301
  self.class.swagger_types.each_pair do |key, type|
302
302
  if type =~ /\AArray<(.*)>/i
303
- # check to ensure the input is an array given that the the attribute
303
+ # check to ensure the input is an array given that the attribute
304
304
  # is documented as an array but the input is not
305
305
  if attributes[self.class.attribute_map[key]].is_a?(Array)
306
306
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -396,5 +396,6 @@ module YNAB
396
396
  value
397
397
  end
398
398
  end
399
+
399
400
  end
400
401
  end
@@ -0,0 +1,189 @@
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.youneedabudget.com
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.13
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module YNAB
16
+ class TransactionsImportResponse
17
+ attr_accessor :data
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'data' => :'data'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.swagger_types
28
+ {
29
+ :'data' => :'TransactionsImportResponseData'
30
+ }
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ return unless attributes.is_a?(Hash)
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
40
+
41
+ if attributes.has_key?(:'data')
42
+ self.data = attributes[:'data']
43
+ end
44
+ end
45
+
46
+ # Show invalid properties with the reasons. Usually used together with valid?
47
+ # @return Array for valid properties with the reasons
48
+ def list_invalid_properties
49
+ invalid_properties = Array.new
50
+ if @data.nil?
51
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
52
+ end
53
+
54
+ invalid_properties
55
+ end
56
+
57
+ # Check to see if the all the properties in the model are valid
58
+ # @return true if the model is valid
59
+ def valid?
60
+ return false if @data.nil?
61
+ true
62
+ end
63
+
64
+ # Checks equality by comparing each attribute.
65
+ # @param [Object] Object to be compared
66
+ def ==(o)
67
+ return true if self.equal?(o)
68
+ self.class == o.class &&
69
+ data == o.data
70
+ end
71
+
72
+ # @see the `==` method
73
+ # @param [Object] Object to be compared
74
+ def eql?(o)
75
+ self == o
76
+ end
77
+
78
+ # Calculates hash code according to all attributes.
79
+ # @return [Fixnum] Hash code
80
+ def hash
81
+ [data].hash
82
+ end
83
+
84
+ # Builds the object from hash
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ # @return [Object] Returns the model itself
87
+ def build_from_hash(attributes)
88
+ return nil unless attributes.is_a?(Hash)
89
+ self.class.swagger_types.each_pair do |key, type|
90
+ if type =~ /\AArray<(.*)>/i
91
+ # check to ensure the input is an array given that the attribute
92
+ # is documented as an array but the input is not
93
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
94
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
95
+ end
96
+ elsif !attributes[self.class.attribute_map[key]].nil?
97
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
98
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
99
+ end
100
+
101
+ self
102
+ end
103
+
104
+ # Deserializes the data based on type
105
+ # @param string type Data type
106
+ # @param string value Value to be deserialized
107
+ # @return [Object] Deserialized data
108
+ def _deserialize(type, value)
109
+ case type.to_sym
110
+ when :DateTime
111
+ DateTime.parse(value)
112
+ when :Date
113
+ Date.parse(value)
114
+ when :String
115
+ value.to_s
116
+ when :Integer
117
+ value.to_i
118
+ when :Float
119
+ value.to_f
120
+ when :BOOLEAN
121
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
122
+ true
123
+ else
124
+ false
125
+ end
126
+ when :Object
127
+ # generic object (usually a Hash), return directly
128
+ value
129
+ when /\AArray<(?<inner_type>.+)>\z/
130
+ inner_type = Regexp.last_match[:inner_type]
131
+ value.map { |v| _deserialize(inner_type, v) }
132
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
133
+ k_type = Regexp.last_match[:k_type]
134
+ v_type = Regexp.last_match[:v_type]
135
+ {}.tap do |hash|
136
+ value.each do |k, v|
137
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
138
+ end
139
+ end
140
+ else # model
141
+ temp_model = YNAB.const_get(type).new
142
+ temp_model.build_from_hash(value)
143
+ end
144
+ end
145
+
146
+ # Returns the string representation of the object
147
+ # @return [String] String presentation of the object
148
+ def to_s
149
+ to_hash.to_s
150
+ end
151
+
152
+ # to_body is an alias to to_hash (backward compatibility)
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_body
155
+ to_hash
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ next if value.nil?
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ # Outputs non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ # @param [Object] value Any valid value
173
+ # @return [Hash] Returns the value in the form of hash
174
+ def _to_hash(value)
175
+ if value.is_a?(Array)
176
+ value.compact.map { |v| _to_hash(v) }
177
+ elsif value.is_a?(Hash)
178
+ {}.tap do |hash|
179
+ value.each { |k, v| hash[k] = _to_hash(v) }
180
+ end
181
+ elsif value.respond_to? :to_hash
182
+ value.to_hash
183
+ else
184
+ value
185
+ end
186
+ end
187
+
188
+ end
189
+ end
@@ -0,0 +1,192 @@
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.youneedabudget.com
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.13
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module YNAB
16
+ class TransactionsImportResponseData
17
+ # The list of transaction ids that were imported.
18
+ attr_accessor :transaction_ids
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'transaction_ids' => :'transaction_ids'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ :'transaction_ids' => :'Array<String>'
31
+ }
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ return unless attributes.is_a?(Hash)
38
+
39
+ # convert string to symbol for hash key
40
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
41
+
42
+ if attributes.has_key?(:'transaction_ids')
43
+ if (value = attributes[:'transaction_ids']).is_a?(Array)
44
+ self.transaction_ids = value
45
+ end
46
+ end
47
+ end
48
+
49
+ # Show invalid properties with the reasons. Usually used together with valid?
50
+ # @return Array for valid properties with the reasons
51
+ def list_invalid_properties
52
+ invalid_properties = Array.new
53
+ if @transaction_ids.nil?
54
+ invalid_properties.push('invalid value for "transaction_ids", transaction_ids cannot be nil.')
55
+ end
56
+
57
+ invalid_properties
58
+ end
59
+
60
+ # Check to see if the all the properties in the model are valid
61
+ # @return true if the model is valid
62
+ def valid?
63
+ return false if @transaction_ids.nil?
64
+ true
65
+ end
66
+
67
+ # Checks equality by comparing each attribute.
68
+ # @param [Object] Object to be compared
69
+ def ==(o)
70
+ return true if self.equal?(o)
71
+ self.class == o.class &&
72
+ transaction_ids == o.transaction_ids
73
+ end
74
+
75
+ # @see the `==` method
76
+ # @param [Object] Object to be compared
77
+ def eql?(o)
78
+ self == o
79
+ end
80
+
81
+ # Calculates hash code according to all attributes.
82
+ # @return [Fixnum] Hash code
83
+ def hash
84
+ [transaction_ids].hash
85
+ end
86
+
87
+ # Builds the object from hash
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ # @return [Object] Returns the model itself
90
+ def build_from_hash(attributes)
91
+ return nil unless attributes.is_a?(Hash)
92
+ self.class.swagger_types.each_pair do |key, type|
93
+ if type =~ /\AArray<(.*)>/i
94
+ # check to ensure the input is an array given that the attribute
95
+ # is documented as an array but the input is not
96
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
97
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
98
+ end
99
+ elsif !attributes[self.class.attribute_map[key]].nil?
100
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
101
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
102
+ end
103
+
104
+ self
105
+ end
106
+
107
+ # Deserializes the data based on type
108
+ # @param string type Data type
109
+ # @param string value Value to be deserialized
110
+ # @return [Object] Deserialized data
111
+ def _deserialize(type, value)
112
+ case type.to_sym
113
+ when :DateTime
114
+ DateTime.parse(value)
115
+ when :Date
116
+ Date.parse(value)
117
+ when :String
118
+ value.to_s
119
+ when :Integer
120
+ value.to_i
121
+ when :Float
122
+ value.to_f
123
+ when :BOOLEAN
124
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
125
+ true
126
+ else
127
+ false
128
+ end
129
+ when :Object
130
+ # generic object (usually a Hash), return directly
131
+ value
132
+ when /\AArray<(?<inner_type>.+)>\z/
133
+ inner_type = Regexp.last_match[:inner_type]
134
+ value.map { |v| _deserialize(inner_type, v) }
135
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
136
+ k_type = Regexp.last_match[:k_type]
137
+ v_type = Regexp.last_match[:v_type]
138
+ {}.tap do |hash|
139
+ value.each do |k, v|
140
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
141
+ end
142
+ end
143
+ else # model
144
+ temp_model = YNAB.const_get(type).new
145
+ temp_model.build_from_hash(value)
146
+ end
147
+ end
148
+
149
+ # Returns the string representation of the object
150
+ # @return [String] String presentation of the object
151
+ def to_s
152
+ to_hash.to_s
153
+ end
154
+
155
+ # to_body is an alias to to_hash (backward compatibility)
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_body
158
+ to_hash
159
+ end
160
+
161
+ # Returns the object in the form of hash
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_hash
164
+ hash = {}
165
+ self.class.attribute_map.each_pair do |attr, param|
166
+ value = self.send(attr)
167
+ next if value.nil?
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ # Outputs non-array value in the form of hash
174
+ # For object, use to_hash. Otherwise, just return the value
175
+ # @param [Object] value Any valid value
176
+ # @return [Hash] Returns the value in the form of hash
177
+ def _to_hash(value)
178
+ if value.is_a?(Array)
179
+ value.compact.map { |v| _to_hash(v) }
180
+ elsif value.is_a?(Hash)
181
+ {}.tap do |hash|
182
+ value.each { |k, v| hash[k] = _to_hash(v) }
183
+ end
184
+ elsif value.respond_to? :to_hash
185
+ value.to_hash
186
+ else
187
+ value
188
+ end
189
+ end
190
+
191
+ end
192
+ end