Skip to content

Commit

Permalink
add vezgos API
Browse files Browse the repository at this point in the history
  • Loading branch information
gabitanalla committed Apr 11, 2022
1 parent 4d0afdd commit ce12cf4
Show file tree
Hide file tree
Showing 9 changed files with 225 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/common/rest/get-vezgo-account/index.ts
@@ -0,0 +1,23 @@
import { MethodMetadata } from '..';
import { useRestCall } from '../../helpers/rest-calls';

const path = 'vezgo-account/:accountId';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
pathParameters,
headers: Headers,
body,
metadata,
});
return { data, error, loading, getData };
}

export const metadata: MethodMetadata = {
author: 'Gabriela Golmar',
authorPicture: '',
description: 'This is our get account',
name: path,
method: 'GET',
parameters: [],
};
23 changes: 23 additions & 0 deletions src/common/rest/get-vezgo-insight/index.ts
@@ -0,0 +1,23 @@
import { MethodMetadata } from '..';
import { useRestCall } from '../../helpers/rest-calls';

const path = 'insight/:id';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
pathParameters,
headers: Headers,
body,
metadata,
});
return { data, error, loading, getData };
}

export const metadata: MethodMetadata = {
author: 'Gabriela Golmar',
authorPicture: '',
description: 'This is our get insight',
name: path,
method: 'GET',
parameters: [],
};
23 changes: 23 additions & 0 deletions src/common/rest/get-vezgo-transaction/index.ts
@@ -0,0 +1,23 @@
import { MethodMetadata } from '..';
import { useRestCall } from '../../helpers/rest-calls';

const path = 'vezgo-transaction/:transactionId';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
pathParameters,
headers: Headers,
body,
metadata,
});
return { data, error, loading, getData };
}

export const metadata: MethodMetadata = {
author: 'Gabriela Golmar',
authorPicture: '',
description: 'This is our get vezgo transaction',
name: path,
method: 'GET',
parameters: [],
};
23 changes: 23 additions & 0 deletions src/common/rest/get-vezgo-user-accounts/index.ts
@@ -0,0 +1,23 @@
import { MethodMetadata } from '..';
import { useRestCall } from '../../helpers/rest-calls';

const path = 'vezgo-accounts/:userProfileId';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
pathParameters,
headers: Headers,
body,
metadata,
});
return { data, error, loading, getData };
}

export const metadata: MethodMetadata = {
author: 'Gabriela Golmar',
authorPicture: '',
description: 'This is our get user accounts',
name: path,
method: 'GET',
parameters: [],
};
23 changes: 23 additions & 0 deletions src/common/rest/get-vezgo-user-transactions/index.ts
@@ -0,0 +1,23 @@
import { MethodMetadata } from '..';
import { useRestCall } from '../../helpers/rest-calls';

const path = 'vezgo-transactions/:userProfileId';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
pathParameters,
headers: Headers,
body,
metadata,
});
return { data, error, loading, getData };
}

export const metadata: MethodMetadata = {
author: 'Gabriela Golmar',
authorPicture: '',
description: 'This is our get user transactions',
name: path,
method: 'GET',
parameters: [],
};
22 changes: 21 additions & 1 deletion src/common/rest/index.ts
Expand Up @@ -2,6 +2,14 @@ import * as auth from './auth';
import * as getClient from './get-user'
import * as postClient from './post-user'
import * as accounts from './accounts';
import * as getVezgoInsight from './get-vezgo-insight'
import * as postVezgoInsight from './post-vezgo-insight'
import * as postVezgoAccounts from './post-vezgo-accounts'
import * as getVezgoAccount from './get-vezgo-account'
import * as getVezgoUserAccounts from './get-vezgo-user-accounts'
import * as postVezgoTransactions from './post-vezgo-transactions'
import * as getVezgoUserTransactions from './get-vezgo-user-transactions'
import * as getVezgoTransaction from './get-vezgo-transaction'

export interface Parameter {
key: number;
Expand All @@ -21,4 +29,16 @@ export interface MethodMetadata {
parameters: Parameter[];
}

export const masaRestClient = { auth, accounts, getClient, postClient };
export const masaRestClient = { auth,
accounts,
getClient,
postClient,
getVezgoInsight,
postVezgoInsight,
postVezgoAccounts,
getVezgoAccount,
getVezgoUserAccounts,
postVezgoTransactions,
getVezgoUserTransactions,
getVezgoTransaction,
};
33 changes: 33 additions & 0 deletions src/common/rest/post-vezgo-accounts/index.ts
@@ -0,0 +1,33 @@
import { MethodMetadata, Parameter } from '..';
import { useRestCall } from '../../helpers/rest-calls';

const path = 'vesgo-accounts/:userProfileId';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
pathParameters,
headers: Headers,
body,
metadata,
});
return { data, error, loading, getData };
}

const parameters: Parameter[] = [
{
key: 1,
name: 'accounts',
description: 'accounts list',
required: 'yes',
default: '',
},
];

export const metadata: MethodMetadata = {
author: 'Gabriela Golmar',
authorPicture: '',
description: 'This is our post vezgo accounts',
name: path,
method: 'POST',
parameters,
};
23 changes: 23 additions & 0 deletions src/common/rest/post-vezgo-insight/index.ts
@@ -0,0 +1,23 @@
import { MethodMetadata } from '..';
import { useRestCall } from '../../helpers/rest-calls';

const path = 'insight';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
pathParameters,
headers: Headers,
body,
metadata,
});
return { data, error, loading, getData };
}

export const metadata: MethodMetadata = {
author: 'Gabriela Golmar',
authorPicture: '',
description: 'This is our post insight',
name: path,
method: 'POST',
parameters: [],
};
33 changes: 33 additions & 0 deletions src/common/rest/post-vezgo-transactions/index.ts
@@ -0,0 +1,33 @@
import { MethodMetadata, Parameter } from '..';
import { useRestCall } from '../../helpers/rest-calls';

const path = 'vezgo-transactions/:userProfileId';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
pathParameters,
headers: Headers,
body,
metadata,
});
return { data, error, loading, getData };
}

const parameters: Parameter[] = [
{
key: 1,
name: 'transactions',
description: 'transactions list',
required: 'yes',
default: '',
},
];

export const metadata: MethodMetadata = {
author: 'Gabriela Golmar',
authorPicture: '',
description: 'This is our post vezgo transactions',
name: path,
method: 'POST',
parameters,
};

0 comments on commit ce12cf4

Please sign in to comment.