Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
support proxy types
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Jul 2, 2021
1 parent 9646d08 commit 6bc26d9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()+"\"")
Expand All @@ -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)
Expand Down

0 comments on commit 6bc26d9

Please sign in to comment.