Skip to content

Commit

Permalink
feat(api): new GetIntegrationSchema()
Browse files Browse the repository at this point in the history
Signed-off-by: Salim Afiune Maya <[email protected]>
  • Loading branch information
afiune committed Mar 19, 2020
1 parent 962191b commit 1aaec6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ package api
import "fmt"

const (
//apiIntegrationType = "external/integrations/type/%s/"
//apiIntegrationsByType = "external/integrations/type/%s"
apiIntegrations = "external/integrations"
apiIntegrationByGUID = "external/integrations/%s"
apiIntegrationSchema = "external/integrations/schema/%s"
apiTokens = "access/tokens"
)

Expand Down
7 changes: 7 additions & 0 deletions api/integrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ func (c *Client) GetIntegrations() (response integrationsResponse, err error) {
return
}

// GetIntegrationSchema get the integration schema for the provided integration type
func (c *Client) GetIntegrationSchema(iType integrationType) (response map[string]interface{}, err error) {
apiPath := fmt.Sprintf(apiIntegrationSchema, iType.String())
err = c.RequestDecoder("GET", apiPath, nil, &response)
return
}

func (c *Client) createIntegration(data interface{}, response interface{}) error {
body, err := jsonReader(data)
if err != nil {
Expand Down

0 comments on commit 1aaec6c

Please sign in to comment.