Hosting-Handler

delete()

Signatur

public function delete(ProductHosting $productHosting): ServerHostingLockedResponse

Beschreibung

Löscht das Hosting-Produkt

Rückgabewert

ServerHostingDeletedResponse bei Erfolg, Exception mit der Fehlermeldung bei Fehler. Beispiel:

return new ServerHostingDeletedResponse()

Beispiel

/**
 * @param ProductHosting $productHosting
 * @return ServerHostingDeletedResponse
 * @throws GuzzleException
 */
public function unlock(ProductHosting $productHosting): ServerHostingDeletedResponse{
        // API request to delete the user
        $res = $this->getClient($productHosting->host)->killUser($productHosting->custom_fields['nextcloudUser']);
        
        // error handling
        if (isset($res['meta']) && $res['meta']['statuscode'] !== "100") {
		throw new Exception(json_encode($res));
        }

        // success
	return new ServerHostingDeletedResponse();
}
War das hilfreich?