[ [ 'code' => 'DisplayException', 'status' => '400', 'detail' => 'The requested default allocation is not currently assigned to this server.', ], ], ]; /** * Update the details for a specific server. * * @throws DisplayException */ #[Endpoint('Update server details', 'Updates ownership and display details for a server.')] #[ResponseFromResource(ServerResource::class, Server::class, factoryStates: ['withRelationships'], resourceKey: 'server')] #[ExtensionFieldsParam] public function details(UpdateServerDetailsRequest $request, UpdatesServerDetails $details, Server $server): ServerResource { $updated = $details->update( $server, $request->actionInput() ); return ServerResource::make($updated)->withExtensionFields(); } /** * Update the build details for a specific server. * * @throws DisplayException */ #[Endpoint('Update server build', 'Updates resource limits, feature limits, and allocations for a server.')] #[ResponseFromResource(ServerResource::class, Server::class, factoryStates: ['withRelationships'], resourceKey: 'server')] #[ScribeResponse(self::ALLOCATION_ERROR, status: 400, description: 'The requested allocation change is invalid.')] public function build(UpdateServerBuildConfigurationRequest $request, UpdatesServerBuild $build, Server $server): ServerResource { $server = $build->update($server, $request->actionInput()); return ServerResource::make($server)->withExtensionFields(); } }