(in []core.Action)
| 1115 | } |
| 1116 | |
| 1117 | func 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 | |
| 1149 | func CapabilityTypeToProto(t string) integrationpb.CapabilityDefinition_Type { |
| 1150 | switch t { |
nothing calls this directly
no test coverage detected