# unlock()

## Signature

```php
public function unlock(ProductHosting $productHosting): ServerHostingLockedResponse
```

## Description

Unsuspension of the product. This happens when the overdue invoice gets paid / the locked hosting gets reactivated

## Return value

ServerHostingUnlockedResponse for success, Exception with the mesage on error. Example:

```php
return new ServerHostingUnlockedResponse()
```

## Example

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

        // success
	return new ServerHostingUnlockedResponse();
}
```
