mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
According to the Guidelines for Contributing (https://github.com/OpenAPITools/openapi-generator/blob/master/CONTRIBUTING.md) generated PHP code should conform to PSR-12 (https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md). There are some minor violations regarding the following rule > There MUST NOT be trailing whitespace at the end of lines. This change removes trailing spaces in generated code.
95 lines
1.9 KiB
PHP
95 lines
1.9 KiB
PHP
<?php
|
|
/**
|
|
* ApiResponse
|
|
*
|
|
* PHP version 8.1.1
|
|
*
|
|
* @category Class
|
|
* @package OpenAPIServer\Model
|
|
* @author OpenAPI Generator team
|
|
* @link https://github.com/openapitools/openapi-generator
|
|
*/
|
|
|
|
/**
|
|
* OpenAPI Petstore
|
|
*
|
|
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0
|
|
*
|
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
|
*
|
|
*/
|
|
|
|
|
|
namespace OpenAPIServer\Model;
|
|
|
|
/**
|
|
* Class representing the ApiResponse model.
|
|
*
|
|
* Describes the result of uploading an image resource
|
|
*
|
|
* @package OpenAPIServer\Model
|
|
* @author OpenAPI Generator team
|
|
*/
|
|
|
|
class ApiResponse implements \JsonSerializable
|
|
{
|
|
/**
|
|
* @var int|null
|
|
* @SerializedName("code")
|
|
* @Assert\Type("int")
|
|
* @Type("int")
|
|
*/
|
|
public ?int $code;
|
|
|
|
/**
|
|
* @var string|null
|
|
* @SerializedName("type")
|
|
* @Assert\Type("string")
|
|
* @Type("string")
|
|
*/
|
|
public ?string $type;
|
|
|
|
/**
|
|
* @var string|null
|
|
* @SerializedName("message")
|
|
* @Assert\Type("string")
|
|
* @Type("string")
|
|
*/
|
|
public ?string $message;
|
|
|
|
/**
|
|
* Constructor
|
|
*
|
|
* @param int|null $code
|
|
* @param string|null $type
|
|
* @param string|null $message
|
|
*/
|
|
public function __construct(?int $code, ?string $type, ?string $message)
|
|
{
|
|
$this->code = $code;
|
|
$this->type = $type;
|
|
$this->message = $message;
|
|
}
|
|
|
|
public static function fromArray(array $data): self
|
|
{
|
|
return new self(
|
|
$data['code'] ?? null,
|
|
$data['type'] ?? null,
|
|
$data['message'] ?? null,
|
|
);
|
|
}
|
|
|
|
public function jsonSerialize(): mixed {
|
|
return [
|
|
'code' => $this->code,
|
|
'type' => $this->type,
|
|
'message' => $this->message,
|
|
];
|
|
}
|
|
}
|
|
|
|
|