Skip to content

Commit 650f975

Browse files
committed
Add wrapper class for easier use
1 parent e433138 commit 650f975

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

lib/BudgetDataApiClient.php

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
namespace BudgetData\ApiClient;
4+
5+
use BudgetData\ApiClient\Api\DefaultApi;
6+
7+
class BudgetDataApiClient
8+
{
9+
/** @var DefaultApi */
10+
private $defaultApi;
11+
12+
/**
13+
* @param ClientInterface $client
14+
* @param Configuration $config
15+
* @param HeaderSelector $selector
16+
*/
17+
public function __construct(string $host)
18+
{
19+
$config = new Configuration();
20+
$config->setHost(host);
21+
$this->defaultApi = new DefaultApi(null, $config);
22+
}
23+
24+
/**
25+
* Operation accountsGet
26+
*
27+
* List the current user's (financial) Accounts
28+
*
29+
*
30+
* @throws \BudgetData\ApiClient\ApiException on non-2xx response
31+
* @throws \InvalidArgumentException
32+
* @return \BudgetData\ApiClient\Model\Account[]
33+
*/
34+
public function accountsGet()
35+
{
36+
return $this->defaultApi->accountsGet();
37+
}
38+
39+
/**
40+
* Operation accountsPost
41+
*
42+
* Add an account
43+
*
44+
* @param \BudgetData\ApiClient\Model\Account $body body (required)
45+
*
46+
* @throws \BudgetData\ApiClient\ApiException on non-2xx response
47+
* @throws \InvalidArgumentException
48+
* @return void
49+
*/
50+
public function accountsPost($body)
51+
{
52+
return $this->defaultApi->accountsPost($body);
53+
}
54+
}

0 commit comments

Comments
 (0)