diff --git a/client/env/env.go b/client/env/env.go index 9cd23449..59a9fcee 100644 --- a/client/env/env.go +++ b/client/env/env.go @@ -25,7 +25,7 @@ import ( ) //Create -func Create(deploymentType string) (respBody []byte, err error) { +func Create(deploymentType string, apiProxyType string) (respBody []byte, err error) { environment := []string{} environment = append(environment, "\"name\":\""+apiclient.GetApigeeEnv()+"\"") @@ -37,6 +37,13 @@ func Create(deploymentType string) (respBody []byte, err error) { environment = append(environment, "\"deployment_type\":\""+deploymentType+"\"") } + if apiProxyType != "" { + if apiProxyType != "CONFIGURABLE" && apiProxyType != "PROGRAMMABLE" { + return nil, fmt.Errorf("apiProxyType must be CONFIGURABLE or PROGRAMMABLE") + } + environment = append(environment, "\"apiProxyType\":\""+apiProxyType+"\"") + } + payload := "{" + strings.Join(environment, ",") + "}" u, _ := url.Parse(apiclient.BaseURL)