Skip to content

Commit

Permalink
Update with latest OpenAPI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
moneykitt committed Jan 31, 2024
1 parent af28b0b commit 0419a91
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
moneykit (0.1.4)
moneykit (0.1.5)
faraday (>= 1.0.1, < 3.0)
faraday-multipart

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bundle add moneykit.gemspec
or add the following to your `Gemfile`

```
gem 'moneykit', '~> 0.1.4'
gem 'moneykit', '~> 0.1.5'
```

## Getting Started
Expand Down
4 changes: 2 additions & 2 deletions docs/CreateLinkSessionRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
| ---- | ---- | ----------- | ----- |
| **settings** | [**LinkSessionSettingOverrides**](LinkSessionSettingOverrides.md) | | [optional] |
| **customer_user** | [**LinkSessionCustomerUser**](LinkSessionCustomerUser.md) | | |
| **existing_link_id** | **String** | Supply the existing &#x60;link_id&#x60; if you are asking the user to reconnect this link. | [optional] |
| **institution_id** | **String** | The ID of the institution you want to link to. Providing this will skip the institution selection step. &#x60;existing_link_id&#x60; will take precedence over this field if both are provided. | [optional] |
| **existing_link_id** | **String** | Supply the existing &#x60;link_id&#x60; if you are asking the user to reconnect this link. &lt;p&gt;When reconnecting, if new accounts are discovered they will be presented to the user so permission to access them can be granted (or denied). Access to previously permitted accounts is not revokable at this point. &lt;p&gt;If necessary, MoneyKit may attempt to reconnect the account using a different provider than the link was originally connected through. The change in provider is generally seamless. MoneyKit normalizes incoming data to minimize provider-specific differences, and we deduplicate new transactions, so data continuity is generally assured; however, small discrepancies can still occur. &lt;p&gt;A reconnection cannot change the institution, the customer_user.id, the products, or the country for an existing link. These parameters will be silently ignored if &#x60;existing_link_id&#x60; is supplied. &lt;p&gt;The &#x60;webhook&#x60; for an existing link **can** be changed, and the existing webhook will be **removed** if the &#x60;webhook&#x60; parameter is omitted, so you should supply the &#x60;webhook&#x60; URL if you want to receive webhook events for the reconnected link. &lt;p&gt;Similarly, a reconnected link will be assigned whatever &#x60;link_tags&#x60; are supplied, and existing tags will be removed if &#x60;link_tags&#x60; is omitted, so you should supply the &#x60;link_tags&#x60; you want the link to have, if any. | [optional] |
| **institution_id** | **String** | The ID of the institution you want to link to. Providing this will skip the institution selection step. This field is ignored if &#x60;existing_link_id&#x60; is provided. | [optional] |
| **redirect_uri** | **String** | For Oauth linking, a URI indicating the destination, in your application, where the user should be sent after authenticating with the institution. The &#x60;redirect_uri&#x60; should not contain any query parameters, and it must be pre-approved by MoneyKit during the customer setup process. | |
| **webhook** | **String** | The destination URL to which any webhooks should be sent. | [optional] |
| **link_tags** | **Array&lt;String&gt;** | | [optional] |
Expand Down
13 changes: 7 additions & 6 deletions docs/ProductsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All URIs are relative to *https://api.moneykit.com*

## refresh_products

> refresh_products(id, refresh_products_request)
> <LinkCommon> refresh_products(id, refresh_products_request)
/links/{id}/products

Expand All @@ -32,25 +32,26 @@ refresh_products_request = MoneyKit::RefreshProductsRequest.new({products: [Mone

begin
# /links/{id}/products
api_instance.refresh_products(id, refresh_products_request)
result = api_instance.refresh_products(id, refresh_products_request)
p result
rescue MoneyKit::ApiError => e
puts "Error when calling ProductsApi->refresh_products: #{e}"
end
```

#### Using the refresh_products_with_http_info variant

This returns an Array which contains the response data (`nil` in this case), status code and headers.
This returns an Array which contains the response data, status code and headers.

> <Array(nil, Integer, Hash)> refresh_products_with_http_info(id, refresh_products_request)
> <Array(<LinkCommon>, Integer, Hash)> refresh_products_with_http_info(id, refresh_products_request)
```ruby
begin
# /links/{id}/products
data, status_code, headers = api_instance.refresh_products_with_http_info(id, refresh_products_request)
p status_code # => 2xx
p headers # => { ... }
p data # => nil
p data # => <LinkCommon>
rescue MoneyKit::ApiError => e
puts "Error when calling ProductsApi->refresh_products_with_http_info: #{e}"
end
Expand All @@ -65,7 +66,7 @@ end

### Return type

nil (empty response body)
[**LinkCommon**](LinkCommon.md)

### Authorization

Expand Down
2 changes: 2 additions & 0 deletions docs/TransactionsLinkProduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| **last_attempted_at** | **Time** | An ISO-8601 timestamp indicating the last time that the product was attempted. | [optional] |
| **error_code** | [**LinkProductFailureReasons**](LinkProductFailureReasons.md) | | [optional] |
| **error_message** | **String** | The error message, if the last attempt to refresh the product failed. | [optional] |
| **has_history** | **Boolean** | | |
| **settings** | [**TransactionsProductSettings**](TransactionsProductSettings.md) | | |

## Example
Expand All @@ -20,6 +21,7 @@ instance = MoneyKit::TransactionsLinkProduct.new(
last_attempted_at: 2023-02-16T09:14:11,
error_code: null,
error_message: null,
has_history: null,
settings: null
)
```
Expand Down
10 changes: 5 additions & 5 deletions lib/moneykit/api/products_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ def initialize(api_client = ApiClient.default)
# @param id [String] The unique ID for this link.
# @param refresh_products_request [RefreshProductsRequest]
# @param [Hash] opts the optional parameters
# @return [nil]
# @return [LinkCommon]
def refresh_products(id, refresh_products_request, opts = {})
refresh_products_with_http_info(id, refresh_products_request, opts)
nil
data, _status_code, _headers = refresh_products_with_http_info(id, refresh_products_request, opts)
data
end

# /links/{id}/products
# Requests an update of the provided products for the link. This is an asynchronous operation. The response will be a 202 Accepted if the request was successful. Refreshes are subject to rate limiting. &lt;br&gt;&lt;br&gt; &lt;b&gt;Rate Limiting&lt;/b&gt;&lt;br&gt; &lt;ul&gt; &lt;li&gt;1 refresh per link per hour for account data&lt;/li&gt; &lt;li&gt;1 refresh per link per hour for transaction data&lt;/li&gt; &lt;li&gt;1 refresh per link per day for account numbers&lt;/li&gt; &lt;li&gt;1 refresh per link per day for identity data&lt;/li&gt; &lt;/ul&gt;
# @param id [String] The unique ID for this link.
# @param refresh_products_request [RefreshProductsRequest]
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# @return [Array<(LinkCommon, Integer, Hash)>] LinkCommon data, response status code and response headers
def refresh_products_with_http_info(id, refresh_products_request, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ProductsApi.refresh_products ...'
Expand Down Expand Up @@ -71,7 +71,7 @@ def refresh_products_with_http_info(id, refresh_products_request, opts = {})
post_body = opts[:debug_body] || @api_client.object_to_http_body(refresh_products_request)

# return_type
return_type = opts[:debug_return_type]
return_type = opts[:debug_return_type] || 'LinkCommon'

# auth_names
auth_names = opts[:debug_auth_names] || ['OAuth2ClientCredentials']
Expand Down
4 changes: 2 additions & 2 deletions lib/moneykit/models/create_link_session_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class CreateLinkSessionRequest

attr_accessor :customer_user

# Supply the existing `link_id` if you are asking the user to reconnect this link.
# Supply the existing `link_id` if you are asking the user to reconnect this link. <p>When reconnecting, if new accounts are discovered they will be presented to the user so permission to access them can be granted (or denied). Access to previously permitted accounts is not revokable at this point. <p>If necessary, MoneyKit may attempt to reconnect the account using a different provider than the link was originally connected through. The change in provider is generally seamless. MoneyKit normalizes incoming data to minimize provider-specific differences, and we deduplicate new transactions, so data continuity is generally assured; however, small discrepancies can still occur. <p>A reconnection cannot change the institution, the customer_user.id, the products, or the country for an existing link. These parameters will be silently ignored if `existing_link_id` is supplied. <p>The `webhook` for an existing link **can** be changed, and the existing webhook will be **removed** if the `webhook` parameter is omitted, so you should supply the `webhook` URL if you want to receive webhook events for the reconnected link. <p>Similarly, a reconnected link will be assigned whatever `link_tags` are supplied, and existing tags will be removed if `link_tags` is omitted, so you should supply the `link_tags` you want the link to have, if any.
attr_accessor :existing_link_id

# The ID of the institution you want to link to. Providing this will skip the institution selection step. `existing_link_id` will take precedence over this field if both are provided.
# The ID of the institution you want to link to. Providing this will skip the institution selection step. This field is ignored if `existing_link_id` is provided.
attr_accessor :institution_id

# For Oauth linking, a URI indicating the destination, in your application, where the user should be sent after authenticating with the institution. The `redirect_uri` should not contain any query parameters, and it must be pre-approved by MoneyKit during the customer setup process.
Expand Down
3 changes: 2 additions & 1 deletion lib/moneykit/models/link_product_failure_reasons.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ class LinkProductFailureReasons
NOT_SUPPORTED = "not_supported".freeze
TIMEOUT = "timeout".freeze
UNKNOWN = "unknown".freeze
NO_ACCOUNTS = "no_accounts".freeze

def self.all_vars
@all_vars ||= [RATE_LIMIT, AUTH_EXPIRED, INVALID_CREDENTIALS, NOT_SUPPORTED, TIMEOUT, UNKNOWN].freeze
@all_vars ||= [RATE_LIMIT, AUTH_EXPIRED, INVALID_CREDENTIALS, NOT_SUPPORTED, TIMEOUT, UNKNOWN, NO_ACCOUNTS].freeze
end

# Builds the enum from string
Expand Down
18 changes: 17 additions & 1 deletion lib/moneykit/models/transactions_link_product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class TransactionsLinkProduct
# The error message, if the last attempt to refresh the product failed.
attr_accessor :error_message

attr_accessor :has_history

attr_accessor :settings

class EnumAttributeValidator
Expand Down Expand Up @@ -57,6 +59,7 @@ def self.attribute_map
:'last_attempted_at' => :'last_attempted_at',
:'error_code' => :'error_code',
:'error_message' => :'error_message',
:'has_history' => :'has_history',
:'settings' => :'settings'
}
end
Expand All @@ -73,6 +76,7 @@ def self.openapi_types
:'last_attempted_at' => :'Time',
:'error_code' => :'LinkProductFailureReasons',
:'error_message' => :'String',
:'has_history' => :'Boolean',
:'settings' => :'TransactionsProductSettings'
}
end
Expand Down Expand Up @@ -114,6 +118,12 @@ def initialize(attributes = {})
self.error_message = attributes[:'error_message']
end

if attributes.key?(:'has_history')
self.has_history = attributes[:'has_history']
else
self.has_history = nil
end

if attributes.key?(:'settings')
self.settings = attributes[:'settings']
else
Expand All @@ -126,6 +136,10 @@ def initialize(attributes = {})
def list_invalid_properties
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
invalid_properties = Array.new
if @has_history.nil?
invalid_properties.push('invalid value for "has_history", has_history cannot be nil.')
end

if @settings.nil?
invalid_properties.push('invalid value for "settings", settings cannot be nil.')
end
Expand All @@ -137,6 +151,7 @@ def list_invalid_properties
# @return true if the model is valid
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
return false if @has_history.nil?
return false if @settings.nil?
true
end
Expand All @@ -150,6 +165,7 @@ def ==(o)
last_attempted_at == o.last_attempted_at &&
error_code == o.error_code &&
error_message == o.error_message &&
has_history == o.has_history &&
settings == o.settings
end

Expand All @@ -162,7 +178,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[refreshed_at, last_attempted_at, error_code, error_message, settings].hash
[refreshed_at, last_attempted_at, error_code, error_message, has_history, settings].hash
end

# Builds the object from hash
Expand Down
2 changes: 1 addition & 1 deletion lib/moneykit/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module MoneyKit
VERSION = '0.1.4'
VERSION = '0.1.5'
end

0 comments on commit 0419a91

Please sign in to comment.