diff --git a/tfplan2cai/converters/google/resources/services/notebooks/notebooks_instance.go b/tfplan2cai/converters/google/resources/services/notebooks/notebooks_instance.go index f8cd40361..2115429cf 100644 --- a/tfplan2cai/converters/google/resources/services/notebooks/notebooks_instance.go +++ b/tfplan2cai/converters/google/resources/services/notebooks/notebooks_instance.go @@ -15,6 +15,7 @@ package notebooks import ( + "fmt" "reflect" "sort" "strings" @@ -62,6 +63,25 @@ func NotebooksInstanceKmsDiffSuppress(_, old, new string, _ *schema.ResourceData return false } +func modifyNotebooksInstanceState(config *transport_tpg.Config, d *schema.ResourceData, project string, billingProject string, userAgent string, state string) (map[string]interface{}, error) { + url, err := tpgresource.ReplaceVars(d, config, "{{NotebooksBasePath}}projects/{{project}}/locations/{{location}}/instances/{{name}}:"+state) + if err != nil { + return nil, err + } + + res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{ + Config: config, + Method: "POST", + Project: billingProject, + RawURL: url, + UserAgent: userAgent, + }) + if err != nil { + return nil, fmt.Errorf("Unable to %q google_notebooks_instance %q: %s", state, d.Id(), err) + } + return res, nil +} + const NotebooksInstanceAssetType string = "notebooks.googleapis.com/Instance" func ResourceConverterNotebooksInstance() cai.ResourceConverter {