Skip to content

Commit ee26ec5

Browse files
authored
Merge pull request #82 from Anteris-Dev/generate-client
Generates Updated Client
2 parents c3c0f57 + 3c037c9 commit ee26ec5

File tree

677 files changed

+10780
-3275
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

677 files changed

+10780
-3275
lines changed

src/API/ActionTypes/ActionTypePaginator.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,24 @@ class ActionTypePaginator
2020
/** @var PageEntity Page data transfer object. */
2121
protected PageEntity $page;
2222

23+
/** @var array Search params for POST /query request */
24+
protected $postParams;
25+
2326
/**
2427
* Sets up the paginator.
2528
*
2629
* @param HttpClient $client Http client for retrieving pages.
2730
* @param Response $response Response from Http client.
31+
* @param array $postParams Search params for POST /query request
2832
*
2933
* @author Aidan Casey <aidan.casey@anteris.com>
3034
*/
31-
public function __construct(HttpClient $client, $response)
35+
public function __construct(HttpClient $client, $response, $postParams = null)
3236
{
3337
$this->client = $client;
3438
$this->collection = ActionTypeCollection::fromResponse($response);
3539
$this->page = PageEntity::fromResponse($response);
40+
$this->postParams = $postParams;
3641
}
3742

3843
/**
@@ -70,7 +75,12 @@ public function hasPrevPage(): bool
7075
*/
7176
public function nextPage(): ActionTypePaginator
7277
{
73-
$response = $this->client->getClient()->get($this->page->nextPageUrl);
78+
if(is_null($this->postParams)){
79+
$response = $this->client->getClient()->get($this->page->nextPageUrl);
80+
}else{
81+
$response = $this->client->getClient()->post($this->page->nextPageUrl, ['json' => $this->postParams]);
82+
}
83+
7484
return new static($this->client, $response);
7585
}
7686

@@ -81,7 +91,12 @@ public function nextPage(): ActionTypePaginator
8191
*/
8292
public function prevPage (): ActionTypePaginator
8393
{
84-
$response = $this->client->getClient()->get($this->page->prevPageUrl);
94+
if(is_null($this->postParams)){
95+
$response = $this->client->getClient()->get($this->page->prevPageUrl);
96+
}else{
97+
$response = $this->client->getClient()->post($this->page->prevPageUrl, ['json' => $this->postParams]);
98+
}
99+
85100
return new static($this->client, $response);
86101
}
87102
}

src/API/ActionTypes/ActionTypeQueryBuilder.php

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class ActionTypeQueryBuilder
2222
/** @var int The maximum number of records to be returned. */
2323
protected int $records;
2424

25+
private const GET_LIMIT = 1800;
26+
2527
/**
2628
* Sets up the class to perform a query.
2729
*
@@ -42,9 +44,13 @@ public function __construct(
4244
*/
4345
public function count(): int
4446
{
45-
$response = $this->client->get("ActionTypes/query/count", [
46-
'search' => json_encode( $this->toArray() )
47-
]);
47+
if (strlen($this->__toString()) >= self::GET_LIMIT) {
48+
$response = $this->client->post("ActionTypes/query/count", $this->toArray());
49+
}else{
50+
$response = $this->client->get("ActionTypes/query/count", [
51+
'search' => json_encode( $this->toArray() )
52+
]);
53+
}
4854

4955
$responseArray = json_decode($response->getBody(), true);
5056

@@ -84,9 +90,13 @@ public function loop(callable $callback)
8490
*/
8591
public function get(): ActionTypeCollection
8692
{
87-
$response = $this->client->get("ActionTypes/query", [
88-
'search' => json_encode( $this->toArray() )
89-
]);
93+
if (strlen($this->__toString()) >= self::GET_LIMIT) {
94+
$response = $this->client->post("ActionTypes/query", $this->toArray());
95+
}else{
96+
$response = $this->client->get("ActionTypes/query", [
97+
'search' => json_encode( $this->toArray() )
98+
]);
99+
}
90100

91101
return ActionTypeCollection::fromResponse($response);
92102
}
@@ -96,11 +106,15 @@ public function get(): ActionTypeCollection
96106
*/
97107
public function paginate(): ActionTypePaginator
98108
{
99-
$response = $this->client->get("ActionTypes/query", [
100-
'search' => json_encode($this->toArray())
101-
]);
102-
103-
return new ActionTypePaginator($this->client, $response);
109+
if (strlen($this->__toString()) >= self::GET_LIMIT) {
110+
$response = $this->client->post("ActionTypes/query", $this->toArray());
111+
return new ActionTypePaginator($this->client, $response, $this->toArray());
112+
}else{
113+
$response = $this->client->get("ActionTypes/query", [
114+
'search' => json_encode( $this->toArray() )
115+
]);
116+
return new ActionTypePaginator($this->client, $response);
117+
}
104118
}
105119

106120
/**

src/API/ActionTypes/ActionTypeService.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class ActionTypeService
1515
{
1616
/** @var Client An HTTP client for making requests to the Autotask API. */
1717
protected HttpClient $client;
18-
1918
/**
2019
* Instantiates the class.
2120
*

src/API/AdditionalInvoiceFieldValues/AdditionalInvoiceFieldValuePaginator.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,24 @@ class AdditionalInvoiceFieldValuePaginator
2020
/** @var PageEntity Page data transfer object. */
2121
protected PageEntity $page;
2222

23+
/** @var array Search params for POST /query request */
24+
protected $postParams;
25+
2326
/**
2427
* Sets up the paginator.
2528
*
2629
* @param HttpClient $client Http client for retrieving pages.
2730
* @param Response $response Response from Http client.
31+
* @param array $postParams Search params for POST /query request
2832
*
2933
* @author Aidan Casey <aidan.casey@anteris.com>
3034
*/
31-
public function __construct(HttpClient $client, $response)
35+
public function __construct(HttpClient $client, $response, $postParams = null)
3236
{
3337
$this->client = $client;
3438
$this->collection = AdditionalInvoiceFieldValueCollection::fromResponse($response);
3539
$this->page = PageEntity::fromResponse($response);
40+
$this->postParams = $postParams;
3641
}
3742

3843
/**
@@ -70,7 +75,12 @@ public function hasPrevPage(): bool
7075
*/
7176
public function nextPage(): AdditionalInvoiceFieldValuePaginator
7277
{
73-
$response = $this->client->getClient()->get($this->page->nextPageUrl);
78+
if(is_null($this->postParams)){
79+
$response = $this->client->getClient()->get($this->page->nextPageUrl);
80+
}else{
81+
$response = $this->client->getClient()->post($this->page->nextPageUrl, ['json' => $this->postParams]);
82+
}
83+
7484
return new static($this->client, $response);
7585
}
7686

@@ -81,7 +91,12 @@ public function nextPage(): AdditionalInvoiceFieldValuePaginator
8191
*/
8292
public function prevPage (): AdditionalInvoiceFieldValuePaginator
8393
{
84-
$response = $this->client->getClient()->get($this->page->prevPageUrl);
94+
if(is_null($this->postParams)){
95+
$response = $this->client->getClient()->get($this->page->prevPageUrl);
96+
}else{
97+
$response = $this->client->getClient()->post($this->page->prevPageUrl, ['json' => $this->postParams]);
98+
}
99+
85100
return new static($this->client, $response);
86101
}
87102
}

src/API/AdditionalInvoiceFieldValues/AdditionalInvoiceFieldValueQueryBuilder.php

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class AdditionalInvoiceFieldValueQueryBuilder
2222
/** @var int The maximum number of records to be returned. */
2323
protected int $records;
2424

25+
private const GET_LIMIT = 1800;
26+
2527
/**
2628
* Sets up the class to perform a query.
2729
*
@@ -42,9 +44,13 @@ public function __construct(
4244
*/
4345
public function count(): int
4446
{
45-
$response = $this->client->get("AdditionalInvoiceFieldValues/query/count", [
46-
'search' => json_encode( $this->toArray() )
47-
]);
47+
if (strlen($this->__toString()) >= self::GET_LIMIT) {
48+
$response = $this->client->post("AdditionalInvoiceFieldValues/query/count", $this->toArray());
49+
}else{
50+
$response = $this->client->get("AdditionalInvoiceFieldValues/query/count", [
51+
'search' => json_encode( $this->toArray() )
52+
]);
53+
}
4854

4955
$responseArray = json_decode($response->getBody(), true);
5056

@@ -84,9 +90,13 @@ public function loop(callable $callback)
8490
*/
8591
public function get(): AdditionalInvoiceFieldValueCollection
8692
{
87-
$response = $this->client->get("AdditionalInvoiceFieldValues/query", [
88-
'search' => json_encode( $this->toArray() )
89-
]);
93+
if (strlen($this->__toString()) >= self::GET_LIMIT) {
94+
$response = $this->client->post("AdditionalInvoiceFieldValues/query", $this->toArray());
95+
}else{
96+
$response = $this->client->get("AdditionalInvoiceFieldValues/query", [
97+
'search' => json_encode( $this->toArray() )
98+
]);
99+
}
90100

91101
return AdditionalInvoiceFieldValueCollection::fromResponse($response);
92102
}
@@ -96,11 +106,15 @@ public function get(): AdditionalInvoiceFieldValueCollection
96106
*/
97107
public function paginate(): AdditionalInvoiceFieldValuePaginator
98108
{
99-
$response = $this->client->get("AdditionalInvoiceFieldValues/query", [
100-
'search' => json_encode($this->toArray())
101-
]);
102-
103-
return new AdditionalInvoiceFieldValuePaginator($this->client, $response);
109+
if (strlen($this->__toString()) >= self::GET_LIMIT) {
110+
$response = $this->client->post("AdditionalInvoiceFieldValues/query", $this->toArray());
111+
return new AdditionalInvoiceFieldValuePaginator($this->client, $response, $this->toArray());
112+
}else{
113+
$response = $this->client->get("AdditionalInvoiceFieldValues/query", [
114+
'search' => json_encode( $this->toArray() )
115+
]);
116+
return new AdditionalInvoiceFieldValuePaginator($this->client, $response);
117+
}
104118
}
105119

106120
/**

src/API/AdditionalInvoiceFieldValues/AdditionalInvoiceFieldValueService.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class AdditionalInvoiceFieldValueService
1414
{
1515
/** @var Client An HTTP client for making requests to the Autotask API. */
1616
protected HttpClient $client;
17-
1817
/**
1918
* Instantiates the class.
2019
*

src/API/Appointments/AppointmentPaginator.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,24 @@ class AppointmentPaginator
2020
/** @var PageEntity Page data transfer object. */
2121
protected PageEntity $page;
2222

23+
/** @var array Search params for POST /query request */
24+
protected $postParams;
25+
2326
/**
2427
* Sets up the paginator.
2528
*
2629
* @param HttpClient $client Http client for retrieving pages.
2730
* @param Response $response Response from Http client.
31+
* @param array $postParams Search params for POST /query request
2832
*
2933
* @author Aidan Casey <aidan.casey@anteris.com>
3034
*/
31-
public function __construct(HttpClient $client, $response)
35+
public function __construct(HttpClient $client, $response, $postParams = null)
3236
{
3337
$this->client = $client;
3438
$this->collection = AppointmentCollection::fromResponse($response);
3539
$this->page = PageEntity::fromResponse($response);
40+
$this->postParams = $postParams;
3641
}
3742

3843
/**
@@ -70,7 +75,12 @@ public function hasPrevPage(): bool
7075
*/
7176
public function nextPage(): AppointmentPaginator
7277
{
73-
$response = $this->client->getClient()->get($this->page->nextPageUrl);
78+
if(is_null($this->postParams)){
79+
$response = $this->client->getClient()->get($this->page->nextPageUrl);
80+
}else{
81+
$response = $this->client->getClient()->post($this->page->nextPageUrl, ['json' => $this->postParams]);
82+
}
83+
7484
return new static($this->client, $response);
7585
}
7686

@@ -81,7 +91,12 @@ public function nextPage(): AppointmentPaginator
8191
*/
8292
public function prevPage (): AppointmentPaginator
8393
{
84-
$response = $this->client->getClient()->get($this->page->prevPageUrl);
94+
if(is_null($this->postParams)){
95+
$response = $this->client->getClient()->get($this->page->prevPageUrl);
96+
}else{
97+
$response = $this->client->getClient()->post($this->page->prevPageUrl, ['json' => $this->postParams]);
98+
}
99+
85100
return new static($this->client, $response);
86101
}
87102
}

src/API/Appointments/AppointmentQueryBuilder.php

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class AppointmentQueryBuilder
2222
/** @var int The maximum number of records to be returned. */
2323
protected int $records;
2424

25+
private const GET_LIMIT = 1800;
26+
2527
/**
2628
* Sets up the class to perform a query.
2729
*
@@ -42,9 +44,13 @@ public function __construct(
4244
*/
4345
public function count(): int
4446
{
45-
$response = $this->client->get("Appointments/query/count", [
46-
'search' => json_encode( $this->toArray() )
47-
]);
47+
if (strlen($this->__toString()) >= self::GET_LIMIT) {
48+
$response = $this->client->post("Appointments/query/count", $this->toArray());
49+
}else{
50+
$response = $this->client->get("Appointments/query/count", [
51+
'search' => json_encode( $this->toArray() )
52+
]);
53+
}
4854

4955
$responseArray = json_decode($response->getBody(), true);
5056

@@ -84,9 +90,13 @@ public function loop(callable $callback)
8490
*/
8591
public function get(): AppointmentCollection
8692
{
87-
$response = $this->client->get("Appointments/query", [
88-
'search' => json_encode( $this->toArray() )
89-
]);
93+
if (strlen($this->__toString()) >= self::GET_LIMIT) {
94+
$response = $this->client->post("Appointments/query", $this->toArray());
95+
}else{
96+
$response = $this->client->get("Appointments/query", [
97+
'search' => json_encode( $this->toArray() )
98+
]);
99+
}
90100

91101
return AppointmentCollection::fromResponse($response);
92102
}
@@ -96,11 +106,15 @@ public function get(): AppointmentCollection
96106
*/
97107
public function paginate(): AppointmentPaginator
98108
{
99-
$response = $this->client->get("Appointments/query", [
100-
'search' => json_encode($this->toArray())
101-
]);
102-
103-
return new AppointmentPaginator($this->client, $response);
109+
if (strlen($this->__toString()) >= self::GET_LIMIT) {
110+
$response = $this->client->post("Appointments/query", $this->toArray());
111+
return new AppointmentPaginator($this->client, $response, $this->toArray());
112+
}else{
113+
$response = $this->client->get("Appointments/query", [
114+
'search' => json_encode( $this->toArray() )
115+
]);
116+
return new AppointmentPaginator($this->client, $response);
117+
}
104118
}
105119

106120
/**

src/API/Appointments/AppointmentService.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class AppointmentService
1515
{
1616
/** @var Client An HTTP client for making requests to the Autotask API. */
1717
protected HttpClient $client;
18-
1918
/**
2019
* Instantiates the class.
2120
*

src/API/ArticleAttachments/ArticleAttachmentEntity.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class ArticleAttachmentEntity extends DataTransferObject
2424
public $id;
2525
public ?int $impersonatorCreatorResourceID;
2626
public $opportunityID;
27+
public ?int $parentAttachmentID;
2728
public $parentID;
2829
public int $publish;
2930
public string $title;

0 commit comments

Comments
 (0)