From 349ad6387ff491fd9309d8e16ef1830026060753 Mon Sep 17 00:00:00 2001 From: brettmortensen <11483419+brettmortensen@users.noreply.github.com> Date: Fri, 14 Feb 2020 13:22:40 -0700 Subject: [PATCH] Add credit card product and rewards beta endpoints --- atrium.ts | 574 ++++++++++++++++++++++++++ docs/Account.md | 5 + docs/CreditCardProduct.md | 14 + docs/CreditCardProductResponseBody.md | 8 + docs/CreditCardProductsApi.md | 41 ++ docs/Reward.md | 18 + docs/RewardResponseBody.md | 8 + docs/RewardsApi.md | 119 ++++++ docs/RewardsResponseBody.md | 8 + package.json | 2 +- 10 files changed, 796 insertions(+), 1 deletion(-) create mode 100644 docs/CreditCardProduct.md create mode 100644 docs/CreditCardProductResponseBody.md create mode 100644 docs/CreditCardProductsApi.md create mode 100644 docs/Reward.md create mode 100644 docs/RewardResponseBody.md create mode 100644 docs/RewardsApi.md create mode 100644 docs/RewardsResponseBody.md diff --git a/atrium.ts b/atrium.ts index b646896..28d17a7 100644 --- a/atrium.ts +++ b/atrium.ts @@ -143,10 +143,13 @@ export class Account { 'cashBalance'?: number; 'cashSurrenderValue'?: number; 'createdAt'?: string; + 'creditCardProductGuid'?: string; 'creditLimit'?: number; 'currencyCode'?: string; + 'currentRewardLevel'?: string; 'dayPaymentIsDue'?: number; 'deathBenefit'?: number; + 'enrolledInRewardsOn'?: string; 'guid'?: string; 'holdingsValue'?: number; 'institutionCode'?: string; @@ -159,9 +162,11 @@ export class Account { 'minimumBalance'?: number; 'minimumPayment'?: number; 'name'?: string; + 'nextRewardLevel'?: string; 'originalBalance'?: number; 'paymentDueAt'?: string; 'payoffBalance'?: number; + 'primaryRewardUnit'?: string; 'startedOn'?: string; 'subtype'?: string; 'totalAccountValue'?: number; @@ -217,6 +222,11 @@ export class Account { "baseName": "created_at", "type": "string" }, + { + "name": "creditCardProductGuid", + "baseName": "credit_card_product_guid", + "type": "string" + }, { "name": "creditLimit", "baseName": "credit_limit", @@ -227,6 +237,11 @@ export class Account { "baseName": "currency_code", "type": "string" }, + { + "name": "currentRewardLevel", + "baseName": "current_reward_level", + "type": "string" + }, { "name": "dayPaymentIsDue", "baseName": "day_payment_is_due", @@ -237,6 +252,11 @@ export class Account { "baseName": "death_benefit", "type": "number" }, + { + "name": "enrolledInRewardsOn", + "baseName": "enrolled_in_rewards_on", + "type": "string" + }, { "name": "guid", "baseName": "guid", @@ -297,6 +317,11 @@ export class Account { "baseName": "name", "type": "string" }, + { + "name": "nextRewardLevel", + "baseName": "next_reward_level", + "type": "string" + }, { "name": "originalBalance", "baseName": "original_balance", @@ -312,6 +337,11 @@ export class Account { "baseName": "payoff_balance", "type": "number" }, + { + "name": "primaryRewardUnit", + "baseName": "primary_reward_unit", + "type": "string" + }, { "name": "startedOn", "baseName": "started_on", @@ -859,6 +889,76 @@ export class CredentialsResponseBody { } } +export class CreditCardProduct { + 'guid'?: string; + 'name'?: string; + 'annualFee'?: number; + 'hasCashbackRewards'?: boolean; + 'hasTravelRewards'?: boolean; + 'isSmallBusinessCard'?: boolean; + 'hasZeroPercentIntroductoryRate'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "guid", + "baseName": "guid", + "type": "string" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "annualFee", + "baseName": "annual_fee", + "type": "number" + }, + { + "name": "hasCashbackRewards", + "baseName": "has_cashback_rewards", + "type": "boolean" + }, + { + "name": "hasTravelRewards", + "baseName": "has_travel_rewards", + "type": "boolean" + }, + { + "name": "isSmallBusinessCard", + "baseName": "is_small_business_card", + "type": "boolean" + }, + { + "name": "hasZeroPercentIntroductoryRate", + "baseName": "has_zero_percent_introductory_rate", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return CreditCardProduct.attributeTypeMap; + } +} + +export class CreditCardProductResponseBody { + 'creditCardProduct'?: CreditCardProduct; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "creditCardProduct", + "baseName": "credit_card_product", + "type": "CreditCardProduct" + } ]; + + static getAttributeTypeMap() { + return CreditCardProductResponseBody.attributeTypeMap; + } +} + export class Holding { 'accountGuid'?: string; 'costBasis'?: number; @@ -1553,6 +1653,117 @@ export class Pagination { } } +export class Reward { + 'accountGuid'?: string; + 'balance'?: number; + 'balanceType'?: string; + 'createdAt'?: string; + 'description'?: string; + 'expiresOn'?: string; + 'guid'?: string; + 'memberGuid'?: string; + 'unitType'?: string; + 'updatedAt'?: string; + 'userGuid'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "accountGuid", + "baseName": "account_guid", + "type": "string" + }, + { + "name": "balance", + "baseName": "balance", + "type": "number" + }, + { + "name": "balanceType", + "baseName": "balance_type", + "type": "string" + }, + { + "name": "createdAt", + "baseName": "created_at", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "expiresOn", + "baseName": "expires_on", + "type": "string" + }, + { + "name": "guid", + "baseName": "guid", + "type": "string" + }, + { + "name": "memberGuid", + "baseName": "member_guid", + "type": "string" + }, + { + "name": "unitType", + "baseName": "unit_type", + "type": "string" + }, + { + "name": "updatedAt", + "baseName": "updated_at", + "type": "string" + }, + { + "name": "userGuid", + "baseName": "user_guid", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return Reward.attributeTypeMap; + } +} + +export class RewardResponseBody { + 'reward'?: Reward; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "reward", + "baseName": "reward", + "type": "Reward" + } ]; + + static getAttributeTypeMap() { + return RewardResponseBody.attributeTypeMap; + } +} + +export class RewardsResponseBody { + 'rewards'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "rewards", + "baseName": "rewards", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return RewardsResponseBody.attributeTypeMap; + } +} + export class Statement { /** * The unique identifier for the `account` associated with the `statement`. Defined by MX. @@ -2233,6 +2444,8 @@ let typeMap: {[index: string]: any} = { "CredentialRequest": CredentialRequest, "CredentialResponse": CredentialResponse, "CredentialsResponseBody": CredentialsResponseBody, + "CreditCardProduct": CreditCardProduct, + "CreditCardProductResponseBody": CreditCardProductResponseBody, "Holding": Holding, "HoldingResponseBody": HoldingResponseBody, "HoldingsResponseBody": HoldingsResponseBody, @@ -2253,6 +2466,9 @@ let typeMap: {[index: string]: any} = { "Merchant": Merchant, "MerchantResponseBody": MerchantResponseBody, "Pagination": Pagination, + "Reward": Reward, + "RewardResponseBody": RewardResponseBody, + "RewardsResponseBody": RewardsResponseBody, "Statement": Statement, "StatementResponseBody": StatementResponseBody, "StatementsResponseBody": StatementsResponseBody, @@ -2770,6 +2986,112 @@ export class ConnectWidgetApi { }); } } +export enum CreditCardProductsApiApiKeys { + apiKey, + clientID, +} + +export class CreditCardProductsApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'MX-API-Key'), + 'clientID': new ApiKeyAuth('header', 'MX-Client-ID'), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: CreditCardProductsApiApiKeys, value: string) { + (this.authentications as any)[CreditCardProductsApiApiKeys[key]].apiKey = value; + } + /** + * Use this endpoint to read the attributes of a credit card product. + * @summary Read credit card product + * @param creditCardProductGuid The unique identifier for a `credit card product`. + */ + public readCreditCardProduct (creditCardProductGuid: string) : Promise<{ response: http.IncomingMessage; body: CreditCardProductResponseBody; }> { + const localVarPath = this.basePath + '/credit_card_products/{credit_card_product_guid}' + .replace('{' + 'credit_card_product_guid' + '}', encodeURIComponent(String(creditCardProductGuid))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'creditCardProductGuid' is not null or undefined + if (creditCardProductGuid === null || creditCardProductGuid === undefined) { + throw new Error('Required parameter creditCardProductGuid was null or undefined when calling readCreditCardProduct.'); + } + + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.clientID.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CreditCardProductResponseBody; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "CreditCardProductResponseBody"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } +} export enum HoldingsApiApiKeys { apiKey, clientID, @@ -4585,6 +4907,254 @@ export class MerchantsApi { }); } } +export enum RewardsApiApiKeys { + apiKey, + clientID, +} + +export class RewardsApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'MX-API-Key'), + 'clientID': new ApiKeyAuth('header', 'MX-Client-ID'), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: RewardsApiApiKeys, value: string) { + (this.authentications as any)[RewardsApiApiKeys[key]].apiKey = value; + } + /** + * The fetch rewards endpoint begins fetching rewards for a member. + * @summary Fetch rewards + * @param memberGuid The unique identifier for a `member`. + * @param userGuid The unique identifier for a `user`. + */ + public fetchRewards (memberGuid: string, userGuid: string) : Promise<{ response: http.IncomingMessage; body: MemberResponseBody; }> { + const localVarPath = this.basePath + '/users/{user_guid}/members/{member_guid}/fetch_rewards' + .replace('{' + 'member_guid' + '}', encodeURIComponent(String(memberGuid))) + .replace('{' + 'user_guid' + '}', encodeURIComponent(String(userGuid))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'memberGuid' is not null or undefined + if (memberGuid === null || memberGuid === undefined) { + throw new Error('Required parameter memberGuid was null or undefined when calling fetchRewards.'); + } + + // verify required parameter 'userGuid' is not null or undefined + if (userGuid === null || userGuid === undefined) { + throw new Error('Required parameter userGuid was null or undefined when calling fetchRewards.'); + } + + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.clientID.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: MemberResponseBody; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "MemberResponseBody"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * List rewards for a given account. + * @summary List rewards + * @param memberGuid The unique identifier for a `member`. + * @param userGuid The unique identifier for a `user`. + */ + public listRewards (memberGuid: string, userGuid: string) : Promise<{ response: http.IncomingMessage; body: RewardsResponseBody; }> { + const localVarPath = this.basePath + '/users/{user_guid}/members/{member_guid}/rewards' + .replace('{' + 'member_guid' + '}', encodeURIComponent(String(memberGuid))) + .replace('{' + 'user_guid' + '}', encodeURIComponent(String(userGuid))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'memberGuid' is not null or undefined + if (memberGuid === null || memberGuid === undefined) { + throw new Error('Required parameter memberGuid was null or undefined when calling listRewards.'); + } + + // verify required parameter 'userGuid' is not null or undefined + if (userGuid === null || userGuid === undefined) { + throw new Error('Required parameter userGuid was null or undefined when calling listRewards.'); + } + + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.clientID.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: RewardsResponseBody; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "RewardsResponseBody"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * Read a reward. + * @summary Read reward + * @param memberGuid The unique identifier for a `member`. + * @param rewardGuid The unique identifier for a `reward`. + * @param userGuid The unique identifier for a `user`. + */ + public readReward (memberGuid: string, rewardGuid: string, userGuid: string) : Promise<{ response: http.IncomingMessage; body: RewardResponseBody; }> { + const localVarPath = this.basePath + '/users/{user_guid}/members/{member_guid}/rewards/{reward_guid}' + .replace('{' + 'member_guid' + '}', encodeURIComponent(String(memberGuid))) + .replace('{' + 'reward_guid' + '}', encodeURIComponent(String(rewardGuid))) + .replace('{' + 'user_guid' + '}', encodeURIComponent(String(userGuid))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'memberGuid' is not null or undefined + if (memberGuid === null || memberGuid === undefined) { + throw new Error('Required parameter memberGuid was null or undefined when calling readReward.'); + } + + // verify required parameter 'rewardGuid' is not null or undefined + if (rewardGuid === null || rewardGuid === undefined) { + throw new Error('Required parameter rewardGuid was null or undefined when calling readReward.'); + } + + // verify required parameter 'userGuid' is not null or undefined + if (userGuid === null || userGuid === undefined) { + throw new Error('Required parameter userGuid was null or undefined when calling readReward.'); + } + + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.clientID.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: RewardResponseBody; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "RewardResponseBody"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } +} export enum StatementsApiApiKeys { apiKey, clientID, @@ -5745,11 +6315,13 @@ export class AtriumClient { constructor(apiKey: string, clientID: string, basePath: string = defaultBasePath) { this.mount('accounts', new AccountsApi(basePath), apiKey, clientID); this.mount('connectWidget', new ConnectWidgetApi(basePath), apiKey, clientID); + this.mount('creditCardProducts', new CreditCardProductsApi(basePath), apiKey, clientID); this.mount('holdings', new HoldingsApi(basePath), apiKey, clientID); this.mount('identity', new IdentityApi(basePath), apiKey, clientID); this.mount('institutions', new InstitutionsApi(basePath), apiKey, clientID); this.mount('members', new MembersApi(basePath), apiKey, clientID); this.mount('merchants', new MerchantsApi(basePath), apiKey, clientID); + this.mount('rewards', new RewardsApi(basePath), apiKey, clientID); this.mount('statements', new StatementsApi(basePath), apiKey, clientID); this.mount('transactions', new TransactionsApi(basePath), apiKey, clientID); this.mount('users', new UsersApi(basePath), apiKey, clientID); @@ -5764,11 +6336,13 @@ export class AtriumClient { accounts: AccountsApi = new AccountsApi() connectWidget: ConnectWidgetApi = new ConnectWidgetApi() + creditCardProducts: CreditCardProductsApi = new CreditCardProductsApi() holdings: HoldingsApi = new HoldingsApi() identity: IdentityApi = new IdentityApi() institutions: InstitutionsApi = new InstitutionsApi() members: MembersApi = new MembersApi() merchants: MerchantsApi = new MerchantsApi() + rewards: RewardsApi = new RewardsApi() statements: StatementsApi = new StatementsApi() transactions: TransactionsApi = new TransactionsApi() users: UsersApi = new UsersApi() diff --git a/docs/Account.md b/docs/Account.md index 3accb63..00b0f14 100644 --- a/docs/Account.md +++ b/docs/Account.md @@ -12,10 +12,13 @@ Name | Type | Description | Notes **cashBalance** | **number** | | [optional] **cashSurrenderValue** | **number** | | [optional] **createdAt** | **string** | | [optional] +**creditCardProductGuid** | **string** | | [optional] **creditLimit** | **number** | | [optional] **currencyCode** | **string** | | [optional] +**currentRewardLevel** | **string** | | [optional] **dayPaymentIsDue** | **number** | | [optional] **deathBenefit** | **number** | | [optional] +**enrolledInRewardsOn** | **string** | | [optional] **guid** | **string** | | [optional] **holdingsValue** | **number** | | [optional] **institutionCode** | **string** | | [optional] @@ -28,9 +31,11 @@ Name | Type | Description | Notes **minimumBalance** | **number** | | [optional] **minimumPayment** | **number** | | [optional] **name** | **string** | | [optional] +**nextRewardLevel** | **string** | | [optional] **originalBalance** | **number** | | [optional] **paymentDueAt** | **string** | | [optional] **payoffBalance** | **number** | | [optional] +**primaryRewardUnit** | **string** | | [optional] **startedOn** | **string** | | [optional] **subtype** | **string** | | [optional] **totalAccountValue** | **number** | | [optional] diff --git a/docs/CreditCardProduct.md b/docs/CreditCardProduct.md new file mode 100644 index 0000000..b06ad92 --- /dev/null +++ b/docs/CreditCardProduct.md @@ -0,0 +1,14 @@ +# CreditCardProduct + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**guid** | **string** | | [optional] +**name** | **string** | | [optional] +**annualFee** | **number** | | [optional] +**hasCashbackRewards** | **boolean** | | [optional] +**hasTravelRewards** | **boolean** | | [optional] +**isSmallBusinessCard** | **boolean** | | [optional] +**hasZeroPercentIntroductoryRate** | **boolean** | | [optional] + + diff --git a/docs/CreditCardProductResponseBody.md b/docs/CreditCardProductResponseBody.md new file mode 100644 index 0000000..f8acf9e --- /dev/null +++ b/docs/CreditCardProductResponseBody.md @@ -0,0 +1,8 @@ +# CreditCardProductResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**creditCardProduct** | [**CreditCardProduct**](CreditCardProduct.md) | | [optional] + + diff --git a/docs/CreditCardProductsApi.md b/docs/CreditCardProductsApi.md new file mode 100644 index 0000000..0599f10 --- /dev/null +++ b/docs/CreditCardProductsApi.md @@ -0,0 +1,41 @@ +# .CreditCardProductsApi + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**readCreditCardProduct**](CreditCardProductsApi.md#readCreditCardProduct) | **GET** /credit_card_products/{credit_card_product_guid} | Read credit card product + + +# **readCreditCardProduct** +> CreditCardProductResponseBody readCreditCardProduct(creditCardProductGuid) + +Read credit card product + +Use this endpoint to read the attributes of a credit card product. + +### Example +```javascript +var atrium = require('./atrium.js'); + +var client = new atrium.AtriumClient("YOUR_API_KEY", "YOUR_CLIENT_ID", "https://vestibule.mx.com"); + +var creditCardProductGuid = "CCA-123"; // string | The unique identifier for a `credit card product`. + +var response = client.creditCardProducts.readCreditCardProduct(creditCardProductGuid); + +response.then(function(value) { + console.log(value); +}); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **creditCardProductGuid** | **string**| The unique identifier for a `credit card product`. | + +### Return type + +[**CreditCardProductResponseBody**](CreditCardProductResponseBody.md) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Reward.md b/docs/Reward.md new file mode 100644 index 0000000..ebf075e --- /dev/null +++ b/docs/Reward.md @@ -0,0 +1,18 @@ +# Reward + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountGuid** | **string** | | [optional] +**balance** | **number** | | [optional] +**balanceType** | **string** | | [optional] +**createdAt** | **string** | | [optional] +**description** | **string** | | [optional] +**expiresOn** | **string** | | [optional] +**guid** | **string** | | [optional] +**memberGuid** | **string** | | [optional] +**unitType** | **string** | | [optional] +**updatedAt** | **string** | | [optional] +**userGuid** | **string** | | [optional] + + diff --git a/docs/RewardResponseBody.md b/docs/RewardResponseBody.md new file mode 100644 index 0000000..82cd2c4 --- /dev/null +++ b/docs/RewardResponseBody.md @@ -0,0 +1,8 @@ +# RewardResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reward** | [**Reward**](Reward.md) | | [optional] + + diff --git a/docs/RewardsApi.md b/docs/RewardsApi.md new file mode 100644 index 0000000..15db7f1 --- /dev/null +++ b/docs/RewardsApi.md @@ -0,0 +1,119 @@ +# .RewardsApi + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fetchRewards**](RewardsApi.md#fetchRewards) | **POST** /users/{user_guid}/members/{member_guid}/fetch_rewards | Fetch rewards +[**listRewards**](RewardsApi.md#listRewards) | **GET** /users/{user_guid}/members/{member_guid}/rewards | List rewards +[**readReward**](RewardsApi.md#readReward) | **GET** /users/{user_guid}/members/{member_guid}/rewards/{reward_guid} | Read reward + + +# **fetchRewards** +> MemberResponseBody fetchRewards(memberGuid, userGuid) + +Fetch rewards + +The fetch rewards endpoint begins fetching rewards for a member. + +### Example +```javascript +var atrium = require('./atrium.js'); + +var client = new atrium.AtriumClient("YOUR_API_KEY", "YOUR_CLIENT_ID", "https://vestibule.mx.com"); + +var memberGuid = "MBR-123"; // string | The unique identifier for a `member`. +var userGuid = "USR-123"; // string | The unique identifier for a `user`. + +var response = client.rewards.fetchRewards(memberGuid, userGuid); + +response.then(function(value) { + console.log(value); +}); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **memberGuid** | **string**| The unique identifier for a `member`. | + **userGuid** | **string**| The unique identifier for a `user`. | + +### Return type + +[**MemberResponseBody**](MemberResponseBody.md) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **listRewards** +> RewardsResponseBody listRewards(memberGuid, userGuid) + +List rewards + +List rewards for a given account. + +### Example +```javascript +var atrium = require('./atrium.js'); + +var client = new atrium.AtriumClient("YOUR_API_KEY", "YOUR_CLIENT_ID", "https://vestibule.mx.com"); + +var memberGuid = "MBR-123"; // string | The unique identifier for a `member`. +var userGuid = "USR-123"; // string | The unique identifier for a `user`. + +var response = client.rewards.listRewards(memberGuid, userGuid); + +response.then(function(value) { + console.log(value); +}); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **memberGuid** | **string**| The unique identifier for a `member`. | + **userGuid** | **string**| The unique identifier for a `user`. | + +### Return type + +[**RewardsResponseBody**](RewardsResponseBody.md) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **readReward** +> RewardResponseBody readReward(memberGuid, rewardGuid, userGuid) + +Read reward + +Read a reward. + +### Example +```javascript +var atrium = require('./atrium.js'); + +var client = new atrium.AtriumClient("YOUR_API_KEY", "YOUR_CLIENT_ID", "https://vestibule.mx.com"); + +var memberGuid = "MBR-123"; // string | The unique identifier for a `member`. +var rewardGuid = "RWD-123"; // string | The unique identifier for a `reward`. +var userGuid = "USR-123"; // string | The unique identifier for a `user`. + +var response = client.rewards.readReward(memberGuid, rewardGuid, userGuid); + +response.then(function(value) { + console.log(value); +}); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **memberGuid** | **string**| The unique identifier for a `member`. | + **rewardGuid** | **string**| The unique identifier for a `reward`. | + **userGuid** | **string**| The unique identifier for a `user`. | + +### Return type + +[**RewardResponseBody**](RewardResponseBody.md) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/RewardsResponseBody.md b/docs/RewardsResponseBody.md new file mode 100644 index 0000000..6a1a1d8 --- /dev/null +++ b/docs/RewardsResponseBody.md @@ -0,0 +1,8 @@ +# RewardsResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rewards** | [**Array<Reward>**](Reward.md) | | [optional] + + diff --git a/package.json b/package.json index 46e811c..ec637e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mx-atrium", - "version": "2.9.7", + "version": "2.9.7-beta.0", "description": "NodeJS client for mx-atrium-node", "repository": "mxenabled/mx-atrium-node", "main": "atrium.js",