|
125 | 125 | $parser->parseResponse($response); |
126 | 126 | }); |
127 | 127 |
|
| 128 | +$cli |
| 129 | + ->task('updateEmail') |
| 130 | + ->label('description', "Update the user email by its unique ID.\n\n") |
| 131 | + ->param('userId', '' , new Wildcard() , 'User unique ID.', false) |
| 132 | + ->param('email', '' , new Wildcard() , 'User email.', false) |
| 133 | + ->action(function ( $userId, $email ) use ($parser) { |
| 134 | + /** @var string $userId */ |
| 135 | + /** @var string $email */ |
| 136 | + |
| 137 | + $client = new Client(); |
| 138 | + $path = str_replace(['{userId}'], [$userId], '/users/{userId}/email'); |
| 139 | + $params = []; |
| 140 | + /** Body Params */ |
| 141 | + $params['email'] = $email; |
| 142 | + $response = $client->call(Client::METHOD_PATCH, $path, [ |
| 143 | + 'content-type' => 'application/json', |
| 144 | + ], $params); |
| 145 | + $parser->parseResponse($response); |
| 146 | + }); |
| 147 | + |
128 | 148 | $cli |
129 | 149 | ->task('getLogs') |
130 | 150 | ->label('description', "Get a user activity logs list by its unique ID.\n\n") |
|
141 | 161 | $parser->parseResponse($response); |
142 | 162 | }); |
143 | 163 |
|
| 164 | +$cli |
| 165 | + ->task('updateName') |
| 166 | + ->label('description', "Update the user name by its unique ID.\n\n") |
| 167 | + ->param('userId', '' , new Wildcard() , 'User unique ID.', false) |
| 168 | + ->param('name', '' , new Wildcard() , 'User name. Max length: 128 chars.', false) |
| 169 | + ->action(function ( $userId, $name ) use ($parser) { |
| 170 | + /** @var string $userId */ |
| 171 | + /** @var string $name */ |
| 172 | + |
| 173 | + $client = new Client(); |
| 174 | + $path = str_replace(['{userId}'], [$userId], '/users/{userId}/name'); |
| 175 | + $params = []; |
| 176 | + /** Body Params */ |
| 177 | + $params['name'] = $name; |
| 178 | + $response = $client->call(Client::METHOD_PATCH, $path, [ |
| 179 | + 'content-type' => 'application/json', |
| 180 | + ], $params); |
| 181 | + $parser->parseResponse($response); |
| 182 | + }); |
| 183 | + |
| 184 | +$cli |
| 185 | + ->task('updatePassword') |
| 186 | + ->label('description', "Update the user password by its unique ID.\n\n") |
| 187 | + ->param('userId', '' , new Wildcard() , 'User unique ID.', false) |
| 188 | + ->param('password', '' , new Wildcard() , 'New user password. Must be between 6 to 32 chars.', false) |
| 189 | + ->action(function ( $userId, $password ) use ($parser) { |
| 190 | + /** @var string $userId */ |
| 191 | + /** @var string $password */ |
| 192 | + |
| 193 | + $client = new Client(); |
| 194 | + $path = str_replace(['{userId}'], [$userId], '/users/{userId}/password'); |
| 195 | + $params = []; |
| 196 | + /** Body Params */ |
| 197 | + $params['password'] = $password; |
| 198 | + $response = $client->call(Client::METHOD_PATCH, $path, [ |
| 199 | + 'content-type' => 'application/json', |
| 200 | + ], $params); |
| 201 | + $parser->parseResponse($response); |
| 202 | + }); |
| 203 | + |
144 | 204 | $cli |
145 | 205 | ->task('getPrefs') |
146 | 206 | ->label('description', "Get the user preferences by its unique ID.\n\n") |
|
286 | 346 | "create" => "Create a new user.", |
287 | 347 | "get" => "Get a user by its unique ID.", |
288 | 348 | "delete" => "Delete a user by its unique ID.", |
| 349 | + "updateEmail" => "Update the user email by its unique ID.", |
289 | 350 | "getLogs" => "Get a user activity logs list by its unique ID.", |
| 351 | + "updateName" => "Update the user name by its unique ID.", |
| 352 | + "updatePassword" => "Update the user password by its unique ID.", |
290 | 353 | "getPrefs" => "Get the user preferences by its unique ID.", |
291 | 354 | "updatePrefs" => "Update the user preferences by its unique ID. You can pass only the specific settings you wish to update.", |
292 | 355 | "getSessions" => "Get the user sessions list by its unique ID.", |
|
0 commit comments