Skip to content

Commit e0f442a

Browse files
committed
Generates Xero-PHP 2.21.0 from Xero-OpenAPI 2.36.0
1 parent 82d24f1 commit e0f442a

25 files changed

+887
-32
lines changed

docs/v2/accounting/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6073,7 +6073,7 @@
60736073
<nav id="scrollingNav">
60746074
<ul class="sidenav nav nav-list">
60756075
<li class="nav-header" data-group="Accounting"><strong>SDK: </strong><span id='sdk-name'></span></li>
6076-
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>2.20.0</li>
6076+
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>2.21.0</li>
60776077
<li class="nav-header" data-group="Accounting"><a href="#api-Accounting">Methods</a></li>
60786078
<li data-group="Accounting" data-name="createAccount" class="">
60796079
<a href="#api-Accounting-createAccount">createAccount</a>

docs/v2/appstore/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@
12401240
<nav id="scrollingNav">
12411241
<ul class="sidenav nav nav-list">
12421242
<li class="nav-header" data-group="AppStore"><strong>SDK: </strong><span id='sdk-name'></span></li>
1243-
<li class="nav-header" data-group="AppStore"><strong>VSN: </strong>2.20.0</li>
1243+
<li class="nav-header" data-group="AppStore"><strong>VSN: </strong>2.21.0</li>
12441244
<li class="nav-header" data-group="AppStore"><a href="#api-AppStore">Methods</a></li>
12451245
<li data-group="AppStore" data-name="getSubscription" class="">
12461246
<a href="#api-AppStore-getSubscription">getSubscription</a>

docs/v2/assets/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@
13911391
<nav id="scrollingNav">
13921392
<ul class="sidenav nav nav-list">
13931393
<li class="nav-header" data-group="Asset"><strong>SDK: </strong><span id='sdk-name'></span></li>
1394-
<li class="nav-header" data-group="Asset"><strong>VSN: </strong>2.20.0</li>
1394+
<li class="nav-header" data-group="Asset"><strong>VSN: </strong>2.21.0</li>
13951395
<li class="nav-header" data-group="Asset"><a href="#api-Asset">Methods</a></li>
13961396
<li data-group="Asset" data-name="createAsset" class="">
13971397
<a href="#api-Asset-createAsset">createAsset</a>

docs/v2/files/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@
11541154
<nav id="scrollingNav">
11551155
<ul class="sidenav nav nav-list">
11561156
<li class="nav-header" data-group="Files"><strong>SDK: </strong><span id='sdk-name'></span></li>
1157-
<li class="nav-header" data-group="Files"><strong>VSN: </strong>2.20.0</li>
1157+
<li class="nav-header" data-group="Files"><strong>VSN: </strong>2.21.0</li>
11581158
<li class="nav-header" data-group="Files"><a href="#api-Files">Methods</a></li>
11591159
<li data-group="Files" data-name="createFileAssociation" class="">
11601160
<a href="#api-Files-createFileAssociation">createFileAssociation</a>

docs/v2/finance/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2733,7 +2733,7 @@
27332733
<nav id="scrollingNav">
27342734
<ul class="sidenav nav nav-list">
27352735
<li class="nav-header" data-group="Finance"><strong>SDK: </strong><span id='sdk-name'></span></li>
2736-
<li class="nav-header" data-group="Finance"><strong>VSN: </strong>2.20.0</li>
2736+
<li class="nav-header" data-group="Finance"><strong>VSN: </strong>2.21.0</li>
27372737
<li class="nav-header" data-group="Finance"><a href="#api-Finance">Methods</a></li>
27382738
<li data-group="Finance" data-name="getAccountingActivityAccountUsage" class="">
27392739
<a href="#api-Finance-getAccountingActivityAccountUsage">getAccountingActivityAccountUsage</a>

docs/v2/payroll_au/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3353,7 +3353,7 @@
33533353
<nav id="scrollingNav">
33543354
<ul class="sidenav nav nav-list">
33553355
<li class="nav-header" data-group="PayrollAu"><strong>SDK: </strong><span id='sdk-name'></span></li>
3356-
<li class="nav-header" data-group="PayrollAu"><strong>VSN: </strong>2.20.0</li>
3356+
<li class="nav-header" data-group="PayrollAu"><strong>VSN: </strong>2.21.0</li>
33573357
<li class="nav-header" data-group="PayrollAu"><a href="#api-PayrollAu">Methods</a></li>
33583358
<li data-group="PayrollAu" data-name="createEmployee" class="">
33593359
<a href="#api-PayrollAu-createEmployee">createEmployee</a>

docs/v2/payroll_nz/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3837,7 +3837,7 @@
38373837
<nav id="scrollingNav">
38383838
<ul class="sidenav nav nav-list">
38393839
<li class="nav-header" data-group="PayrollNz"><strong>SDK: </strong><span id='sdk-name'></span></li>
3840-
<li class="nav-header" data-group="PayrollNz"><strong>VSN: </strong>2.20.0</li>
3840+
<li class="nav-header" data-group="PayrollNz"><strong>VSN: </strong>2.21.0</li>
38413841
<li class="nav-header" data-group="PayrollNz"><a href="#api-PayrollNz">Methods</a></li>
38423842
<li data-group="PayrollNz" data-name="approveTimesheet" class="">
38433843
<a href="#api-PayrollNz-approveTimesheet">approveTimesheet</a>

docs/v2/payroll_uk/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3509,7 +3509,7 @@
35093509
<nav id="scrollingNav">
35103510
<ul class="sidenav nav nav-list">
35113511
<li class="nav-header" data-group="PayrollUk"><strong>SDK: </strong><span id='sdk-name'></span></li>
3512-
<li class="nav-header" data-group="PayrollUk"><strong>VSN: </strong>2.20.0</li>
3512+
<li class="nav-header" data-group="PayrollUk"><strong>VSN: </strong>2.21.0</li>
35133513
<li class="nav-header" data-group="PayrollUk"><a href="#api-PayrollUk">Methods</a></li>
35143514
<li data-group="PayrollUk" data-name="approveTimesheet" class="">
35153515
<a href="#api-PayrollUk-approveTimesheet">approveTimesheet</a>

docs/v2/projects/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@
14611461
<nav id="scrollingNav">
14621462
<ul class="sidenav nav nav-list">
14631463
<li class="nav-header" data-group="Project"><strong>SDK: </strong><span id='sdk-name'></span></li>
1464-
<li class="nav-header" data-group="Project"><strong>VSN: </strong>2.20.0</li>
1464+
<li class="nav-header" data-group="Project"><strong>VSN: </strong>2.21.0</li>
14651465
<li class="nav-header" data-group="Project"><a href="#api-Project">Methods</a></li>
14661466
<li data-group="Project" data-name="createProject" class="">
14671467
<a href="#api-Project-createProject">createProject</a>

lib/Api/AccountingApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
1616
*
17-
* OpenAPI spec version: 2.35.0
17+
* OpenAPI spec version: 2.36.0
1818
* Contact: [email protected]
1919
* Generated by: https://openapi-generator.tech
2020
* OpenAPI Generator version: 5.4.0

lib/Api/AppStoreApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* These endpoints are for Xero Partners to interact with the App Store Billing platform
1616
*
17-
* OpenAPI spec version: 2.35.0
17+
* OpenAPI spec version: 2.36.0
1818
* Contact: [email protected]
1919
* Generated by: https://openapi-generator.tech
2020
* OpenAPI Generator version: 5.4.0

lib/Api/AssetApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* The Assets API exposes fixed asset related functions of the Xero Accounting application and can be used for a variety of purposes such as creating assets, retrieving asset valuations etc.
1616
*
17-
* OpenAPI spec version: 2.35.0
17+
* OpenAPI spec version: 2.36.0
1818
* Contact: [email protected]
1919
* Generated by: https://openapi-generator.tech
2020
* OpenAPI Generator version: 5.4.0

lib/Api/FilesApi.php

Lines changed: 250 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* These endpoints are specific to Xero Files API
1616
*
17-
* OpenAPI spec version: 2.35.0
17+
* OpenAPI spec version: 2.36.0
1818
* Contact: [email protected]
1919
* Generated by: https://openapi-generator.tech
2020
* OpenAPI Generator version: 5.4.0
@@ -1469,6 +1469,255 @@ protected function getAssociationsByObjectRequest($xero_tenant_id, $object_id)
14691469
);
14701470
}
14711471

1472+
/**
1473+
* Operation getAssociationsCount
1474+
* Retrieves a count of associations for a list of objects.
1475+
* @param string $xero_tenant_id Xero identifier for Tenant (required)
1476+
* @param string[] $object_ids A comma-separated list of object ids (required)
1477+
* @throws \XeroAPI\XeroPHP\ApiException on non-2xx response
1478+
* @throws \InvalidArgumentException
1479+
* @return object
1480+
*/
1481+
public function getAssociationsCount($xero_tenant_id, $object_ids)
1482+
{
1483+
list($response) = $this->getAssociationsCountWithHttpInfo($xero_tenant_id, $object_ids);
1484+
return $response;
1485+
}
1486+
/**
1487+
* Operation getAssociationsCountWithHttpInfo
1488+
* Retrieves a count of associations for a list of objects.
1489+
* @param string $xero_tenant_id Xero identifier for Tenant (required)
1490+
* @param string[] $object_ids A comma-separated list of object ids (required)
1491+
* @throws \XeroAPI\XeroPHP\ApiException on non-2xx response
1492+
* @throws \InvalidArgumentException
1493+
* @return array of object, HTTP status code, HTTP response headers (array of strings)
1494+
*/
1495+
public function getAssociationsCountWithHttpInfo($xero_tenant_id, $object_ids)
1496+
{
1497+
$request = $this->getAssociationsCountRequest($xero_tenant_id, $object_ids);
1498+
try {
1499+
$options = $this->createHttpClientOption();
1500+
try {
1501+
$response = $this->client->send($request, $options);
1502+
} catch (RequestException $e) {
1503+
throw new ApiException(
1504+
"[{$e->getCode()}] {$e->getMessage()}",
1505+
$e->getCode(),
1506+
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
1507+
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
1508+
);
1509+
}
1510+
$statusCode = $response->getStatusCode();
1511+
if ($statusCode < 200 || $statusCode > 299) {
1512+
throw new ApiException(
1513+
sprintf(
1514+
'[%d] Error connecting to the API (%s)',
1515+
$statusCode,
1516+
$request->getUri()
1517+
),
1518+
$statusCode,
1519+
$response->getHeaders(),
1520+
$response->getBody()
1521+
);
1522+
}
1523+
$responseBody = $response->getBody();
1524+
switch($statusCode) {
1525+
case 200:
1526+
if ('object' === '\SplFileObject') {
1527+
$content = $responseBody; //stream goes to serializer
1528+
} else {
1529+
$content = $responseBody->getContents();
1530+
}
1531+
return [
1532+
FileObjectSerializer::deserialize($content, 'object', []),
1533+
$response->getStatusCode(),
1534+
$response->getHeaders()
1535+
];
1536+
}
1537+
$returnType = 'object';
1538+
$responseBody = $response->getBody();
1539+
if ($returnType === '\SplFileObject') {
1540+
$content = $responseBody; //stream goes to serializer
1541+
} else {
1542+
$content = $responseBody->getContents();
1543+
}
1544+
return [
1545+
FileObjectSerializer::deserialize($content, $returnType, []),
1546+
$response->getStatusCode(),
1547+
$response->getHeaders()
1548+
];
1549+
} catch (ApiException $e) {
1550+
switch ($e->getCode()) {
1551+
case 200:
1552+
$data = FileObjectSerializer::deserialize(
1553+
$e->getResponseBody(),
1554+
'object',
1555+
$e->getResponseHeaders()
1556+
);
1557+
$e->setResponseObject($data);
1558+
break;
1559+
}
1560+
throw $e;
1561+
}
1562+
}
1563+
/**
1564+
* Operation getAssociationsCountAsync
1565+
* Retrieves a count of associations for a list of objects.
1566+
* @param string $xero_tenant_id Xero identifier for Tenant (required)
1567+
* @param string[] $object_ids A comma-separated list of object ids (required)
1568+
* @throws \InvalidArgumentException
1569+
* @return \GuzzleHttp\Promise\PromiseInterface
1570+
*/
1571+
public function getAssociationsCountAsync($xero_tenant_id, $object_ids)
1572+
{
1573+
return $this->getAssociationsCountAsyncWithHttpInfo($xero_tenant_id, $object_ids)
1574+
->then(
1575+
function ($response) {
1576+
return $response[0];
1577+
}
1578+
);
1579+
}
1580+
/**
1581+
* Operation getAssociationsCountAsyncWithHttpInfo
1582+
* Retrieves a count of associations for a list of objects.
1583+
* @param string $xero_tenant_id Xero identifier for Tenant (required)
1584+
* @param string[] $object_ids A comma-separated list of object ids (required)
1585+
* @throws \InvalidArgumentException
1586+
* @return \GuzzleHttp\Promise\PromiseInterface */
1587+
public function getAssociationsCountAsyncWithHttpInfo($xero_tenant_id, $object_ids)
1588+
{
1589+
$returnType = 'object';
1590+
$request = $this->getAssociationsCountRequest($xero_tenant_id, $object_ids);
1591+
return $this->client
1592+
->sendAsync($request, $this->createHttpClientOption())
1593+
->then(
1594+
function ($response) use ($returnType) {
1595+
$responseBody = $response->getBody();
1596+
if ($returnType === '\SplFileObject') {
1597+
$content = $responseBody; //stream goes to serializer
1598+
} else {
1599+
$content = $responseBody->getContents();
1600+
}
1601+
return [
1602+
FileObjectSerializer::deserialize($content, $returnType, []),
1603+
$response->getStatusCode(),
1604+
$response->getHeaders()
1605+
];
1606+
},
1607+
function ($exception) {
1608+
$response = $exception->getResponse();
1609+
$statusCode = $response->getStatusCode();
1610+
throw new ApiException(
1611+
sprintf(
1612+
'[%d] Error connecting to the API (%s)',
1613+
$statusCode,
1614+
$exception->getRequest()->getUri()
1615+
),
1616+
$statusCode,
1617+
$response->getHeaders(),
1618+
$response->getBody()
1619+
);
1620+
}
1621+
);
1622+
}
1623+
1624+
/**
1625+
* Create request for operation 'getAssociationsCount'
1626+
* @param string $xero_tenant_id Xero identifier for Tenant (required)
1627+
* @param string[] $object_ids A comma-separated list of object ids (required)
1628+
* @throws \InvalidArgumentException
1629+
* @return \GuzzleHttp\Psr7\Request */
1630+
protected function getAssociationsCountRequest($xero_tenant_id, $object_ids)
1631+
{
1632+
// verify the required parameter 'xero_tenant_id' is set
1633+
if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) {
1634+
throw new \InvalidArgumentException(
1635+
'Missing the required parameter $xero_tenant_id when calling getAssociationsCount'
1636+
);
1637+
}
1638+
// verify the required parameter 'object_ids' is set
1639+
if ($object_ids === null || (is_array($object_ids) && count($object_ids) === 0)) {
1640+
throw new \InvalidArgumentException(
1641+
'Missing the required parameter $object_ids when calling getAssociationsCount'
1642+
);
1643+
}
1644+
$resourcePath = '/Associations/Count';
1645+
$formParams = [];
1646+
$queryParams = [];
1647+
$headerParams = [];
1648+
$httpBody = '';
1649+
$multipart = false;
1650+
// query params
1651+
if (is_array($object_ids)) {
1652+
$object_ids = FileObjectSerializer::serializeCollection($object_ids, 'multi', true);
1653+
}
1654+
if ($object_ids !== null) {
1655+
$queryParams['ObjectIds'] = FileObjectSerializer::toQueryValue($object_ids);
1656+
}
1657+
// header params
1658+
if ($xero_tenant_id !== null) {
1659+
$headerParams['xero-tenant-id'] = FileObjectSerializer::toHeaderValue($xero_tenant_id);
1660+
}
1661+
// body params
1662+
$_tempBody = null;
1663+
if ($multipart) {
1664+
$headers = $this->headerSelector->selectHeadersForMultipart(
1665+
['application/json']
1666+
);
1667+
} else {
1668+
$headers = $this->headerSelector->selectHeaders(
1669+
['application/json'],
1670+
[]
1671+
);
1672+
}
1673+
// for model (json/xml)
1674+
if (isset($_tempBody)) {
1675+
// $_tempBody is the method argument, if present
1676+
if ($headers['Content-Type'] === 'application/json') {
1677+
$httpBody = \GuzzleHttp\json_encode(FileObjectSerializer::sanitizeForSerialization($_tempBody));
1678+
} else {
1679+
$httpBody = $_tempBody;
1680+
}
1681+
} elseif (count($formParams) > 0) {
1682+
if ($multipart) {
1683+
$multipartContents = [
1684+
[
1685+
'Content-type' => 'multipart/form-data',
1686+
]
1687+
];
1688+
1689+
// for HTTP post (form)
1690+
$httpBody = new MultipartStream($multipartContents);
1691+
1692+
} elseif ($headers['Content-Type'] === 'application/json') {
1693+
$httpBody = \GuzzleHttp\json_encode($formParams);
1694+
} else {
1695+
// for HTTP post (form)
1696+
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
1697+
}
1698+
}
1699+
// this endpoint requires OAuth (access token)
1700+
if ($this->config->getAccessToken() !== null) {
1701+
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
1702+
}
1703+
$defaultHeaders = [];
1704+
if ($this->config->getUserAgent()) {
1705+
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
1706+
}
1707+
$headers = array_merge(
1708+
$defaultHeaders,
1709+
$headerParams,
1710+
$headers
1711+
);
1712+
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
1713+
return new Request(
1714+
'GET',
1715+
$this->config->getHostFile() . $resourcePath . ($query ? "?{$query}" : ''),
1716+
$headers,
1717+
$httpBody
1718+
);
1719+
}
1720+
14721721
/**
14731722
* Operation getFile
14741723
* Retrieves a file by a unique file ID

lib/Api/FinanceApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
1616
*
17-
* OpenAPI spec version: 2.35.0
17+
* OpenAPI spec version: 2.36.0
1818
* Contact: [email protected]
1919
* Generated by: https://openapi-generator.tech
2020
* OpenAPI Generator version: 5.4.0

lib/Api/IdentityApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* These endpoints are related to managing authentication tokens and identity for Xero API
1616
*
17-
* OpenAPI spec version: 2.35.0
17+
* OpenAPI spec version: 2.36.0
1818
* Contact: [email protected]
1919
* Generated by: https://openapi-generator.tech
2020
* OpenAPI Generator version: 5.4.0

lib/Api/PayrollAuApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* This is the Xero Payroll API for orgs in Australia region.
1616
*
17-
* OpenAPI spec version: 2.35.0
17+
* OpenAPI spec version: 2.36.0
1818
* Contact: [email protected]
1919
* Generated by: https://openapi-generator.tech
2020
* OpenAPI Generator version: 5.4.0

0 commit comments

Comments
 (0)