Skip to content

Commit bbd8f54

Browse files
Codegen: CRM Schemas
1 parent 09c6fd2 commit bbd8f54

21 files changed

Lines changed: 237 additions & 178 deletions

codegen/Crm/Schemas/Api/CoreApi.php

Lines changed: 81 additions & 100 deletions
Large diffs are not rendered by default.

codegen/Crm/Schemas/ApiException.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* The version of the OpenAPI document: v3
1818
* Generated by: https://openapi-generator.tech
19-
* OpenAPI Generator version: 7.3.0
19+
* Generator version: 7.12.0
2020
*/
2121

2222
/**
@@ -49,7 +49,7 @@ class ApiException extends Exception
4949
/**
5050
* The HTTP header of the server response.
5151
*
52-
* @var string[]|null
52+
* @var string[][]|null
5353
*/
5454
protected $responseHeaders;
5555

@@ -65,7 +65,7 @@ class ApiException extends Exception
6565
*
6666
* @param string $message Error message
6767
* @param int $code HTTP status code
68-
* @param string[]|null $responseHeaders HTTP response header
68+
* @param string[][]|null $responseHeaders HTTP response header
6969
* @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string
7070
*/
7171
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
@@ -78,7 +78,7 @@ public function __construct($message = "", $code = 0, $responseHeaders = [], $re
7878
/**
7979
* Gets the HTTP response header
8080
*
81-
* @return string[]|null HTTP response header
81+
* @return string[][]|null HTTP response header
8282
*/
8383
public function getResponseHeaders()
8484
{

codegen/Crm/Schemas/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* The version of the OpenAPI document: v3
1818
* Generated by: https://openapi-generator.tech
19-
* OpenAPI Generator version: 7.3.0
19+
* Generator version: 7.12.0
2020
*/
2121

2222
/**
@@ -486,7 +486,7 @@ public function getHostSettings()
486486
* @param array|null $variables hash of variable and the corresponding value (optional)
487487
* @return string URL based on host settings
488488
*/
489-
public static function getHostString(array $hostSettings, $hostIndex, array $variables = null)
489+
public static function getHostString(array $hostSettings, $hostIndex, ?array $variables = null)
490490
{
491491
if (null === $variables) {
492492
$variables = [];

codegen/Crm/Schemas/HeaderSelector.php

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* The version of the OpenAPI document: v3
1818
* Generated by: https://openapi-generator.tech
19-
* OpenAPI Generator version: 7.3.0
19+
* Generator version: 7.12.0
2020
*/
2121

2222
/**
@@ -85,7 +85,7 @@ private function selectAcceptHeader(array $accept): ?string
8585
}
8686

8787
# If none of the available Accept headers is of type "json", then just use all them
88-
$headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept);
88+
$headersWithJson = $this->selectJsonMimeList($accept);
8989
if (count($headersWithJson) === 0) {
9090
return implode(',', $accept);
9191
}
@@ -95,6 +95,34 @@ private function selectAcceptHeader(array $accept): ?string
9595
return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson);
9696
}
9797

98+
/**
99+
* Detects whether a string contains a valid JSON mime type
100+
*
101+
* @param string $searchString
102+
* @return bool
103+
*/
104+
public function isJsonMime(string $searchString): bool
105+
{
106+
return preg_match('~^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)~', $searchString) === 1;
107+
}
108+
109+
/**
110+
* Select all items from a list containing a JSON mime type
111+
*
112+
* @param array $mimeList
113+
* @return array
114+
*/
115+
private function selectJsonMimeList(array $mimeList): array {
116+
$jsonMimeList = [];
117+
foreach ($mimeList as $mime) {
118+
if($this->isJsonMime($mime)) {
119+
$jsonMimeList[] = $mime;
120+
}
121+
}
122+
return $jsonMimeList;
123+
}
124+
125+
98126
/**
99127
* Create an Accept header string from the given "Accept" headers array, recalculating all weights
100128
*

codegen/Crm/Schemas/Model/AssociationDefinition.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* The version of the OpenAPI document: v3
1919
* Generated by: https://openapi-generator.tech
20-
* OpenAPI Generator version: 7.3.0
20+
* Generator version: 7.12.0
2121
*/
2222

2323
/**
@@ -270,10 +270,10 @@ public function getModelName()
270270
/**
271271
* Constructor
272272
*
273-
* @param mixed[] $data Associated array of property values
273+
* @param mixed[]|null $data Associated array of property values
274274
* initializing the model
275275
*/
276-
public function __construct(array $data = null)
276+
public function __construct(?array $data = null)
277277
{
278278
$this->setIfExists('created_at', $data ?? [], null);
279279
$this->setIfExists('from_object_type_id', $data ?? [], null);

codegen/Crm/Schemas/Model/AssociationDefinitionEgg.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* The version of the OpenAPI document: v3
1919
* Generated by: https://openapi-generator.tech
20-
* OpenAPI Generator version: 7.3.0
20+
* Generator version: 7.12.0
2121
*/
2222

2323
/**
@@ -252,10 +252,10 @@ public function getModelName()
252252
/**
253253
* Constructor
254254
*
255-
* @param mixed[] $data Associated array of property values
255+
* @param mixed[]|null $data Associated array of property values
256256
* initializing the model
257257
*/
258-
public function __construct(array $data = null)
258+
public function __construct(?array $data = null)
259259
{
260260
$this->setIfExists('from_object_type_id', $data ?? [], null);
261261
$this->setIfExists('name', $data ?? [], null);

codegen/Crm/Schemas/Model/CollectionResponseObjectSchemaNoPaging.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* The version of the OpenAPI document: v3
1919
* Generated by: https://openapi-generator.tech
20-
* OpenAPI Generator version: 7.3.0
20+
* Generator version: 7.12.0
2121
*/
2222

2323
/**
@@ -239,10 +239,10 @@ public function getModelName()
239239
/**
240240
* Constructor
241241
*
242-
* @param mixed[] $data Associated array of property values
242+
* @param mixed[]|null $data Associated array of property values
243243
* initializing the model
244244
*/
245-
public function __construct(array $data = null)
245+
public function __construct(?array $data = null)
246246
{
247247
$this->setIfExists('results', $data ?? [], null);
248248
}

codegen/Crm/Schemas/Model/Error.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* The version of the OpenAPI document: v3
1919
* Generated by: https://openapi-generator.tech
20-
* OpenAPI Generator version: 7.3.0
20+
* Generator version: 7.12.0
2121
*/
2222

2323
/**
@@ -275,10 +275,10 @@ public function getModelName()
275275
/**
276276
* Constructor
277277
*
278-
* @param mixed[] $data Associated array of property values
278+
* @param mixed[]|null $data Associated array of property values
279279
* initializing the model
280280
*/
281-
public function __construct(array $data = null)
281+
public function __construct(?array $data = null)
282282
{
283283
$this->setIfExists('sub_category', $data ?? [], null);
284284
$this->setIfExists('context', $data ?? [], null);

codegen/Crm/Schemas/Model/ErrorDetail.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* The version of the OpenAPI document: v3
1919
* Generated by: https://openapi-generator.tech
20-
* OpenAPI Generator version: 7.3.0
20+
* Generator version: 7.12.0
2121
*/
2222

2323
/**
@@ -263,10 +263,10 @@ public function getModelName()
263263
/**
264264
* Constructor
265265
*
266-
* @param mixed[] $data Associated array of property values
266+
* @param mixed[]|null $data Associated array of property values
267267
* initializing the model
268268
*/
269-
public function __construct(array $data = null)
269+
public function __construct(?array $data = null)
270270
{
271271
$this->setIfExists('sub_category', $data ?? [], null);
272272
$this->setIfExists('code', $data ?? [], null);

codegen/Crm/Schemas/Model/ModelInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* The version of the OpenAPI document: v3
1919
* Generated by: https://openapi-generator.tech
20-
* OpenAPI Generator version: 7.3.0
20+
* Generator version: 7.12.0
2121
*/
2222

2323
/**

0 commit comments

Comments
 (0)