ynab 1.11.0 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ynab.rb +23 -21
  3. data/lib/ynab/api/categories_api.rb +3 -3
  4. data/lib/ynab/models/account_response.rb +1 -1
  5. data/lib/ynab/models/{account_wrapper.rb → account_response_data.rb} +1 -1
  6. data/lib/ynab/models/accounts_response.rb +1 -1
  7. data/lib/ynab/models/{accounts_wrapper.rb → accounts_response_data.rb} +1 -1
  8. data/lib/ynab/models/budget_detail_response.rb +1 -1
  9. data/lib/ynab/models/{budget_detail_wrapper.rb → budget_detail_response_data.rb} +1 -1
  10. data/lib/ynab/models/budget_settings_response.rb +1 -1
  11. data/lib/ynab/models/{budget_settings_wrapper.rb → budget_settings_response_data.rb} +1 -1
  12. data/lib/ynab/models/budget_summary_response.rb +1 -1
  13. data/lib/ynab/models/{budget_summary_wrapper.rb → budget_summary_response_data.rb} +1 -1
  14. data/lib/ynab/models/bulk_response.rb +1 -1
  15. data/lib/ynab/models/{bulk_id_wrapper.rb → bulk_response_data.rb} +2 -2
  16. data/lib/ynab/models/{bulk_ids.rb → bulk_response_data_bulk.rb} +1 -1
  17. data/lib/ynab/models/categories_response.rb +1 -1
  18. data/lib/ynab/models/{category_groups_wrapper.rb → categories_response_data.rb} +1 -1
  19. data/lib/ynab/models/category_response.rb +1 -1
  20. data/lib/ynab/models/category_response_data.rb +188 -0
  21. data/lib/ynab/models/hybrid_transactions_response.rb +1 -1
  22. data/lib/ynab/models/{hybrid_transactions_wrapper.rb → hybrid_transactions_response_data.rb} +1 -1
  23. data/lib/ynab/models/month_detail_response.rb +1 -1
  24. data/lib/ynab/models/{month_detail_wrapper.rb → month_detail_response_data.rb} +1 -1
  25. data/lib/ynab/models/month_summaries_response.rb +1 -1
  26. data/lib/ynab/models/{month_summaries_wrapper.rb → month_summaries_response_data.rb} +1 -1
  27. data/lib/ynab/models/payee_location_response.rb +1 -1
  28. data/lib/ynab/models/{payee_location_wrapper.rb → payee_location_response_data.rb} +1 -1
  29. data/lib/ynab/models/payee_locations_response.rb +1 -1
  30. data/lib/ynab/models/{payee_locations_wrapper.rb → payee_locations_response_data.rb} +1 -1
  31. data/lib/ynab/models/payee_response.rb +1 -1
  32. data/lib/ynab/models/{payee_wrapper.rb → payee_response_data.rb} +1 -1
  33. data/lib/ynab/models/payees_response.rb +1 -1
  34. data/lib/ynab/models/{payees_wrapper.rb → payees_response_data.rb} +1 -1
  35. data/lib/ynab/models/save_category_response.rb +188 -0
  36. data/lib/ynab/models/{category_wrapper.rb → save_category_response_data.rb} +1 -1
  37. data/lib/ynab/models/scheduled_transaction_response.rb +1 -1
  38. data/lib/ynab/models/{scheduled_transaction_wrapper.rb → scheduled_transaction_response_data.rb} +1 -1
  39. data/lib/ynab/models/scheduled_transactions_response.rb +1 -1
  40. data/lib/ynab/models/{scheduled_transactions_wrapper.rb → scheduled_transactions_response_data.rb} +1 -1
  41. data/lib/ynab/models/transaction_response.rb +1 -1
  42. data/lib/ynab/models/{transaction_wrapper.rb → transaction_response_data.rb} +1 -1
  43. data/lib/ynab/models/transactions_response.rb +1 -1
  44. data/lib/ynab/models/{transactions_wrapper.rb → transactions_response_data.rb} +1 -1
  45. data/lib/ynab/models/user_response.rb +1 -1
  46. data/lib/ynab/models/{user_wrapper.rb → user_response_data.rb} +1 -1
  47. data/lib/ynab/version.rb +1 -1
  48. metadata +26 -27
  49. data/lib/ynab/models/bulk_transaction_create_response.rb +0 -193
  50. data/lib/ynab/models/bulk_transaction_ids.rb +0 -195
@@ -1,193 +0,0 @@
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.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module YNAB
16
-
17
- class BulkTransactionCreateResponse
18
- attr_accessor :data
19
-
20
-
21
- # Attribute mapping from ruby-style variable name to JSON key.
22
- def self.attribute_map
23
- {
24
- :'data' => :'data'
25
- }
26
- end
27
-
28
- # Attribute type mapping.
29
- def self.swagger_types
30
- {
31
- :'data' => :'BulkTransactionIds'
32
- }
33
- end
34
-
35
- # Initializes the object
36
- # @param [Hash] attributes Model attributes in the form of hash
37
- def initialize(attributes = {})
38
- return unless attributes.is_a?(Hash)
39
-
40
- # convert string to symbol for hash key
41
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
42
-
43
- if attributes.has_key?(:'data')
44
- self.data = attributes[:'data']
45
- end
46
-
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 @data.nil?
54
- invalid_properties.push("invalid value for 'data', data cannot be nil.")
55
- end
56
-
57
- return 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 @data.nil?
64
- return 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
- data == o.data
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
- [data].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 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
-
193
- end
@@ -1,195 +0,0 @@
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.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module YNAB
16
-
17
- class BulkTransactionIds
18
- attr_accessor :transaction_ids
19
-
20
-
21
- # Attribute mapping from ruby-style variable name to JSON key.
22
- def self.attribute_map
23
- {
24
- :'transaction_ids' => :'transaction_ids'
25
- }
26
- end
27
-
28
- # Attribute type mapping.
29
- def self.swagger_types
30
- {
31
- :'transaction_ids' => :'Array<String>'
32
- }
33
- end
34
-
35
- # Initializes the object
36
- # @param [Hash] attributes Model attributes in the form of hash
37
- def initialize(attributes = {})
38
- return unless attributes.is_a?(Hash)
39
-
40
- # convert string to symbol for hash key
41
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
42
-
43
- if attributes.has_key?(:'transaction_ids')
44
- if (value = attributes[:'transaction_ids']).is_a?(Array)
45
- self.transaction_ids = value
46
- end
47
- end
48
-
49
- end
50
-
51
- # Show invalid properties with the reasons. Usually used together with valid?
52
- # @return Array for valid properties with the reasons
53
- def list_invalid_properties
54
- invalid_properties = Array.new
55
- if @transaction_ids.nil?
56
- invalid_properties.push("invalid value for 'transaction_ids', transaction_ids cannot be nil.")
57
- end
58
-
59
- return invalid_properties
60
- end
61
-
62
- # Check to see if the all the properties in the model are valid
63
- # @return true if the model is valid
64
- def valid?
65
- return false if @transaction_ids.nil?
66
- return true
67
- end
68
-
69
- # Checks equality by comparing each attribute.
70
- # @param [Object] Object to be compared
71
- def ==(o)
72
- return true if self.equal?(o)
73
- self.class == o.class &&
74
- transaction_ids == o.transaction_ids
75
- end
76
-
77
- # @see the `==` method
78
- # @param [Object] Object to be compared
79
- def eql?(o)
80
- self == o
81
- end
82
-
83
- # Calculates hash code according to all attributes.
84
- # @return [Fixnum] Hash code
85
- def hash
86
- [transaction_ids].hash
87
- end
88
-
89
- # Builds the object from hash
90
- # @param [Hash] attributes Model attributes in the form of hash
91
- # @return [Object] Returns the model itself
92
- def build_from_hash(attributes)
93
- return nil unless attributes.is_a?(Hash)
94
- self.class.swagger_types.each_pair do |key, type|
95
- if type =~ /\AArray<(.*)>/i
96
- # check to ensure the input is an array given that the the attribute
97
- # is documented as an array but the input is not
98
- if attributes[self.class.attribute_map[key]].is_a?(Array)
99
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
100
- end
101
- elsif !attributes[self.class.attribute_map[key]].nil?
102
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
103
- end # or else data not found in attributes(hash), not an issue as the data can be optional
104
- end
105
-
106
- self
107
- end
108
-
109
- # Deserializes the data based on type
110
- # @param string type Data type
111
- # @param string value Value to be deserialized
112
- # @return [Object] Deserialized data
113
- def _deserialize(type, value)
114
- case type.to_sym
115
- when :DateTime
116
- DateTime.parse(value)
117
- when :Date
118
- Date.parse(value)
119
- when :String
120
- value.to_s
121
- when :Integer
122
- value.to_i
123
- when :Float
124
- value.to_f
125
- when :BOOLEAN
126
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
127
- true
128
- else
129
- false
130
- end
131
- when :Object
132
- # generic object (usually a Hash), return directly
133
- value
134
- when /\AArray<(?<inner_type>.+)>\z/
135
- inner_type = Regexp.last_match[:inner_type]
136
- value.map { |v| _deserialize(inner_type, v) }
137
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
138
- k_type = Regexp.last_match[:k_type]
139
- v_type = Regexp.last_match[:v_type]
140
- {}.tap do |hash|
141
- value.each do |k, v|
142
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
143
- end
144
- end
145
- else # model
146
- temp_model = YNAB.const_get(type).new
147
- temp_model.build_from_hash(value)
148
- end
149
- end
150
-
151
- # Returns the string representation of the object
152
- # @return [String] String presentation of the object
153
- def to_s
154
- to_hash.to_s
155
- end
156
-
157
- # to_body is an alias to to_hash (backward compatibility)
158
- # @return [Hash] Returns the object in the form of hash
159
- def to_body
160
- to_hash
161
- end
162
-
163
- # Returns the object in the form of hash
164
- # @return [Hash] Returns the object in the form of hash
165
- def to_hash
166
- hash = {}
167
- self.class.attribute_map.each_pair do |attr, param|
168
- value = self.send(attr)
169
- next if value.nil?
170
- hash[param] = _to_hash(value)
171
- end
172
- hash
173
- end
174
-
175
- # Outputs non-array value in the form of hash
176
- # For object, use to_hash. Otherwise, just return the value
177
- # @param [Object] value Any valid value
178
- # @return [Hash] Returns the value in the form of hash
179
- def _to_hash(value)
180
- if value.is_a?(Array)
181
- value.compact.map{ |v| _to_hash(v) }
182
- elsif value.is_a?(Hash)
183
- {}.tap do |hash|
184
- value.each { |k, v| hash[k] = _to_hash(v) }
185
- end
186
- elsif value.respond_to? :to_hash
187
- value.to_hash
188
- else
189
- value
190
- end
191
- end
192
-
193
- end
194
-
195
- end