Skip to content

Commit

Permalink
Merge pull request #39 from mxenabled/bm/readme_and_openapi_updates
Browse files Browse the repository at this point in the history
README and OpenAPI updates
  • Loading branch information
brettmortensen authored Nov 30, 2021
2 parents 3fa6722 + 0df8a4b commit 67dc5ae
Show file tree
Hide file tree
Showing 13 changed files with 268 additions and 48 deletions.
49 changes: 31 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
*This project is currently in **Beta**. Please open up an issue [here](https://github.com/mxenabled/mx-platform-ruby/issues) to report issues using the MX Platform API Ruby Library.*
*This project is currently in **Beta**. Please open up an issue [here](https://github.com/mxenabled/mx-platform-ruby/issues) to report issues using the MX Platform Ruby library.*

*This project was automatically generated by the [OpenAPI Generator](https://openapi-generator.tech).*
# MX Platform Ruby

# MX Platform Ruby - v0.6.2
The [MX Platform API](https://www.mx.com/products/platform-api) is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.

The Ruby gem for the MX Platform API.
## Documentation

Examples for the API endpoints can be found [here.](https://docs.mx.com/api)

## Requirements

The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
- Ruby >= 2.6

## Installation

Expand All @@ -18,31 +22,28 @@ gem 'mx-platform-ruby'

And then execute:
```shell
$ bundle
bundle
```

Or install it yourself with:
```shell
$ gem install mx-platform-ruby
gem install mx-platform-ruby
```

## Getting Started

In order to make requests, you will need to [sign up](https://dashboard.mx.com/sign_up) for the MX Platform API and get a `Client ID` and `API Key`.

Please follow the [installation](#installation) procedure and then run the following code:

Please follow the [installation](#installation) procedure and then run the following code to create your first User:
```ruby
# Load the gem
require 'mx-platform-ruby'

# setup authorization
MxPlatformRuby.configure do |config|
# Configure HTTP basic authorization
config.username = 'Your Client ID from https://dashboard.mx.com'
config.password = 'Your API Key from https://dashboard.mx.com'
# Configure with your Client ID/API Key from https://dashboard.mx.com
config.username = 'Your Client ID'
config.password = 'Your API Key'

# Configure server. 0 for production, 1 for development
# Configure environment. 0 for production, 1 for development
config.server_index = 1
end

Expand All @@ -54,14 +55,26 @@ user_create_request_body = MxPlatformRuby::UserCreateRequestBody.new(
)

begin
# Create user
result = api_instance.create_user(user_create_request_body)
p result
rescue MxPlatformRuby::ApiError => e
puts "Error when calling MxPlatformApi->create_user: #{e}"
end
```

## Documentation
## Development

This project was generated by the [OpenAPI Generator](https://openapi-generator.tech). To generate this library, verify you have the latest version of the `openapi-generator-cli` found [here.](https://github.com/OpenAPITools/openapi-generator#17---npm)

Running the following command in this repo's directory will generate this library using the [MX Platform API OpenAPI spec](https://github.com/mxenabled/openapi/blob/master/openapi/mx_platform_api_beta.yml) with our [configuration and templates.](https://github.com/mxenabled/mx-platform-ruby/tree/master/openapi)
```shell
openapi-generator-cli generate \
-i https://raw.githubusercontent.com/mxenabled/openapi/master/openapi/mx_platform_api_beta.yml \
-g ruby \
-c ./openapi/config.yml \
-t ./openapi/templates
```

## Contributing

Additional examples for the API endpoints can be found [here](docs/MxPlatformApi.md).
Please [open an issue](https://github.com/mxenabled/mx-platform-java/issues) or [submit a pull request.](https://github.com/mxenabled/mx-platform-java/pulls)
22 changes: 18 additions & 4 deletions docs/EnhanceTransactionResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **amount** | **Float** | | [optional] |
| **categorized_by** | **Integer** | | [optional] |
| **category** | **String** | | [optional] |
| **category_guid** | **String** | | [optional] |
| **described_by** | **Integer** | | [optional] |
| **description** | **String** | | [optional] |
| **extended_transaction_type** | **String** | | [optional] |
| **id** | **String** | | [optional] |
| **is_bill_pay** | **Boolean** | | [optional] |
| **is_direct_deposit** | **Boolean** | | [optional] |
Expand All @@ -16,8 +20,11 @@
| **is_international** | **Boolean** | | [optional] |
| **is_overdraft_fee** | **Boolean** | | [optional] |
| **is_payroll_advance** | **Boolean** | | [optional] |
| **is_subscription** | **Boolean** | | [optional] |
| **memo** | **String** | | [optional] |
| **merchant_category_code** | **Integer** | | [optional] |
| **merchant_guid** | **String** | | [optional] |
| **merchant_location_guid** | **String** | | [optional] |
| **original_description** | **String** | | [optional] |
| **type** | **String** | | [optional] |

Expand All @@ -28,8 +35,12 @@ require 'mx-platform-ruby'

instance = MxPlatformRuby::EnhanceTransactionResponse.new(
amount: 21.33,
category: Fast Food,
description: IN-N-OUT BURGER,
categorized_by: 13,
category: Rental Car & Taxi,
category_guid: CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8,
described_by: 6,
description: Uber,
extended_transaction_type: partner_transaction_type,
id: ID-123,
is_bill_pay: false,
is_direct_deposit: false,
Expand All @@ -39,9 +50,12 @@ instance = MxPlatformRuby::EnhanceTransactionResponse.new(
is_international: false,
is_overdraft_fee: false,
is_payroll_advance: false,
is_subscription: false,
memo: Additional-information*on_transaction,
merchant_category_code: 5411,
merchant_guid: MCH-7ed79542-884d-2b1b-dd74-501c5cc9d25b,
original_description: IN-N-OUT BURGER,
merchant_guid: MCH-14f25b63-ef47-a38e-b2b6-d02b280b6e4e,
merchant_location_guid: MCL-00024e59-18b5-4d79-b879-2a7896726fea,
original_description: ubr* pending.uber.com,
type: DEBIT
)
```
Expand Down
6 changes: 5 additions & 1 deletion docs/EnhanceTransactionsRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
| ---- | ---- | ----------- | ----- |
| **amount** | **Float** | | [optional] |
| **description** | **String** | | |
| **extended_transaction_type** | **String** | | [optional] |
| **id** | **String** | | |
| **memo** | **String** | | [optional] |
| **merchant_category_code** | **Integer** | | [optional] |
| **type** | **String** | | [optional] |

Expand All @@ -17,8 +19,10 @@ require 'mx-platform-ruby'

instance = MxPlatformRuby::EnhanceTransactionsRequest.new(
amount: 21.33,
description: IN-N-OUT BURGER,
description: ubr* pending.uber.com,
extended_transaction_type: partner_transaction_type,
id: ID-123,
memo: Additional-information*on_transaction,
merchant_category_code: 123,
type: DEBIT
)
Expand Down
4 changes: 4 additions & 0 deletions docs/TransactionResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
| **account_id** | **String** | | [optional] |
| **amount** | **Float** | | [optional] |
| **category** | **String** | | [optional] |
| **category_guid** | **String** | | [optional] |
| **check_number_string** | **String** | | [optional] |
| **created_at** | **String** | | [optional] |
| **currency_code** | **String** | | [optional] |
| **date** | **String** | | [optional] |
| **description** | **String** | | [optional] |
| **extended_transaction_type** | **String** | | [optional] |
| **guid** | **String** | | [optional] |
| **id** | **String** | | [optional] |
| **is_bill_pay** | **Boolean** | | [optional] |
Expand Down Expand Up @@ -56,11 +58,13 @@ instance = MxPlatformRuby::TransactionResponse.new(
account_id: account123,
amount: 61.11,
category: Groceries,
category_guid: CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8,
check_number_string: 6812,
created_at: 2016-10-06T09:43:42.000Z,
currency_code: USD,
date: 2013-09-23T00:00:00.000Z,
description: Whole foods,
extended_transaction_type: partner_transaction_type,
guid: TRN-265abee9-889b-af6a-c69b-25157db2bdd9,
id: transaction-265abee9-889b-af6a-c69b-25157db2bdd9,
is_bill_pay: false,
Expand Down
72 changes: 71 additions & 1 deletion lib/mx-platform-ruby/models/enhance_transaction_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ module MxPlatformRuby
class EnhanceTransactionResponse
attr_accessor :amount

attr_accessor :categorized_by

attr_accessor :category

attr_accessor :category_guid

attr_accessor :described_by

attr_accessor :description

attr_accessor :extended_transaction_type

attr_accessor :id

attr_accessor :is_bill_pay
Expand All @@ -39,10 +47,16 @@ class EnhanceTransactionResponse

attr_accessor :is_payroll_advance

attr_accessor :is_subscription

attr_accessor :memo

attr_accessor :merchant_category_code

attr_accessor :merchant_guid

attr_accessor :merchant_location_guid

attr_accessor :original_description

attr_accessor :type
Expand All @@ -51,8 +65,12 @@ class EnhanceTransactionResponse
def self.attribute_map
{
:'amount' => :'amount',
:'categorized_by' => :'categorized_by',
:'category' => :'category',
:'category_guid' => :'category_guid',
:'described_by' => :'described_by',
:'description' => :'description',
:'extended_transaction_type' => :'extended_transaction_type',
:'id' => :'id',
:'is_bill_pay' => :'is_bill_pay',
:'is_direct_deposit' => :'is_direct_deposit',
Expand All @@ -62,8 +80,11 @@ def self.attribute_map
:'is_international' => :'is_international',
:'is_overdraft_fee' => :'is_overdraft_fee',
:'is_payroll_advance' => :'is_payroll_advance',
:'is_subscription' => :'is_subscription',
:'memo' => :'memo',
:'merchant_category_code' => :'merchant_category_code',
:'merchant_guid' => :'merchant_guid',
:'merchant_location_guid' => :'merchant_location_guid',
:'original_description' => :'original_description',
:'type' => :'type'
}
Expand All @@ -78,8 +99,12 @@ def self.acceptable_attributes
def self.openapi_types
{
:'amount' => :'Float',
:'categorized_by' => :'Integer',
:'category' => :'String',
:'category_guid' => :'String',
:'described_by' => :'Integer',
:'description' => :'String',
:'extended_transaction_type' => :'String',
:'id' => :'String',
:'is_bill_pay' => :'Boolean',
:'is_direct_deposit' => :'Boolean',
Expand All @@ -89,8 +114,11 @@ def self.openapi_types
:'is_international' => :'Boolean',
:'is_overdraft_fee' => :'Boolean',
:'is_payroll_advance' => :'Boolean',
:'is_subscription' => :'Boolean',
:'memo' => :'String',
:'merchant_category_code' => :'Integer',
:'merchant_guid' => :'String',
:'merchant_location_guid' => :'String',
:'original_description' => :'String',
:'type' => :'String'
}
Expand All @@ -100,8 +128,12 @@ def self.openapi_types
def self.openapi_nullable
Set.new([
:'amount',
:'categorized_by',
:'category',
:'category_guid',
:'described_by',
:'description',
:'extended_transaction_type',
:'id',
:'is_bill_pay',
:'is_direct_deposit',
Expand All @@ -111,7 +143,10 @@ def self.openapi_nullable
:'is_international',
:'is_overdraft_fee',
:'is_payroll_advance',
:'is_subscription',
:'memo',
:'merchant_category_code',
:'merchant_location_guid',
:'original_description',
:'type'
])
Expand All @@ -136,14 +171,30 @@ def initialize(attributes = {})
self.amount = attributes[:'amount']
end

if attributes.key?(:'categorized_by')
self.categorized_by = attributes[:'categorized_by']
end

if attributes.key?(:'category')
self.category = attributes[:'category']
end

if attributes.key?(:'category_guid')
self.category_guid = attributes[:'category_guid']
end

if attributes.key?(:'described_by')
self.described_by = attributes[:'described_by']
end

if attributes.key?(:'description')
self.description = attributes[:'description']
end

if attributes.key?(:'extended_transaction_type')
self.extended_transaction_type = attributes[:'extended_transaction_type']
end

if attributes.key?(:'id')
self.id = attributes[:'id']
end
Expand Down Expand Up @@ -180,6 +231,14 @@ def initialize(attributes = {})
self.is_payroll_advance = attributes[:'is_payroll_advance']
end

if attributes.key?(:'is_subscription')
self.is_subscription = attributes[:'is_subscription']
end

if attributes.key?(:'memo')
self.memo = attributes[:'memo']
end

if attributes.key?(:'merchant_category_code')
self.merchant_category_code = attributes[:'merchant_category_code']
end
Expand All @@ -188,6 +247,10 @@ def initialize(attributes = {})
self.merchant_guid = attributes[:'merchant_guid']
end

if attributes.key?(:'merchant_location_guid')
self.merchant_location_guid = attributes[:'merchant_location_guid']
end

if attributes.key?(:'original_description')
self.original_description = attributes[:'original_description']
end
Expand Down Expand Up @@ -216,8 +279,12 @@ def ==(o)
return true if self.equal?(o)
self.class == o.class &&
amount == o.amount &&
categorized_by == o.categorized_by &&
category == o.category &&
category_guid == o.category_guid &&
described_by == o.described_by &&
description == o.description &&
extended_transaction_type == o.extended_transaction_type &&
id == o.id &&
is_bill_pay == o.is_bill_pay &&
is_direct_deposit == o.is_direct_deposit &&
Expand All @@ -227,8 +294,11 @@ def ==(o)
is_international == o.is_international &&
is_overdraft_fee == o.is_overdraft_fee &&
is_payroll_advance == o.is_payroll_advance &&
is_subscription == o.is_subscription &&
memo == o.memo &&
merchant_category_code == o.merchant_category_code &&
merchant_guid == o.merchant_guid &&
merchant_location_guid == o.merchant_location_guid &&
original_description == o.original_description &&
type == o.type
end
Expand All @@ -242,7 +312,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[amount, category, description, id, is_bill_pay, is_direct_deposit, is_expense, is_fee, is_income, is_international, is_overdraft_fee, is_payroll_advance, merchant_category_code, merchant_guid, original_description, type].hash
[amount, categorized_by, category, category_guid, described_by, description, extended_transaction_type, id, is_bill_pay, is_direct_deposit, is_expense, is_fee, is_income, is_international, is_overdraft_fee, is_payroll_advance, is_subscription, memo, merchant_category_code, merchant_guid, merchant_location_guid, original_description, type].hash
end

# Builds the object from hash
Expand Down
Loading

0 comments on commit 67dc5ae

Please sign in to comment.