diff --git a/doppler/api.go b/doppler/api.go index 6d33c51..1b0b260 100644 --- a/doppler/api.go +++ b/doppler/api.go @@ -805,7 +805,11 @@ func (client APIClient) UpdateWebhook(ctx context.Context, project string, slug payload["url"] = webhookUrl payload["secret"] = secret payload["payload"] = webhookPayload - payload["name"] = webhookName + if webhookName != "" { + payload["name"] = webhookName + } else { + payload["name"] = nil + } payload["enableConfigs"] = enabledConfigs payload["disableConfigs"] = disabledConfigs payload["authentication"] = auth diff --git a/doppler/models.go b/doppler/models.go index a86b4fc..aa8258c 100644 --- a/doppler/models.go +++ b/doppler/models.go @@ -160,6 +160,7 @@ type WebhookAuth struct { type Webhook struct { Slug string `json:"id"` + Name string `json:"name"` Url string `json:"url"` Enabled bool `json:"enabled"` EnabledConfigs []string `json:"enabledConfigs"` diff --git a/doppler/resource_webhook.go b/doppler/resource_webhook.go index 3c10cf1..315e163 100644 --- a/doppler/resource_webhook.go +++ b/doppler/resource_webhook.go @@ -248,6 +248,10 @@ func resourceWebhookRead(ctx context.Context, d *schema.ResourceData, m interfac return diag.FromErr(err) } + if err = d.Set("name", webhook.Name); err != nil { + return diag.FromErr(err) + } + return diags }