diff --git a/.changeset/nervous-sheep-attend.md b/.changeset/nervous-sheep-attend.md new file mode 100644 index 00000000..16ca6353 --- /dev/null +++ b/.changeset/nervous-sheep-attend.md @@ -0,0 +1,5 @@ +--- +"fingerprint-pro-server-api-php-sdk": minor +--- + +Introduce `toPrettyString` in models that returns json encoded model in a pretty format diff --git a/.changeset/rude-llamas-judge.md b/.changeset/rude-llamas-judge.md new file mode 100644 index 00000000..727098bc --- /dev/null +++ b/.changeset/rude-llamas-judge.md @@ -0,0 +1,5 @@ +--- +"fingerprint-pro-server-api-php-sdk": patch +--- + +Fix body in `updateEvent` method always being sent as empty json diff --git a/src/Api/FingerprintApi.php b/src/Api/FingerprintApi.php index db041489..1bc85928 100644 --- a/src/Api/FingerprintApi.php +++ b/src/Api/FingerprintApi.php @@ -31,6 +31,7 @@ use Fingerprint\ServerAPI\ApiException; use Fingerprint\ServerAPI\Configuration; use Fingerprint\ServerAPI\Model\EventUpdateRequest; +use Fingerprint\ServerAPI\Model\ModelInterface; use Fingerprint\ServerAPI\ObjectSerializer; use Fingerprint\ServerAPI\SerializationException; use GuzzleHttp\Client; @@ -1052,10 +1053,15 @@ protected function updateEventRequest(EventUpdateRequest $body, string $request_ if (isset($body)) { $_tempBody = $body; } + // for model (json/xml) if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - $httpBody = json_encode($_tempBody); + if ($_tempBody instanceof ModelInterface) { + $httpBody = (string) $_tempBody; + } else { + // $_tempBody is the method argument, if present + $httpBody = json_encode($_tempBody); + } } // this endpoint requires API key authentication diff --git a/src/Model/ASN.php b/src/Model/ASN.php index 1bc0bc51..c6eb7054 100644 --- a/src/Model/ASN.php +++ b/src/Model/ASN.php @@ -123,13 +123,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -322,4 +315,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/BotdDetectionResult.php b/src/Model/BotdDetectionResult.php index 2e30f92d..0f879192 100644 --- a/src/Model/BotdDetectionResult.php +++ b/src/Model/BotdDetectionResult.php @@ -123,13 +123,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -326,4 +319,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/BotdResult.php b/src/Model/BotdResult.php index 1a1da623..d0327e55 100644 --- a/src/Model/BotdResult.php +++ b/src/Model/BotdResult.php @@ -149,13 +149,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -448,4 +441,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/BrowserDetails.php b/src/Model/BrowserDetails.php index d5f10a56..f2ec0c53 100644 --- a/src/Model/BrowserDetails.php +++ b/src/Model/BrowserDetails.php @@ -153,13 +153,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -477,4 +470,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ClonedAppResult.php b/src/Model/ClonedAppResult.php index bb6058c3..93b1b241 100644 --- a/src/Model/ClonedAppResult.php +++ b/src/Model/ClonedAppResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/Common403ErrorResponse.php b/src/Model/Common403ErrorResponse.php index 08fccec6..e0711713 100644 --- a/src/Model/Common403ErrorResponse.php +++ b/src/Model/Common403ErrorResponse.php @@ -123,13 +123,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -332,4 +325,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/Confidence.php b/src/Model/Confidence.php index b2686b0c..e466f960 100644 --- a/src/Model/Confidence.php +++ b/src/Model/Confidence.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -291,4 +284,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/DataCenter.php b/src/Model/DataCenter.php index 4c979ad9..845b5708 100644 --- a/src/Model/DataCenter.php +++ b/src/Model/DataCenter.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -291,4 +284,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/DeprecatedIPLocation.php b/src/Model/DeprecatedIPLocation.php index 3229d2b3..6c985ddd 100644 --- a/src/Model/DeprecatedIPLocation.php +++ b/src/Model/DeprecatedIPLocation.php @@ -161,13 +161,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -489,4 +482,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/DeprecatedIPLocationCity.php b/src/Model/DeprecatedIPLocationCity.php index 72bfcd22..921f23d9 100644 --- a/src/Model/DeprecatedIPLocationCity.php +++ b/src/Model/DeprecatedIPLocationCity.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -257,4 +250,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/DeveloperToolsResult.php b/src/Model/DeveloperToolsResult.php index 9f16ce60..26644a07 100644 --- a/src/Model/DeveloperToolsResult.php +++ b/src/Model/DeveloperToolsResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/EmulatorResult.php b/src/Model/EmulatorResult.php index 2ff045a9..49f08214 100644 --- a/src/Model/EmulatorResult.php +++ b/src/Model/EmulatorResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorCommon403Response.php b/src/Model/ErrorCommon403Response.php index fdc00757..63939340 100644 --- a/src/Model/ErrorCommon403Response.php +++ b/src/Model/ErrorCommon403Response.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -257,4 +250,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorCommon429Response.php b/src/Model/ErrorCommon429Response.php index 0d8bcee4..44f634ef 100644 --- a/src/Model/ErrorCommon429Response.php +++ b/src/Model/ErrorCommon429Response.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -257,4 +250,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorCommon429ResponseError.php b/src/Model/ErrorCommon429ResponseError.php index 7e930734..122c02cc 100644 --- a/src/Model/ErrorCommon429ResponseError.php +++ b/src/Model/ErrorCommon429ResponseError.php @@ -119,13 +119,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -324,4 +317,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorEvent404Response.php b/src/Model/ErrorEvent404Response.php index 03cc4f6f..b24c53ee 100644 --- a/src/Model/ErrorEvent404Response.php +++ b/src/Model/ErrorEvent404Response.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -257,4 +250,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorEvent404ResponseError.php b/src/Model/ErrorEvent404ResponseError.php index 1e8e08ff..5cf4f0c4 100644 --- a/src/Model/ErrorEvent404ResponseError.php +++ b/src/Model/ErrorEvent404ResponseError.php @@ -119,13 +119,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -324,4 +317,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorUpdateEvent400Response.php b/src/Model/ErrorUpdateEvent400Response.php index ec572fed..47a7b1c9 100644 --- a/src/Model/ErrorUpdateEvent400Response.php +++ b/src/Model/ErrorUpdateEvent400Response.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -257,4 +250,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorUpdateEvent400ResponseError.php b/src/Model/ErrorUpdateEvent400ResponseError.php index 1a846943..885e204a 100644 --- a/src/Model/ErrorUpdateEvent400ResponseError.php +++ b/src/Model/ErrorUpdateEvent400ResponseError.php @@ -120,13 +120,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -326,4 +319,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorUpdateEvent409Response.php b/src/Model/ErrorUpdateEvent409Response.php index 988f3f87..a40384a2 100644 --- a/src/Model/ErrorUpdateEvent409Response.php +++ b/src/Model/ErrorUpdateEvent409Response.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -257,4 +250,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorUpdateEvent409ResponseError.php b/src/Model/ErrorUpdateEvent409ResponseError.php index d5e59471..39c429ec 100644 --- a/src/Model/ErrorUpdateEvent409ResponseError.php +++ b/src/Model/ErrorUpdateEvent409ResponseError.php @@ -119,13 +119,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -324,4 +317,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorVisitor400Response.php b/src/Model/ErrorVisitor400Response.php index a060ea8e..56900a67 100644 --- a/src/Model/ErrorVisitor400Response.php +++ b/src/Model/ErrorVisitor400Response.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -257,4 +250,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorVisitor400ResponseError.php b/src/Model/ErrorVisitor400ResponseError.php index 75686a3f..84f4af2b 100644 --- a/src/Model/ErrorVisitor400ResponseError.php +++ b/src/Model/ErrorVisitor400ResponseError.php @@ -119,13 +119,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -324,4 +317,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorVisitor404Response.php b/src/Model/ErrorVisitor404Response.php index 95b78522..014daa73 100644 --- a/src/Model/ErrorVisitor404Response.php +++ b/src/Model/ErrorVisitor404Response.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -257,4 +250,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorVisitor404ResponseError.php b/src/Model/ErrorVisitor404ResponseError.php index 5180dfb1..fb7c47ed 100644 --- a/src/Model/ErrorVisitor404ResponseError.php +++ b/src/Model/ErrorVisitor404ResponseError.php @@ -119,13 +119,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -324,4 +317,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ErrorVisits403.php b/src/Model/ErrorVisits403.php index d2791a9d..fec49142 100644 --- a/src/Model/ErrorVisits403.php +++ b/src/Model/ErrorVisits403.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/EventResponse.php b/src/Model/EventResponse.php index 96de7913..a0edc1b3 100644 --- a/src/Model/EventResponse.php +++ b/src/Model/EventResponse.php @@ -119,13 +119,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -293,4 +286,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/EventUpdateRequest.php b/src/Model/EventUpdateRequest.php index 6ca304fa..cdb8112e 100644 --- a/src/Model/EventUpdateRequest.php +++ b/src/Model/EventUpdateRequest.php @@ -123,13 +123,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -313,4 +306,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/FactoryResetResult.php b/src/Model/FactoryResetResult.php index 1ac00a95..1a16c0aa 100644 --- a/src/Model/FactoryResetResult.php +++ b/src/Model/FactoryResetResult.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -294,4 +287,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/FridaResult.php b/src/Model/FridaResult.php index e8b4d788..1f7205be 100644 --- a/src/Model/FridaResult.php +++ b/src/Model/FridaResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/HighActivityResult.php b/src/Model/HighActivityResult.php index 1e6a1d8e..bfb68736 100644 --- a/src/Model/HighActivityResult.php +++ b/src/Model/HighActivityResult.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -291,4 +284,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/IPLocation.php b/src/Model/IPLocation.php index d2eae611..b11d6bb5 100644 --- a/src/Model/IPLocation.php +++ b/src/Model/IPLocation.php @@ -159,13 +159,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -487,4 +480,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/IPLocationCity.php b/src/Model/IPLocationCity.php index 531de8b4..8ff4af05 100644 --- a/src/Model/IPLocationCity.php +++ b/src/Model/IPLocationCity.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -257,4 +250,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/IdentificationError.php b/src/Model/IdentificationError.php index 690dc8f1..601df77c 100644 --- a/src/Model/IdentificationError.php +++ b/src/Model/IdentificationError.php @@ -120,13 +120,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -326,4 +319,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/IncognitoResult.php b/src/Model/IncognitoResult.php index f5920155..e11fd50d 100644 --- a/src/Model/IncognitoResult.php +++ b/src/Model/IncognitoResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/IpBlockListResult.php b/src/Model/IpBlockListResult.php index d57b0ce4..e2d0f90c 100644 --- a/src/Model/IpBlockListResult.php +++ b/src/Model/IpBlockListResult.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -294,4 +287,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/IpBlockListResultDetails.php b/src/Model/IpBlockListResultDetails.php index 901937e8..58feb634 100644 --- a/src/Model/IpBlockListResultDetails.php +++ b/src/Model/IpBlockListResultDetails.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -294,4 +287,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/IpInfoResult.php b/src/Model/IpInfoResult.php index c8940ff3..40035fac 100644 --- a/src/Model/IpInfoResult.php +++ b/src/Model/IpInfoResult.php @@ -119,13 +119,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -287,4 +280,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/IpInfoResultV4.php b/src/Model/IpInfoResultV4.php index 3989e4e6..24667ebf 100644 --- a/src/Model/IpInfoResultV4.php +++ b/src/Model/IpInfoResultV4.php @@ -129,13 +129,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -350,4 +343,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/IpInfoResultV6.php b/src/Model/IpInfoResultV6.php index 9f4914d4..ebe4f21d 100644 --- a/src/Model/IpInfoResultV6.php +++ b/src/Model/IpInfoResultV6.php @@ -129,13 +129,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -350,4 +343,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/JailbrokenResult.php b/src/Model/JailbrokenResult.php index 09dde5a3..a1771381 100644 --- a/src/Model/JailbrokenResult.php +++ b/src/Model/JailbrokenResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/Location.php b/src/Model/Location.php index 72c7a482..2b18373e 100644 --- a/src/Model/Location.php +++ b/src/Model/Location.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -294,4 +287,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/LocationSpoofingResult.php b/src/Model/LocationSpoofingResult.php index 3e9ae815..c6bf81c7 100644 --- a/src/Model/LocationSpoofingResult.php +++ b/src/Model/LocationSpoofingResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/PrivacySettingsResult.php b/src/Model/PrivacySettingsResult.php index efe0093d..74765da2 100644 --- a/src/Model/PrivacySettingsResult.php +++ b/src/Model/PrivacySettingsResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ProductError.php b/src/Model/ProductError.php index 36cc5c1e..df41cd3d 100644 --- a/src/Model/ProductError.php +++ b/src/Model/ProductError.php @@ -120,13 +120,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -326,4 +319,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ProductsResponse.php b/src/Model/ProductsResponse.php index 27df5c6e..9e8cc41d 100644 --- a/src/Model/ProductsResponse.php +++ b/src/Model/ProductsResponse.php @@ -251,13 +251,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -903,4 +896,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ProductsResponseBotd.php b/src/Model/ProductsResponseBotd.php index bf541d04..9f2dbc23 100644 --- a/src/Model/ProductsResponseBotd.php +++ b/src/Model/ProductsResponseBotd.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ProductsResponseIdentification.php b/src/Model/ProductsResponseIdentification.php index c5ab4354..ec27e111 100644 --- a/src/Model/ProductsResponseIdentification.php +++ b/src/Model/ProductsResponseIdentification.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ProductsResponseIdentificationData.php b/src/Model/ProductsResponseIdentificationData.php index 97c553d8..3d659011 100644 --- a/src/Model/ProductsResponseIdentificationData.php +++ b/src/Model/ProductsResponseIdentificationData.php @@ -195,13 +195,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -690,4 +683,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ProxyResult.php b/src/Model/ProxyResult.php index 17d7e2c8..b51a0cf2 100644 --- a/src/Model/ProxyResult.php +++ b/src/Model/ProxyResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/RawDeviceAttributesResult.php b/src/Model/RawDeviceAttributesResult.php index 2f13768d..8db1f1e7 100644 --- a/src/Model/RawDeviceAttributesResult.php +++ b/src/Model/RawDeviceAttributesResult.php @@ -110,13 +110,6 @@ public function __construct(?array $data = null) {} */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -234,4 +227,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/RemoteControlResult.php b/src/Model/RemoteControlResult.php index 69020e7e..e4297ede 100644 --- a/src/Model/RemoteControlResult.php +++ b/src/Model/RemoteControlResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/Response.php b/src/Model/Response.php index 6cb9ed72..65aa8895 100644 --- a/src/Model/Response.php +++ b/src/Model/Response.php @@ -131,13 +131,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -354,4 +347,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/ResponseVisits.php b/src/Model/ResponseVisits.php index e5dd8525..83d9684d 100644 --- a/src/Model/ResponseVisits.php +++ b/src/Model/ResponseVisits.php @@ -189,13 +189,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -659,4 +652,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/RootAppsResult.php b/src/Model/RootAppsResult.php index cc4138eb..c112e93c 100644 --- a/src/Model/RootAppsResult.php +++ b/src/Model/RootAppsResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SeenAt.php b/src/Model/SeenAt.php index 26e11533..f6b41488 100644 --- a/src/Model/SeenAt.php +++ b/src/Model/SeenAt.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -294,4 +287,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseClonedApp.php b/src/Model/SignalResponseClonedApp.php index c65df140..b5e18335 100644 --- a/src/Model/SignalResponseClonedApp.php +++ b/src/Model/SignalResponseClonedApp.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseDeveloperTools.php b/src/Model/SignalResponseDeveloperTools.php index 42005f32..37a2d0b4 100644 --- a/src/Model/SignalResponseDeveloperTools.php +++ b/src/Model/SignalResponseDeveloperTools.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseEmulator.php b/src/Model/SignalResponseEmulator.php index 08735ee4..d6ad36b7 100644 --- a/src/Model/SignalResponseEmulator.php +++ b/src/Model/SignalResponseEmulator.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseFactoryReset.php b/src/Model/SignalResponseFactoryReset.php index 89f9b02a..e6a7e98f 100644 --- a/src/Model/SignalResponseFactoryReset.php +++ b/src/Model/SignalResponseFactoryReset.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseFrida.php b/src/Model/SignalResponseFrida.php index dbb10401..89d9a3b3 100644 --- a/src/Model/SignalResponseFrida.php +++ b/src/Model/SignalResponseFrida.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseHighActivity.php b/src/Model/SignalResponseHighActivity.php index 17a9deb6..5dab2814 100644 --- a/src/Model/SignalResponseHighActivity.php +++ b/src/Model/SignalResponseHighActivity.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseIncognito.php b/src/Model/SignalResponseIncognito.php index 420858fd..9c38f20f 100644 --- a/src/Model/SignalResponseIncognito.php +++ b/src/Model/SignalResponseIncognito.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseIpBlocklist.php b/src/Model/SignalResponseIpBlocklist.php index f3af9c5a..3195eb23 100644 --- a/src/Model/SignalResponseIpBlocklist.php +++ b/src/Model/SignalResponseIpBlocklist.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseIpInfo.php b/src/Model/SignalResponseIpInfo.php index 9b143421..8846828d 100644 --- a/src/Model/SignalResponseIpInfo.php +++ b/src/Model/SignalResponseIpInfo.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseJailbroken.php b/src/Model/SignalResponseJailbroken.php index 5c54d38b..f684a968 100644 --- a/src/Model/SignalResponseJailbroken.php +++ b/src/Model/SignalResponseJailbroken.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseLocationSpoofing.php b/src/Model/SignalResponseLocationSpoofing.php index 7ed72479..23e48323 100644 --- a/src/Model/SignalResponseLocationSpoofing.php +++ b/src/Model/SignalResponseLocationSpoofing.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponsePrivacySettings.php b/src/Model/SignalResponsePrivacySettings.php index 918a9fe7..2edb6448 100644 --- a/src/Model/SignalResponsePrivacySettings.php +++ b/src/Model/SignalResponsePrivacySettings.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseProxy.php b/src/Model/SignalResponseProxy.php index f5250ecb..4e550016 100644 --- a/src/Model/SignalResponseProxy.php +++ b/src/Model/SignalResponseProxy.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseRawDeviceAttributes.php b/src/Model/SignalResponseRawDeviceAttributes.php index 51074d90..4c793873 100644 --- a/src/Model/SignalResponseRawDeviceAttributes.php +++ b/src/Model/SignalResponseRawDeviceAttributes.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseRemoteControl.php b/src/Model/SignalResponseRemoteControl.php index d8ab06d8..f45559ae 100644 --- a/src/Model/SignalResponseRemoteControl.php +++ b/src/Model/SignalResponseRemoteControl.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseRootApps.php b/src/Model/SignalResponseRootApps.php index 7a9f1c87..54199609 100644 --- a/src/Model/SignalResponseRootApps.php +++ b/src/Model/SignalResponseRootApps.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseSuspectScore.php b/src/Model/SignalResponseSuspectScore.php index d72b79a2..0d8035b5 100644 --- a/src/Model/SignalResponseSuspectScore.php +++ b/src/Model/SignalResponseSuspectScore.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseTampering.php b/src/Model/SignalResponseTampering.php index fa639771..c609dcf6 100644 --- a/src/Model/SignalResponseTampering.php +++ b/src/Model/SignalResponseTampering.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseTor.php b/src/Model/SignalResponseTor.php index 5b5fdc4d..a00ee5ae 100644 --- a/src/Model/SignalResponseTor.php +++ b/src/Model/SignalResponseTor.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseVelocity.php b/src/Model/SignalResponseVelocity.php index 5a6dd716..fa875d95 100644 --- a/src/Model/SignalResponseVelocity.php +++ b/src/Model/SignalResponseVelocity.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseVirtualMachine.php b/src/Model/SignalResponseVirtualMachine.php index 0b15d17c..be481163 100644 --- a/src/Model/SignalResponseVirtualMachine.php +++ b/src/Model/SignalResponseVirtualMachine.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SignalResponseVpn.php b/src/Model/SignalResponseVpn.php index 5a583403..b571d78b 100644 --- a/src/Model/SignalResponseVpn.php +++ b/src/Model/SignalResponseVpn.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/Subdivision.php b/src/Model/Subdivision.php index 7302bae8..64e2f855 100644 --- a/src/Model/Subdivision.php +++ b/src/Model/Subdivision.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -285,4 +278,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/SuspectScoreResult.php b/src/Model/SuspectScoreResult.php index 5b0e0653..ea68a8e8 100644 --- a/src/Model/SuspectScoreResult.php +++ b/src/Model/SuspectScoreResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/TamperingResult.php b/src/Model/TamperingResult.php index 2653a12f..fc2eca7a 100644 --- a/src/Model/TamperingResult.php +++ b/src/Model/TamperingResult.php @@ -117,13 +117,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -294,4 +287,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/TooManyRequestsResponse.php b/src/Model/TooManyRequestsResponse.php index e3bfd5a5..4ba9e0c0 100644 --- a/src/Model/TooManyRequestsResponse.php +++ b/src/Model/TooManyRequestsResponse.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/TorResult.php b/src/Model/TorResult.php index 2d803ab0..1be43641 100644 --- a/src/Model/TorResult.php +++ b/src/Model/TorResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/VelocityIntervalResult.php b/src/Model/VelocityIntervalResult.php index ef23dd88..e0c8714b 100644 --- a/src/Model/VelocityIntervalResult.php +++ b/src/Model/VelocityIntervalResult.php @@ -125,13 +125,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -324,4 +317,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/VelocityIntervals.php b/src/Model/VelocityIntervals.php index 3a8c3735..1805dce4 100644 --- a/src/Model/VelocityIntervals.php +++ b/src/Model/VelocityIntervals.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -257,4 +250,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/VelocityResult.php b/src/Model/VelocityResult.php index c49a4f3b..96ed20d4 100644 --- a/src/Model/VelocityResult.php +++ b/src/Model/VelocityResult.php @@ -131,13 +131,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -358,4 +351,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/VirtualMachineResult.php b/src/Model/VirtualMachineResult.php index 3bf44306..45759440 100644 --- a/src/Model/VirtualMachineResult.php +++ b/src/Model/VirtualMachineResult.php @@ -111,13 +111,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -263,4 +256,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/VpnResult.php b/src/Model/VpnResult.php index c035b7a2..0e3b2901 100644 --- a/src/Model/VpnResult.php +++ b/src/Model/VpnResult.php @@ -139,13 +139,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -417,4 +410,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/VpnResultMethods.php b/src/Model/VpnResultMethods.php index 061daf32..913d1837 100644 --- a/src/Model/VpnResultMethods.php +++ b/src/Model/VpnResultMethods.php @@ -129,13 +129,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -356,4 +349,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/src/Model/WebhookVisit.php b/src/Model/WebhookVisit.php index bdfdd777..3f3b8b18 100644 --- a/src/Model/WebhookVisit.php +++ b/src/Model/WebhookVisit.php @@ -339,13 +339,6 @@ public function __construct(?array $data = null) */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } @@ -1359,4 +1352,16 @@ public function offsetUnset($offset): void { unset($this->container[$offset]); } + + /** + * Gets the string presentation of the object in a pretty JSON format. + * + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/template/api.mustache b/template/api.mustache index 790ac62e..b304fe2b 100644 --- a/template/api.mustache +++ b/template/api.mustache @@ -27,6 +27,7 @@ use {{invokerPackage}}\ApiException; use {{invokerPackage}}\Configuration; use {{invokerPackage}}\ObjectSerializer; use {{invokerPackage}}\SerializationException; +use {{invokerPackage}}\Model\ModelInterface; use Psr\Http\Message\ResponseInterface; use \GuzzleHttp\Exception\GuzzleException; @@ -338,10 +339,15 @@ use \GuzzleHttp\Exception\GuzzleException; if (isset(${{paramName}})) { $_tempBody = ${{paramName}}; } + // for model (json/xml) if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - $httpBody = json_encode($_tempBody); + if($_tempBody instanceof ModelInterface) { + $httpBody = (string)$_tempBody; + } else { + // $_tempBody is the method argument, if present + $httpBody = json_encode($_tempBody); + } } {{/bodyParams}} diff --git a/template/model_generic.mustache b/template/model_generic.mustache index a0786595..34b3bcfa 100644 --- a/template/model_generic.mustache +++ b/template/model_generic.mustache @@ -370,20 +370,26 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa unset($this->container[$offset]); } - /** + /** * Gets the string presentation of the object * * @return string */ public function __toString(): string { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } + + /** + * Gets the string presentation of the object in a pretty JSON format + * + * @return string + */ + public function toPrettyString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } } diff --git a/test/FingerprintApiTest.php b/test/FingerprintApiTest.php index 5d48f369..b74d2dfb 100644 --- a/test/FingerprintApiTest.php +++ b/test/FingerprintApiTest.php @@ -400,6 +400,25 @@ public function testDeleteVisitorData429Error() } } + public function testUpdateEvent() { + $this->mockHandler->reset(); + $this->mockHandler->append(new Response(200)); + $body = new EventUpdateRequest(); + $body->setLinkedId("test"); + $tag = [ + "test" => "true" + ]; + $body->setTag((object)$tag); + $body->setSuspect(false); + [, $res] = $this->fingerprint_api->updateEvent($body, self::MOCK_REQUEST_ID); + + $req = $this->mockHandler->getLastRequest(); + $this->assertEquals($req->getBody()->getContents(), $body); + $this->assertEquals("PUT", $req->getMethod()); + + $this->assertEquals(200, $res->getStatusCode()); + } + public function testUpdateEvent400Error() { $this->mockHandler->reset();