moneykit 0.1.0 → 0.1.2

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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +1 -1
  4. data/docs/Body.md +42 -0
  5. data/docs/LinkCommon.md +2 -0
  6. data/docs/LinkProductRefreshWebhook.md +38 -0
  7. data/docs/LinkProductState.md +15 -0
  8. data/docs/LinkResponse.md +2 -0
  9. data/docs/ResponseHandleLinkWebhookEventRequestBodyWebhookPost.md +42 -0
  10. data/docs/TransactionUpdatesAvailableWebhook.md +30 -0
  11. data/lib/moneykit/models/body.rb +104 -0
  12. data/lib/moneykit/models/link_common.rb +18 -1
  13. data/lib/moneykit/models/link_product_refresh_webhook.rb +417 -0
  14. data/lib/moneykit/models/link_product_state.rb +40 -0
  15. data/lib/moneykit/models/link_response.rb +18 -1
  16. data/lib/moneykit/models/response_handle_link_webhook_event_request_body_webhook_post.rb +104 -0
  17. data/lib/moneykit/models/transaction_updates_available_webhook.rb +358 -0
  18. data/lib/moneykit/version.rb +1 -1
  19. data/lib/moneykit.rb +5 -0
  20. data/spec/models/body_spec.rb +21 -0
  21. data/spec/models/link_product_refresh_webhook_spec.rb +108 -0
  22. data/spec/models/link_product_state_spec.rb +30 -0
  23. data/spec/models/response_handle_link_webhook_event_request_body_webhook_post_spec.rb +21 -0
  24. data/spec/models/transaction_updates_available_webhook_spec.rb +84 -0
  25. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/gem_make.out +5 -5
  26. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  27. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.1.1.1/gem_make.out +5 -5
  28. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.7.3/gem_make.out +5 -5
  29. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.1.0/gem_make.out +5 -5
  30. metadata +118 -98
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77e641853224a0cb54735f617cabd803c57cd155837e9582a9a7164369052476
4
- data.tar.gz: 311fb1b63164f51ba9cb2b65349829d1778ac145d6e5cc768104eaaed187d0cd
3
+ metadata.gz: b6c97743c18c78cbd3a320726d8e18197e0ec16b3f0deed8cba12cc25d69bfcc
4
+ data.tar.gz: 80ed442aabffd11cae68daeee7116f74fb4c48dd9c26fdf4912ddb845e409688
5
5
  SHA512:
6
- metadata.gz: 430385bb0b5b87a8bd1a69e244d13fd34a48e3005e500bde4fcc5eda7ffcbfd564fce87114d868cf1a4a5f4ee70a161039db08ce20bf8a80d40fd840e83c3861
7
- data.tar.gz: 04c1371e81b00a9adb8cd99ad9cb44d06a7b9fccd29b512cf708009cb44c4939474459b80dcee084e4f8bfa86a232c6bef0af79b8066b91b2a865d946c5d247d
6
+ metadata.gz: b5831715e5c9b0f4d707778170d1eba44f485816a68fe842d4af97bad4bbc62f6640b025c100e87900ed30530c3e6cb826cfd3aee8af1840242c517ec0800fea
7
+ data.tar.gz: 1facd7a1a15ca4268f84e1472609ea9487b6cd8c8fe2b6e68cde742084dfb2644cc1353bc059bf553ed47d6e80c94406c882870624b78c3513db71ba6f51510d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- moneykit (0.1.0)
4
+ moneykit (0.1.2)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart
7
7
 
data/README.md CHANGED
@@ -16,7 +16,7 @@ bundle add moneykit.gemspec
16
16
  or add the following to your `Gemfile`
17
17
 
18
18
  ```
19
- gem 'moneykit', '~> 0.1.0'
19
+ gem 'moneykit', '~> 0.1.2'
20
20
  ```
21
21
 
22
22
  ## Getting Started
data/docs/Body.md ADDED
@@ -0,0 +1,42 @@
1
+ # MoneyKit::Body
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **webhook_event** | **Object** | | [optional] |
8
+ | **webhook_major_version** | **Object** | | [optional] |
9
+ | **webhook_minor_version** | **Object** | | [optional] |
10
+ | **webhook_idempotency_key** | **Object** | | |
11
+ | **webhook_timestamp** | **Object** | | |
12
+ | **link_id** | **Object** | | |
13
+ | **link_tags** | **Object** | | |
14
+ | **state** | [**LinkProductState**](LinkProductState.md) | | |
15
+ | **error** | [**PublicLinkError**](PublicLinkError.md) | | [optional] |
16
+ | **error_message** | **Object** | | [optional] |
17
+ | **product** | [**Product**](Product.md) | | |
18
+ | **state_changed_at** | **Object** | | |
19
+ | **has_history** | **Object** | | |
20
+
21
+ ## Example
22
+
23
+ ```ruby
24
+ require 'moneykit'
25
+
26
+ instance = MoneyKit::Body.new(
27
+ webhook_event: null,
28
+ webhook_major_version: null,
29
+ webhook_minor_version: null,
30
+ webhook_idempotency_key: null,
31
+ webhook_timestamp: null,
32
+ link_id: null,
33
+ link_tags: null,
34
+ state: null,
35
+ error: null,
36
+ error_message: null,
37
+ product: null,
38
+ state_changed_at: null,
39
+ has_history: null
40
+ )
41
+ ```
42
+
data/docs/LinkCommon.md CHANGED
@@ -7,6 +7,7 @@
7
7
  | **link_id** | **String** | The unique ID for this link. | |
8
8
  | **institution_id** | **String** | The unique ID for the institution this link is connected to. | |
9
9
  | **institution_name** | **String** | The institution name this link is connected to. | |
10
+ | **institution_avatar** | **String** | An avatar image for the link&#39;s institution. | |
10
11
  | **state** | [**LinkState**](LinkState.md) | | |
11
12
  | **error_code** | [**PublicLinkError**](PublicLinkError.md) | | [optional] |
12
13
  | **last_synced_at** | **Time** | An ISO-8601 timestamp indicating the last time that the account was updated. | [optional] |
@@ -22,6 +23,7 @@ instance = MoneyKit::LinkCommon.new(
22
23
  link_id: mk_eqkWN34UEoa2NxyALG8pcV,
23
24
  institution_id: chase,
24
25
  institution_name: Chase,
26
+ institution_avatar: https://example.com/avatar.png,
25
27
  state: null,
26
28
  error_code: null,
27
29
  last_synced_at: 2023-02-16T09:14:11,
@@ -0,0 +1,38 @@
1
+ # MoneyKit::LinkProductRefreshWebhook
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **webhook_event** | **String** | | [optional][default to &#39;link.product_refresh&#39;] |
8
+ | **webhook_major_version** | **Integer** | | [optional][default to WEBHOOK_MAJOR_VERSION::N1] |
9
+ | **webhook_minor_version** | **Integer** | | [optional][default to WEBHOOK_MINOR_VERSION::N0] |
10
+ | **webhook_idempotency_key** | **String** | | |
11
+ | **webhook_timestamp** | **Time** | | |
12
+ | **link_id** | **String** | | |
13
+ | **link_tags** | **Array&lt;String&gt;** | | |
14
+ | **product** | [**Product**](Product.md) | | |
15
+ | **state** | [**LinkProductState**](LinkProductState.md) | | |
16
+ | **state_changed_at** | **Time** | | |
17
+ | **error_message** | **String** | | [optional] |
18
+
19
+ ## Example
20
+
21
+ ```ruby
22
+ require 'moneykit'
23
+
24
+ instance = MoneyKit::LinkProductRefreshWebhook.new(
25
+ webhook_event: null,
26
+ webhook_major_version: null,
27
+ webhook_minor_version: null,
28
+ webhook_idempotency_key: null,
29
+ webhook_timestamp: null,
30
+ link_id: null,
31
+ link_tags: null,
32
+ product: null,
33
+ state: null,
34
+ state_changed_at: null,
35
+ error_message: null
36
+ )
37
+ ```
38
+
@@ -0,0 +1,15 @@
1
+ # MoneyKit::LinkProductState
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'moneykit'
12
+
13
+ instance = MoneyKit::LinkProductState.new()
14
+ ```
15
+
data/docs/LinkResponse.md CHANGED
@@ -7,6 +7,7 @@
7
7
  | **link_id** | **String** | The unique ID for this link. | |
8
8
  | **institution_id** | **String** | The unique ID for the institution this link is connected to. | |
9
9
  | **institution_name** | **String** | The institution name this link is connected to. | |
10
+ | **institution_avatar** | **String** | An avatar image for the link&#39;s institution. | |
10
11
  | **state** | [**LinkState**](LinkState.md) | | |
11
12
  | **error_code** | [**PublicLinkError**](PublicLinkError.md) | | [optional] |
12
13
  | **last_synced_at** | **Time** | An ISO-8601 timestamp indicating the last time that the account was updated. | [optional] |
@@ -24,6 +25,7 @@ instance = MoneyKit::LinkResponse.new(
24
25
  link_id: mk_eqkWN34UEoa2NxyALG8pcV,
25
26
  institution_id: chase,
26
27
  institution_name: Chase,
28
+ institution_avatar: https://example.com/avatar.png,
27
29
  state: null,
28
30
  error_code: null,
29
31
  last_synced_at: 2023-02-16T09:14:11,
@@ -0,0 +1,42 @@
1
+ # MoneyKit::ResponseHandleLinkWebhookEventRequestBodyWebhookPost
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **webhook_event** | **Object** | | [optional] |
8
+ | **webhook_major_version** | **Object** | | [optional] |
9
+ | **webhook_minor_version** | **Object** | | [optional] |
10
+ | **webhook_idempotency_key** | **Object** | | |
11
+ | **webhook_timestamp** | **Object** | | |
12
+ | **link_id** | **Object** | | |
13
+ | **link_tags** | **Object** | | |
14
+ | **state** | [**LinkProductState**](LinkProductState.md) | | |
15
+ | **error** | [**PublicLinkError**](PublicLinkError.md) | | [optional] |
16
+ | **error_message** | **Object** | | [optional] |
17
+ | **product** | [**Product**](Product.md) | | |
18
+ | **state_changed_at** | **Object** | | |
19
+ | **has_history** | **Object** | | |
20
+
21
+ ## Example
22
+
23
+ ```ruby
24
+ require 'moneykit'
25
+
26
+ instance = MoneyKit::ResponseHandleLinkWebhookEventRequestBodyWebhookPost.new(
27
+ webhook_event: null,
28
+ webhook_major_version: null,
29
+ webhook_minor_version: null,
30
+ webhook_idempotency_key: null,
31
+ webhook_timestamp: null,
32
+ link_id: null,
33
+ link_tags: null,
34
+ state: null,
35
+ error: null,
36
+ error_message: null,
37
+ product: null,
38
+ state_changed_at: null,
39
+ has_history: null
40
+ )
41
+ ```
42
+
@@ -0,0 +1,30 @@
1
+ # MoneyKit::TransactionUpdatesAvailableWebhook
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **webhook_event** | **String** | | [optional][default to &#39;transactions.updates_available&#39;] |
8
+ | **webhook_major_version** | **Integer** | | [optional][default to WEBHOOK_MAJOR_VERSION::N1] |
9
+ | **webhook_minor_version** | **Integer** | | [optional][default to WEBHOOK_MINOR_VERSION::N0] |
10
+ | **webhook_idempotency_key** | **String** | | |
11
+ | **webhook_timestamp** | **Time** | | |
12
+ | **link_id** | **String** | | |
13
+ | **has_history** | **Boolean** | | |
14
+
15
+ ## Example
16
+
17
+ ```ruby
18
+ require 'moneykit'
19
+
20
+ instance = MoneyKit::TransactionUpdatesAvailableWebhook.new(
21
+ webhook_event: null,
22
+ webhook_major_version: null,
23
+ webhook_minor_version: null,
24
+ webhook_idempotency_key: null,
25
+ webhook_timestamp: null,
26
+ link_id: null,
27
+ has_history: null
28
+ )
29
+ ```
30
+
@@ -0,0 +1,104 @@
1
+ =begin
2
+ #MoneyKit API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.1.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MoneyKit
17
+ module Body
18
+ class << self
19
+ # List of class defined in anyOf (OpenAPI v3)
20
+ def openapi_any_of
21
+ [
22
+ :'LinkProductRefreshWebhook',
23
+ :'LinkStateChangedWebhook',
24
+ :'TransactionUpdatesAvailableWebhook'
25
+ ]
26
+ end
27
+
28
+ # Builds the object
29
+ # @param [Mixed] Data to be matched against the list of anyOf items
30
+ # @return [Object] Returns the model or the data itself
31
+ def build(data)
32
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
33
+ # Note:
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_any_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ typed_data = find_and_cast_into_type(klass, data)
42
+ return typed_data if typed_data
43
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
44
+ end
45
+ end
46
+
47
+ openapi_any_of.include?(:AnyType) ? data : nil
48
+ end
49
+
50
+ private
51
+
52
+ SchemaMismatchError = Class.new(StandardError)
53
+
54
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
55
+ def find_and_cast_into_type(klass, data)
56
+ return if data.nil?
57
+
58
+ case klass.to_s
59
+ when 'Boolean'
60
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
61
+ when 'Float'
62
+ return data if data.instance_of?(Float)
63
+ when 'Integer'
64
+ return data if data.instance_of?(Integer)
65
+ when 'Time'
66
+ return Time.parse(data)
67
+ when 'Date'
68
+ return Date.parse(data)
69
+ when 'String'
70
+ return data if data.instance_of?(String)
71
+ when 'Object' # "type: object"
72
+ return data if data.instance_of?(Hash)
73
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
74
+ if data.instance_of?(Array)
75
+ sub_type = Regexp.last_match[:sub_type]
76
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
77
+ end
78
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
79
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
80
+ sub_type = Regexp.last_match[:sub_type]
81
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
82
+ end
83
+ else # model
84
+ const = MoneyKit.const_get(klass)
85
+ if const
86
+ if const.respond_to?(:openapi_any_of) # nested anyOf model
87
+ model = const.build(data)
88
+ return model if model
89
+ else
90
+ # raise if data contains keys that are not known to the model
91
+ raise unless (data.keys - const.acceptable_attributes).empty?
92
+ model = const.build_from_hash(data)
93
+ return model if model
94
+ end
95
+ end
96
+ end
97
+
98
+ raise # if no match by now, raise
99
+ rescue
100
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
101
+ end
102
+ end
103
+ end
104
+ end
@@ -24,6 +24,9 @@ module MoneyKit
24
24
  # The institution name this link is connected to.
25
25
  attr_accessor :institution_name
26
26
 
27
+ # An avatar image for the link's institution.
28
+ attr_accessor :institution_avatar
29
+
27
30
  attr_accessor :state
28
31
 
29
32
  attr_accessor :error_code
@@ -63,6 +66,7 @@ module MoneyKit
63
66
  :'link_id' => :'link_id',
64
67
  :'institution_id' => :'institution_id',
65
68
  :'institution_name' => :'institution_name',
69
+ :'institution_avatar' => :'institution_avatar',
66
70
  :'state' => :'state',
67
71
  :'error_code' => :'error_code',
68
72
  :'last_synced_at' => :'last_synced_at',
@@ -82,6 +86,7 @@ module MoneyKit
82
86
  :'link_id' => :'String',
83
87
  :'institution_id' => :'String',
84
88
  :'institution_name' => :'String',
89
+ :'institution_avatar' => :'String',
85
90
  :'state' => :'LinkState',
86
91
  :'error_code' => :'PublicLinkError',
87
92
  :'last_synced_at' => :'Time',
@@ -129,6 +134,12 @@ module MoneyKit
129
134
  self.institution_name = nil
130
135
  end
131
136
 
137
+ if attributes.key?(:'institution_avatar')
138
+ self.institution_avatar = attributes[:'institution_avatar']
139
+ else
140
+ self.institution_avatar = nil
141
+ end
142
+
132
143
  if attributes.key?(:'state')
133
144
  self.state = attributes[:'state']
134
145
  else
@@ -173,6 +184,10 @@ module MoneyKit
173
184
  invalid_properties.push('invalid value for "institution_name", institution_name cannot be nil.')
174
185
  end
175
186
 
187
+ if @institution_avatar.nil?
188
+ invalid_properties.push('invalid value for "institution_avatar", institution_avatar cannot be nil.')
189
+ end
190
+
176
191
  if @state.nil?
177
192
  invalid_properties.push('invalid value for "state", state cannot be nil.')
178
193
  end
@@ -191,6 +206,7 @@ module MoneyKit
191
206
  return false if @link_id.nil?
192
207
  return false if @institution_id.nil?
193
208
  return false if @institution_name.nil?
209
+ return false if @institution_avatar.nil?
194
210
  return false if @state.nil?
195
211
  return false if @products.nil?
196
212
  true
@@ -204,6 +220,7 @@ module MoneyKit
204
220
  link_id == o.link_id &&
205
221
  institution_id == o.institution_id &&
206
222
  institution_name == o.institution_name &&
223
+ institution_avatar == o.institution_avatar &&
207
224
  state == o.state &&
208
225
  error_code == o.error_code &&
209
226
  last_synced_at == o.last_synced_at &&
@@ -220,7 +237,7 @@ module MoneyKit
220
237
  # Calculates hash code according to all attributes.
221
238
  # @return [Integer] Hash code
222
239
  def hash
223
- [link_id, institution_id, institution_name, state, error_code, last_synced_at, tags, products].hash
240
+ [link_id, institution_id, institution_name, institution_avatar, state, error_code, last_synced_at, tags, products].hash
224
241
  end
225
242
 
226
243
  # Builds the object from hash