Skip to content

Commit

Permalink
chore: fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Dec 1, 2023
1 parent 65e0463 commit def9726
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cmd/apidocs/updatedocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ var UpdateDocCmd = &cobra.Command{
},
}

var openAPIPath, graphQLPath string
var endpointUri string
var (
openAPIPath, graphQLPath string
endpointUri string
)

func init() {
UpdateDocCmd.Flags().StringVarP(&id, "id", "i",
Expand Down
3 changes: 2 additions & 1 deletion cmd/securityprofiles/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
package securityprofiles

import (
"internal/apiclient"
"os"

"internal/apiclient"

"internal/client/securityprofiles"

"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion internal/client/apidocs/apidocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func UpdateDocumentation(siteid string, id string, displayName string, openAPIDo

if graphQLDoc != "" {
payload = "{\"graphqlDocumentation\":{\"endpointUri\":\"" + endpointUri +
"\",\"schema\":{\"displayName\":\"" + displayName +
"\",\"schema\":{\"displayName\":\"" + displayName +
"\",\"contents\":" + graphQLDoc + "}}}"
}

Expand Down
34 changes: 34 additions & 0 deletions internal/client/orgs/orgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ func Delete(retension string) (respBody []byte, err error) {
return respBody, err
}

// GetOrgField
func GetOrgField(key string) (value string, err error) {
u, _ := url.Parse(apiclient.BaseURL)
u.Path = path.Join(u.Path, apiclient.GetApigeeOrg())
Expand All @@ -198,6 +199,39 @@ func GetOrgField(key string) (value string, err error) {
return fmt.Sprintf("%v", orgMap[key]), nil
}

// GetAddOn
func GetAddOn(addon string) (enabled bool) {
u, _ := url.Parse(apiclient.BaseURL)
u.Path = path.Join(u.Path, apiclient.GetApigeeOrg())

apiclient.DisableCmdPrintHttpResponse()
defer apiclient.EnableCmdPrintHttpResponse()

orgBody, err := apiclient.HttpClient(u.String())
if err != nil {
return false
}
o := organization{}
err = json.Unmarshal(orgBody, &o)
if err != nil {
return false
}
switch addon {
case "advancedApiOpsConfig":
return o.AddOnsConfig.AdvancedApiOpsConfig.Enabled
case "integrationConfig":
return o.AddOnsConfig.IntegrationConfig.Enabled
case "monetizationConfig":
return o.AddOnsConfig.MonetizationConfig.Enabled
case "apiSecurityConfig":
return o.AddOnsConfig.AdvancedApiSecurityConfig.Enabled
case "connectorsPlatformConfig":
return o.AddOnsConfig.ConnectorsPlatformConfig.Enabled
default:
return false
}
}

// List
func List() (respBody []byte, err error) {
u, _ := url.Parse(apiclient.BaseURL)
Expand Down

0 comments on commit def9726

Please sign in to comment.