From 1aaec6cc8f3784d93f01d9819547dcab8cefddd4 Mon Sep 17 00:00:00 2001 From: Salim Afiune Maya Date: Thu, 19 Mar 2020 15:54:08 -0600 Subject: [PATCH] feat(api): new GetIntegrationSchema() Signed-off-by: Salim Afiune Maya --- api/api.go | 3 ++- api/integrations.go | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/api/api.go b/api/api.go index b76118a79..f25a8743a 100644 --- a/api/api.go +++ b/api/api.go @@ -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" ) diff --git a/api/integrations.go b/api/integrations.go index 662b2bd55..acf16477c 100644 --- a/api/integrations.go +++ b/api/integrations.go @@ -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 {