Skip to content

Commit b59f160

Browse files
Merge pull request #472 from apigee/issue465
feat: adds support for autopush #465
2 parents 10eca08 + 90ec6ce commit b59f160

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

internal/apiclient/options.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
const (
2727
baseURL = "https://apigee.googleapis.com/v1/organizations/"
2828
baseStagingURL = "https://staging-apigee.sandbox.googleapis.com/v1/organizations/"
29+
baseAutoURL = "https://autopush-apigee.sandbox.googleapis.com/v1/organizations/"
2930
)
3031

3132
// registryBaseURL is the Apigee API Hub control plane endpoint
@@ -69,8 +70,9 @@ var apiRate Rate
6970
type API string
7071

7172
const (
72-
PROD API = "prod"
73-
STAGING API = "staging"
73+
PROD API = "prod"
74+
STAGING API = "staging"
75+
AUTOPUSH API = "autopush"
7476
)
7577

7678
var cmdPrintHttpResponses = true
@@ -134,10 +136,10 @@ func (a *API) String() string {
134136

135137
func (a *API) Set(r string) error {
136138
switch r {
137-
case "prod", "staging":
139+
case "prod", "autopush", "staging":
138140
*a = API(r)
139141
default:
140-
return fmt.Errorf("must be one of %s or %s", PROD, STAGING)
142+
return fmt.Errorf("must be one of %s, %s or %s", PROD, AUTOPUSH, STAGING)
141143
}
142144
return nil
143145
}
@@ -345,6 +347,8 @@ func GetApigeeBaseURL() string {
345347
return baseURL
346348
case STAGING:
347349
return baseStagingURL
350+
case AUTOPUSH:
351+
return baseAutoURL
348352
default:
349353
return baseURL
350354
}

internal/cmd/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func init() {
158158
RootCmd.PersistentFlags().BoolVarP(&defaultToken, "default-token", "",
159159
false, "Use Google default application credentials access token")
160160

161-
RootCmd.PersistentFlags().Var(&api, "api", "Sets the control plane API. Must be one of prod, "+
161+
RootCmd.PersistentFlags().Var(&api, "api", "Sets the control plane API. Must be one of prod, autopush "+
162162
"or staging; default is prod")
163163

164164
RootCmd.AddCommand(apis.Cmd)

0 commit comments

Comments
 (0)