Skip to content

Commit

Permalink
chore: adds samples for apihub #613
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Dec 26, 2024
1 parent 42bc042 commit e663dd6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ package main
import (
"internal/cmd"
"internal/cmd/apidocs"
apihubapi "internal/cmd/apihub/apis"
apiversion "internal/cmd/apihub/apis/versions"
apispec "internal/cmd/apihub/apis/versions/specs"
"internal/cmd/apis"
"internal/cmd/appgroups"
"internal/cmd/apps"
Expand Down Expand Up @@ -71,6 +74,10 @@ Set up apigeecli with preferences: ` + getSingleLine("apigeecli prefs set -o $or
| references | ` + getSingleLine(references.GetExample(0)) + ` |
| apps | ` + getSingleLine(apps.GetExample(0)) + ` |
| apidocs | ` + getSingleLine(apidocs.GetExample(0)) + ` |
| apihub | ` + getSingleLine(apihubapi.GetExample(0)) + ` |
| apihub | ` + getSingleLine(apiversion.GetExample(0)) + ` |
| apihub | ` + getSingleLine(apispec.GetExample(0)) + ` |
NOTE: This file is auto-generated during a release. Do not modify.`
Expand Down
8 changes: 8 additions & 0 deletions internal/cmd/apihub/apis/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ var ApisCmd = &cobra.Command{

var org, region string

var examples = []string{
`apigeecli apihub apis create -i $apiId -f ./test/api.json -r $region -p $project --default-token`,
}

func init() {
ApisCmd.PersistentFlags().StringVarP(&org, "org", "o",
"", "Apigee organization name")
Expand All @@ -46,3 +50,7 @@ func init() {
_ = ApisCmd.MarkFlagRequired("org")
_ = ApisCmd.MarkFlagRequired("region")
}

func GetExample(i int) string {
return examples[i]
}
9 changes: 9 additions & 0 deletions internal/cmd/apihub/apis/versions/specs/specs.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ var SpecsCmd = &cobra.Command{

var org, region string

var examples = []string{
`apigeecli apihub apis versions specs create -i $id --api-id $apiId \
--version=$version -d $displayName -f ./test/petstore.yaml -r $region --default-token`,
}

func init() {
SpecsCmd.PersistentFlags().StringVarP(&org, "org", "o",
"", "Apigee organization name")
Expand All @@ -43,3 +48,7 @@ func init() {
_ = SpecsCmd.MarkFlagRequired("org")
_ = SpecsCmd.MarkFlagRequired("region")
}

func GetExample(i int) string {
return examples[i]
}
9 changes: 9 additions & 0 deletions internal/cmd/apihub/apis/versions/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ var ApiVersionsCmd = &cobra.Command{

var org, region string

var examples = []string{
`apigeecli apihub apis versions create -i $apVeriId --api-id $apiId \
-f ./test/api-ver.json -r $region -p $project --default-token`,
}

func init() {
ApiVersionsCmd.PersistentFlags().StringVarP(&org, "org", "o",
"", "Apigee organization name")
Expand All @@ -45,3 +50,7 @@ func init() {
_ = ApiVersionsCmd.MarkFlagRequired("org")
_ = ApiVersionsCmd.MarkFlagRequired("region")
}

func GetExample(i int) string {
return examples[i]
}

0 comments on commit e663dd6

Please sign in to comment.