Skip to content

Commit

Permalink
Adding suggested changes from @nmanoogian
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanrhanson committed Dec 9, 2024
1 parent 123dd18 commit 509a679
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion doppler/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions doppler/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
4 changes: 4 additions & 0 deletions doppler/resource_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 509a679

Please sign in to comment.