MCPcopy
hub / github.com/superplanehq/superplane / SerializeActions

Function SerializeActions

pkg/grpc/actions/common.go:1117–1147  ·  view source on GitHub ↗
(in []core.Action)

Source from the content-addressed store, hash-verified

1115}
1116
1117func SerializeActions(in []core.Action) []*actionpb.Action {
1118 out := make([]*actionpb.Action, len(in))
1119 for i, action := range in {
1120 outputChannels := action.OutputChannels(nil)
1121 channels := make([]*actionpb.OutputChannel, len(outputChannels))
1122 for j, channel := range outputChannels {
1123 channels[j] = &actionpb.OutputChannel{
1124 Name: channel.Name,
1125 }
1126 }
1127
1128 configFields := action.Configuration()
1129 configuration := make([]*configpb.Field, len(configFields))
1130 for j, field := range configFields {
1131 configuration[j] = ConfigurationFieldToProto(field)
1132 }
1133 exampleOutput, _ := structpb.NewStruct(action.ExampleOutput())
1134
1135 out[i] = &actionpb.Action{
1136 Name: action.Name(),
1137 Label: action.Label(),
1138 Description: action.Description(),
1139 Icon: action.Icon(),
1140 Color: action.Color(),
1141 OutputChannels: channels,
1142 Configuration: configuration,
1143 ExampleOutput: exampleOutput,
1144 }
1145 }
1146 return out
1147}
1148
1149func CapabilityTypeToProto(t string) integrationpb.CapabilityDefinition_Type {
1150 switch t {

Callers

nothing calls this directly

Calls 9

OutputChannelsMethod · 0.65
ConfigurationMethod · 0.65
ExampleOutputMethod · 0.65
NameMethod · 0.65
LabelMethod · 0.65
DescriptionMethod · 0.65
IconMethod · 0.65
ColorMethod · 0.65

Tested by

no test coverage detected