Skip to content

Commit 52a636b

Browse files
Removed dialogflow intent set_computed_name post_create (#13631) (#22331)
[upstream:b9c3c8291f34cf31312f196e08d56d3eda8d89d3] Signed-off-by: Modular Magician <[email protected]>
1 parent 796c7ea commit 52a636b

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

google/services/dialogflow/resource_dialogflow_intent.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -312,24 +312,6 @@ func resourceDialogflowIntentCreate(d *schema.ResourceData, meta interface{}) er
312312
}
313313
d.SetId(id)
314314

315-
// `name` is autogenerated from the api so needs to be set post-create
316-
name, ok := res["name"]
317-
if !ok {
318-
respBody, ok := res["response"]
319-
if !ok {
320-
return fmt.Errorf("Create response didn't contain critical fields. Create may not have succeeded.")
321-
}
322-
323-
name, ok = respBody.(map[string]interface{})["name"]
324-
if !ok {
325-
return fmt.Errorf("Create response didn't contain critical fields. Create may not have succeeded.")
326-
}
327-
}
328-
if err := d.Set("name", name.(string)); err != nil {
329-
return fmt.Errorf("Error setting name: %s", err)
330-
}
331-
d.SetId(name.(string))
332-
333315
log.Printf("[DEBUG] Finished creating Intent %q: %#v", d.Id(), res)
334316

335317
return resourceDialogflowIntentRead(d, meta)

0 commit comments

Comments
 (0)