forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.php
More file actions
156 lines (139 loc) · 3.5 KB
/
User.php
File metadata and controls
156 lines (139 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
/**
* User
*
* 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 User model.
*
* A User who is purchasing from the pet store
*
* @package OpenAPIServer\Model
* @author OpenAPI Generator team
*/
class User implements \JsonSerializable
{
/**
* @var int|null
* @SerializedName("id")
* @Assert\Type("int")
* @Type("int")
*/
public ?int $id;
/**
* @var string|null
* @SerializedName("username")
* @Assert\Type("string")
* @Type("string")
*/
public ?string $username;
/**
* @var string|null
* @SerializedName("firstName")
* @Assert\Type("string")
* @Type("string")
*/
public ?string $firstName;
/**
* @var string|null
* @SerializedName("lastName")
* @Assert\Type("string")
* @Type("string")
*/
public ?string $lastName;
/**
* @var string|null
* @SerializedName("email")
* @Assert\Type("string")
* @Type("string")
*/
public ?string $email;
/**
* @var string|null
* @SerializedName("password")
* @Assert\Type("string")
* @Type("string")
*/
public ?string $password;
/**
* @var string|null
* @SerializedName("phone")
* @Assert\Type("string")
* @Type("string")
*/
public ?string $phone;
/**
* User Status
*
* @var int|null
* @SerializedName("userStatus")
* @Assert\Type("int")
* @Type("int")
*/
public ?int $userStatus;
/**
* Constructor
*
* @param int|null $id
* @param string|null $username
* @param string|null $firstName
* @param string|null $lastName
* @param string|null $email
* @param string|null $password
* @param string|null $phone
* @param int|null $userStatus
*/
public function __construct(?int $id, ?string $username, ?string $firstName, ?string $lastName, ?string $email, ?string $password, ?string $phone, ?int $userStatus)
{
$this->id = $id;
$this->username = $username;
$this->firstName = $firstName;
$this->lastName = $lastName;
$this->email = $email;
$this->password = $password;
$this->phone = $phone;
$this->userStatus = $userStatus;
}
public static function fromArray(array $data): self
{
return new self(
$data['id'] ?? null,
$data['username'] ?? null,
$data['firstName'] ?? null,
$data['lastName'] ?? null,
$data['email'] ?? null,
$data['password'] ?? null,
$data['phone'] ?? null,
$data['userStatus'] ?? null,
);
}
public function jsonSerialize(): mixed {
return [
'id' => $this->id,
'username' => $this->username,
'firstName' => $this->firstName,
'lastName' => $this->lastName,
'email' => $this->email,
'password' => $this->password,
'phone' => $this->phone,
'userStatus' => $this->userStatus,
];
}
}