From 31f32b4eeb3a8029f45d80b672cc0919f571bc45 Mon Sep 17 00:00:00 2001 From: srinandan <13950006+srinandan@users.noreply.github.com> Date: Mon, 16 Jan 2023 18:20:42 -0800 Subject: [PATCH] fixes incorrect connector para #104 --- client/integrations/integrations.go | 24 ++++++++++++------------ client/integrations/overrides.go | 10 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/client/integrations/integrations.go b/client/integrations/integrations.go index 398dfb2..7ec1f89 100644 --- a/client/integrations/integrations.go +++ b/client/integrations/integrations.go @@ -109,15 +109,15 @@ type parameterInternal struct { } type parameterExternal struct { - Key string `json:"key,omitempty"` - DataType string `json:"dataType,omitempty"` - DefaultValue valueType `json:"defaultValue,omitempty"` - Name string `json:"name,omitempty"` - IsTransient bool `json:"isTransient,omitempty"` - InputOutputType string `json:"inputOutputType,omitempty"` - Producer string `json:"producer,omitempty"` - Searchable bool `json:"searchable,omitempty"` - JsonSchema string `json:"jsonSchema,omitempty"` + Key string `json:"key,omitempty"` + DataType string `json:"dataType,omitempty"` + DefaultValue *valueType `json:"defaultValue,omitempty"` + Name string `json:"name,omitempty"` + IsTransient bool `json:"isTransient,omitempty"` + InputOutputType string `json:"inputOutputType,omitempty"` + Producer string `json:"producer,omitempty"` + Searchable bool `json:"searchable,omitempty"` + JsonSchema string `json:"jsonSchema,omitempty"` } type producedBy struct { @@ -147,10 +147,10 @@ type taskconfig struct { NextTasksExecutionPolicy string `json:"nextTasksExecutionPolicy,omitempty"` TaskExecutionStrategy string `json:"taskExecutionStrategy,omitempty"` JsonValidationOption string `json:"jsonValidationOption,omitempty"` - SuccessPolicy successPolicy `json:"successPolicy,omitempty"` + SuccessPolicy *successPolicy `json:"successPolicy,omitempty"` TaskTemplate string `json:"taskTemplate,omitempty"` - FailurePolicy failurePolicy `json:"failurePolicy,omitempty"` - SynchronousCallFailurePolicy failurePolicy `json:"synchronousCallFailurePolicy,omitempty"` + FailurePolicy *failurePolicy `json:"failurePolicy,omitempty"` + SynchronousCallFailurePolicy *failurePolicy `json:"synchronousCallFailurePolicy,omitempty"` } type eventparameter struct { diff --git a/client/integrations/overrides.go b/client/integrations/overrides.go index dfcf4e5..95c5458 100644 --- a/client/integrations/overrides.go +++ b/client/integrations/overrides.go @@ -60,9 +60,9 @@ type connectiondetails struct { } type connectionparams struct { - ServiceName string `json:"serviceName,omitempty"` - ConnectionName string `json:"connectionName,omitempty"` - ConnectionVersion string `json:"connectionVersion,omitempty"` + ServiceName string `json:"serviceName,omitempty"` + ConnectionName string `json:"connectionName,omitempty"` + ConnectorVersion string `json:"connectorVersion,omitempty"` } const pubsubTrigger = "cloud_pubsub_external_trigger/projects/cloud-crm-eventbus-cpsexternal/subscriptions/" @@ -134,7 +134,7 @@ func mergeOverrides(eversion integrationVersionExternal, o overrides, supressWar } cd.Connection.ConnectionName = newcp.ConnectionName - cd.Connection.ConnectionVersion = newcp.ConnectionVersion + cd.Connection.ConnectorVersion = newcp.ConnectorVersion cd.Connection.ServiceName = newcp.ServiceName jsonValue, err := stringifyValue(cd) @@ -221,7 +221,7 @@ func getNewConnectionParams(connectionName string, connectionLocation string) (c return cp, err } - cp.ConnectionVersion = fmt.Sprintf("%v", connectionVersionResponse["connectorVersion"]) + cp.ConnectorVersion = fmt.Sprintf("%v", connectionVersionResponse["connectorVersion"]) cp.ServiceName = fmt.Sprintf("%v", connectionVersionResponse["serviceDirectory"]) cp.ConnectionName = fmt.Sprintf("%v", connectionVersionResponse["name"])