1: | <?php |
2: | |
3: | declare(strict_types=1); |
4: | |
5: | /* |
6: | * This file has been auto generated by Jane, |
7: | * |
8: | * Do no edit it directly. |
9: | */ |
10: | |
11: | namespace NxSys\Library\Clients\Brex\API\Team; |
12: | |
13: | class Client extends \NxSys\Library\Clients\Brex\API\Team\Runtime\Client\Client |
14: | { |
15: | /** |
16: | Lists all cards by a `user_id`. |
17: | Only cards with `limit_type = CARD` have `spend_controls` |
18: | |
19: | * |
20: | * @param array $queryParameters { |
21: | * |
22: | * @var string $user_id |
23: | * @var string $cursor |
24: | * @var int $limit |
25: | * } |
26: | * |
27: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
28: | * |
29: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\PageCard|\Psr\Http\Message\ResponseInterface|null |
30: | */ |
31: | public function listCardsByUserId(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) |
32: | { |
33: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\ListCardsByUserId($queryParameters), $fetch); |
34: | } |
35: | |
36: | /** |
37: | Creates a new card. |
38: | The `spend_controls` field is required when `limit_type` = `CARD`. |
39: | The `mailing_address` field is required for physical cards and is the shipping address used to send the card; it is not the same as the billing and mailing address used for online purchases. |
40: | The first 2 lines of this address must be under 60 characters long. Each user can only have up to 10 active physical cards. |
41: | |
42: | * |
43: | * @param \NxSys\Library\Clients\Brex\API\Team\Model\CreateCardRequest $requestBody |
44: | * @param array $headerParameters { |
45: | * |
46: | * @var string $Idempotency-Key |
47: | * } |
48: | * |
49: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
50: | * |
51: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\Card|\Psr\Http\Message\ResponseInterface|null |
52: | */ |
53: | public function createCard(Model\CreateCardRequest $requestBody, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) |
54: | { |
55: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\CreateCard($requestBody, $headerParameters), $fetch); |
56: | } |
57: | |
58: | /** |
59: | Retrieves a card by ID. Only cards with `limit_type = CARD` have `spend_controls` |
60: | |
61: | * |
62: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
63: | * |
64: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\Card|\Psr\Http\Message\ResponseInterface|null |
65: | */ |
66: | public function getCardById(string $id, string $fetch = self::FETCH_OBJECT) |
67: | { |
68: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\GetCardById($id), $fetch); |
69: | } |
70: | |
71: | /** |
72: | Update an existing vendor card |
73: | |
74: | * |
75: | * @param \NxSys\Library\Clients\Brex\API\Team\Model\UpdateCardRequest $requestBody |
76: | * @param array $headerParameters { |
77: | * |
78: | * @var string $Idempotency-Key |
79: | * } |
80: | * |
81: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
82: | * |
83: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\Card|\Psr\Http\Message\ResponseInterface|null |
84: | */ |
85: | public function updateCard(string $id, Model\UpdateCardRequest $requestBody, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) |
86: | { |
87: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\UpdateCard($id, $requestBody, $headerParameters), $fetch); |
88: | } |
89: | |
90: | /** |
91: | Locks an existing, unlocked card. And the card owner will receive a notification about it. |
92: | |
93: | * |
94: | * @param \NxSys\Library\Clients\Brex\API\Team\Model\LockCardRequest $requestBody |
95: | * @param array $headerParameters { |
96: | * |
97: | * @var string $Idempotency-Key |
98: | * } |
99: | * |
100: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
101: | * |
102: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\Card|\Psr\Http\Message\ResponseInterface|null |
103: | */ |
104: | public function lockCard(string $id, Model\LockCardRequest $requestBody, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) |
105: | { |
106: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\LockCard($id, $requestBody, $headerParameters), $fetch); |
107: | } |
108: | |
109: | /** |
110: | Retrieves card number, CVV, and expiration date of a card by ID. |
111: | |
112: | * |
113: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
114: | * |
115: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\CardNumberResponse|\Psr\Http\Message\ResponseInterface|null |
116: | */ |
117: | public function getCardNumber(string $id, string $fetch = self::FETCH_OBJECT) |
118: | { |
119: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\GetCardNumber($id), $fetch); |
120: | } |
121: | |
122: | /** |
123: | Creates a secure email to send card number, CVV, and expiration date of a card by ID to the specified email. |
124: | |
125: | This endpoint is currently gated. If you would like to request access, please reach out to |
126: | [email protected] |
127: | |
128: | * |
129: | * @param \NxSys\Library\Clients\Brex\API\Team\Model\SecureEmailForCardDetailsRequest $requestBody |
130: | * @param array $headerParameters { |
131: | * |
132: | * @var string $Idempotency-Key |
133: | * } |
134: | * |
135: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
136: | * |
137: | * @return \Psr\Http\Message\ResponseInterface|null |
138: | */ |
139: | public function emailCardNumber(string $id, Model\SecureEmailForCardDetailsRequest $requestBody, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) |
140: | { |
141: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\EmailCardNumber($id, $requestBody, $headerParameters), $fetch); |
142: | } |
143: | |
144: | /** |
145: | Terminates an existing card. The card owner will receive a notification about it. |
146: | |
147: | * |
148: | * @param \NxSys\Library\Clients\Brex\API\Team\Model\TerminateCardRequest $requestBody |
149: | * @param array $headerParameters { |
150: | * |
151: | * @var string $Idempotency-Key |
152: | * } |
153: | * |
154: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
155: | * |
156: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\Card|\Psr\Http\Message\ResponseInterface|null |
157: | */ |
158: | public function terminateCard(string $id, Model\TerminateCardRequest $requestBody, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) |
159: | { |
160: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\TerminateCard($id, $requestBody, $headerParameters), $fetch); |
161: | } |
162: | |
163: | /** |
164: | Unlocks an existing card. |
165: | |
166: | * |
167: | * @param array $headerParameters { |
168: | * |
169: | * @var string $Idempotency-Key |
170: | * } |
171: | * |
172: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
173: | * |
174: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\Card|\Psr\Http\Message\ResponseInterface|null |
175: | */ |
176: | public function unlockCard(string $id, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) |
177: | { |
178: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\UnlockCard($id, $headerParameters), $fetch); |
179: | } |
180: | |
181: | /** |
182: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
183: | * |
184: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\CompanyResponse|\Psr\Http\Message\ResponseInterface|null |
185: | * |
186: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetCompanyBadRequestException |
187: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetCompanyUnauthorizedException |
188: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetCompanyForbiddenException |
189: | */ |
190: | public function getCompany(string $fetch = self::FETCH_OBJECT) |
191: | { |
192: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\GetCompany(), $fetch); |
193: | } |
194: | |
195: | /** |
196: | This endpoint lists all departments. |
197: | |
198: | * |
199: | * @param array $queryParameters { |
200: | * |
201: | * @var string $cursor |
202: | * @var int $limit |
203: | * @var string $name |
204: | * } |
205: | * |
206: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
207: | * |
208: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\PageDepartmentResponse|\Psr\Http\Message\ResponseInterface|null |
209: | * |
210: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\ListDepartmentsBadRequestException |
211: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\ListDepartmentsUnauthorizedException |
212: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\ListDepartmentsForbiddenException |
213: | */ |
214: | public function listDepartments(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) |
215: | { |
216: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\ListDepartments($queryParameters), $fetch); |
217: | } |
218: | |
219: | /** |
220: | This endpoint creates a new department |
221: | |
222: | * |
223: | * @param \NxSys\Library\Clients\Brex\API\Team\Model\CreateDepartmentRequest $requestBody |
224: | * @param array $headerParameters { |
225: | * |
226: | * @var string $Idempotency-Key |
227: | * } |
228: | * |
229: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
230: | * |
231: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\DepartmentResponse|\Psr\Http\Message\ResponseInterface|null |
232: | * |
233: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\CreateDepartmentBadRequestException |
234: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\CreateDepartmentUnauthorizedException |
235: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\CreateDepartmentForbiddenException |
236: | */ |
237: | public function createDepartment(Model\CreateDepartmentRequest $requestBody, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) |
238: | { |
239: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\CreateDepartment($requestBody, $headerParameters), $fetch); |
240: | } |
241: | |
242: | /** |
243: | This endpoint gets a department by ID. |
244: | |
245: | * |
246: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
247: | * |
248: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\DepartmentResponse|\Psr\Http\Message\ResponseInterface|null |
249: | * |
250: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetDepartmentByIdBadRequestException |
251: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetDepartmentByIdUnauthorizedException |
252: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetDepartmentByIdForbiddenException |
253: | */ |
254: | public function getDepartmentById(string $id, string $fetch = self::FETCH_OBJECT) |
255: | { |
256: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\GetDepartmentById($id), $fetch); |
257: | } |
258: | |
259: | /** |
260: | This endpoint lists all locations. |
261: | |
262: | * |
263: | * @param array $queryParameters { |
264: | * |
265: | * @var string $cursor |
266: | * @var int $limit |
267: | * @var string $name |
268: | * } |
269: | * |
270: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
271: | * |
272: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\PageLocationResponse|\Psr\Http\Message\ResponseInterface|null |
273: | * |
274: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\ListLocationsBadRequestException |
275: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\ListLocationsUnauthorizedException |
276: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\ListLocationsForbiddenException |
277: | */ |
278: | public function listLocations(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) |
279: | { |
280: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\ListLocations($queryParameters), $fetch); |
281: | } |
282: | |
283: | /** |
284: | This endpoint creates a new location. |
285: | |
286: | * |
287: | * @param \NxSys\Library\Clients\Brex\API\Team\Model\CreateLocationRequest $requestBody |
288: | * @param array $headerParameters { |
289: | * |
290: | * @var string $Idempotency-Key |
291: | * } |
292: | * |
293: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
294: | * |
295: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\LocationResponse|\Psr\Http\Message\ResponseInterface|null |
296: | * |
297: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\CreateLocationBadRequestException |
298: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\CreateLocationUnauthorizedException |
299: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\CreateLocationForbiddenException |
300: | */ |
301: | public function createLocation(Model\CreateLocationRequest $requestBody, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) |
302: | { |
303: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\CreateLocation($requestBody, $headerParameters), $fetch); |
304: | } |
305: | |
306: | /** |
307: | This endpoint gets a location by ID. |
308: | |
309: | * |
310: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
311: | * |
312: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\LocationResponse|\Psr\Http\Message\ResponseInterface|null |
313: | * |
314: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetLocationByIdBadRequestException |
315: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetLocationByIdUnauthorizedException |
316: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetLocationByIdForbiddenException |
317: | */ |
318: | public function getLocationById(string $id, string $fetch = self::FETCH_OBJECT) |
319: | { |
320: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\GetLocationById($id), $fetch); |
321: | } |
322: | |
323: | /** |
324: | This endpoint lists all users. To find a user id by email, you can filter using the `email` query parameter. |
325: | |
326: | * |
327: | * @param array $queryParameters { |
328: | * |
329: | * @var string $cursor |
330: | * @var int $limit |
331: | * @var string $email |
332: | * @var array $expand[] |
333: | * } |
334: | * |
335: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
336: | * |
337: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\PageUserResponse|\Psr\Http\Message\ResponseInterface|null |
338: | * |
339: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\ListUsersBadRequestException |
340: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\ListUsersUnauthorizedException |
341: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\ListUsersForbiddenException |
342: | */ |
343: | public function listUsers(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) |
344: | { |
345: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\ListUsers($queryParameters), $fetch); |
346: | } |
347: | |
348: | /** |
349: | This endpoint invites a new user as an employee. |
350: | To update user's role, check out [this article](https://support.brex.com/how-do-i-change-another-user-s-role/). |
351: | |
352: | * |
353: | * @param \NxSys\Library\Clients\Brex\API\Team\Model\CreateUserRequest $requestBody |
354: | * @param array $headerParameters { |
355: | * |
356: | * @var string $Idempotency-Key |
357: | * } |
358: | * |
359: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
360: | * |
361: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\UserResponse|\Psr\Http\Message\ResponseInterface|null |
362: | * |
363: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\CreateUserBadRequestException |
364: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\CreateUserUnauthorizedException |
365: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\CreateUserForbiddenException |
366: | */ |
367: | public function createUser(Model\CreateUserRequest $requestBody, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) |
368: | { |
369: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\CreateUser($requestBody, $headerParameters), $fetch); |
370: | } |
371: | |
372: | /** |
373: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
374: | * |
375: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\UserResponse|\Psr\Http\Message\ResponseInterface|null |
376: | * |
377: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetMeBadRequestException |
378: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetMeUnauthorizedException |
379: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetMeForbiddenException |
380: | */ |
381: | public function getMe(string $fetch = self::FETCH_OBJECT) |
382: | { |
383: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\GetMe(), $fetch); |
384: | } |
385: | |
386: | /** |
387: | This endpoint gets a user by ID. |
388: | |
389: | * |
390: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
391: | * |
392: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\UserResponse|\Psr\Http\Message\ResponseInterface|null |
393: | * |
394: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetUserByIdBadRequestException |
395: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetUserByIdUnauthorizedException |
396: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\GetUserByIdForbiddenException |
397: | */ |
398: | public function getUserById(string $id, string $fetch = self::FETCH_OBJECT) |
399: | { |
400: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\GetUserById($id), $fetch); |
401: | } |
402: | |
403: | /** |
404: | This endpoint updates a user. Any parameters not provided will be left unchanged. |
405: | |
406: | * |
407: | * @param \NxSys\Library\Clients\Brex\API\Team\Model\UpdateUserRequest $requestBody |
408: | * @param array $headerParameters { |
409: | * |
410: | * @var string $Idempotency-Key |
411: | * } |
412: | * |
413: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
414: | * |
415: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\UserResponse|\Psr\Http\Message\ResponseInterface|null |
416: | * |
417: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\UpdateUserBadRequestException |
418: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\UpdateUserUnauthorizedException |
419: | * @throws \NxSys\Library\Clients\Brex\API\Team\Exception\UpdateUserForbiddenException |
420: | */ |
421: | public function updateUser(string $id, Model\UpdateUserRequest $requestBody, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) |
422: | { |
423: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\UpdateUser($id, $requestBody, $headerParameters), $fetch); |
424: | } |
425: | |
426: | /** |
427: | This endpoint gets the monthly limit for the user including the monthly available limit. |
428: | |
429: | * |
430: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
431: | * |
432: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\UserLimitResponse|\Psr\Http\Message\ResponseInterface|null |
433: | */ |
434: | public function getUserLimit(string $id, string $fetch = self::FETCH_OBJECT) |
435: | { |
436: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\GetUserLimit($id), $fetch); |
437: | } |
438: | |
439: | /** |
440: | This endpoint sets the monthly limit for a user. |
441: | The limit amount must be non-negative. |
442: | To unset the monthly limit of the user, just set `monthly_limit` to null. |
443: | |
444: | * |
445: | * @param \NxSys\Library\Clients\Brex\API\Team\Model\SetUserLimitRequest $requestBody |
446: | * @param array $headerParameters { |
447: | * |
448: | * @var string $Idempotency-Key |
449: | * } |
450: | * |
451: | * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) |
452: | * |
453: | * @return \NxSys\Library\Clients\Brex\API\Team\Model\UserLimitResponse|\Psr\Http\Message\ResponseInterface|null |
454: | */ |
455: | public function setUserLimit(string $id, Model\SetUserLimitRequest $requestBody, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) |
456: | { |
457: | return $this->executeEndpoint(new \NxSys\Library\Clients\Brex\API\Team\Endpoint\SetUserLimit($id, $requestBody, $headerParameters), $fetch); |
458: | } |
459: | |
460: | public static function create($httpClient = null, array $additionalPlugins = [], array $additionalNormalizers = []) |
461: | { |
462: | if (null === $httpClient) { |
463: | $httpClient = \Http\Discovery\Psr18ClientDiscovery::find(); |
464: | $plugins = []; |
465: | $uri = \Http\Discovery\Psr17FactoryDiscovery::findUrlFactory()->createUri('https://platform.brexapis.com'); |
466: | $plugins[] = new \Http\Client\Common\Plugin\AddHostPlugin($uri); |
467: | if (count($additionalPlugins) > 0) { |
468: | $plugins = array_merge($plugins, $additionalPlugins); |
469: | } |
470: | $httpClient = new \Http\Client\Common\PluginClient($httpClient, $plugins); |
471: | } |
472: | $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); |
473: | $streamFactory = \Http\Discovery\Psr17FactoryDiscovery::findStreamFactory(); |
474: | $normalizers = [new \Symfony\Component\Serializer\Normalizer\ArrayDenormalizer(), new \NxSys\Library\Clients\Brex\API\Team\Normalizer\JaneObjectNormalizer()]; |
475: | if (count($additionalNormalizers) > 0) { |
476: | $normalizers = array_merge($normalizers, $additionalNormalizers); |
477: | } |
478: | $serializer = new \Symfony\Component\Serializer\Serializer($normalizers, [new \Symfony\Component\Serializer\Encoder\JsonEncoder(new \Symfony\Component\Serializer\Encoder\JsonEncode(), new \Symfony\Component\Serializer\Encoder\JsonDecode(['json_decode_associative' => true]))]); |
479: | |
480: | return new static($httpClient, $requestFactory, $serializer, $streamFactory); |
481: | } |
482: | } |
483: |