public function setHttpsCertificate($certificate = [])
{
// Weed out nulls
$params = array_filter($certificate, function ($param) {
$is_not_null = !is_null($param);
return $is_not_null;
});
$response = $this->request()->request(sprintf('sites/%s/environments/%s/add-ssl-cert', $this->getSite()->id, $this->id), ['method' => 'post', 'form_params' => $params]);
// The response to the PUT is actually a workflow
$workflow_data = $response['data'];
$workflow = $this->getContainer()->get(Workflow::class, [$workflow_data, ['environment' => $this]]);
return $workflow;
}