Skip to content

Commit

Permalink
Update resource_zendesk_trigger.go
Browse files Browse the repository at this point in the history
  • Loading branch information
clearnote01 authored Apr 4, 2024
1 parent 6bdc303 commit 7dedd2d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion zendesk/resource_zendesk_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ func resourceZendeskTrigger() *schema.Resource {
Type: schema.TypeString,
Required: true,
},
"category_id": {
Description: "The title of the trigger.",
Type: schema.TypeString,
Optional: true,
},
"active": {
Description: "Whether the trigger is active.",
Type: schema.TypeBool,
Expand Down Expand Up @@ -86,11 +91,12 @@ func resourceZendeskTrigger() *schema.Resource {
func marshalTrigger(trigger client.Trigger, d identifiableGetterSetter) error {
fields := map[string]interface{}{
"title": trigger.Title,
"category_id": trigger.CategoryID,
"active": trigger.Active,
"position": trigger.Position,
"description": trigger.Description,
}

var alls []map[string]interface{}
for _, v := range trigger.Conditions.All {
m := map[string]interface{}{
Expand Down Expand Up @@ -164,6 +170,10 @@ func unmarshalTrigger(d identifiableGetterSetter) (client.Trigger, error) {
trg.Description = v.(string)
}

if v, ok := d.GetOk("category_id"); ok {
trg.CategoryID = v.(string)
}

if v, ok := d.GetOk("all"); ok {
allConditions := v.(*schema.Set).List()
conditions := []client.TriggerCondition{}
Expand Down

0 comments on commit 7dedd2d

Please sign in to comment.