12
// populated.
13
// nolint:revive // cognitive-complexity is high but justified to keep each case together for readability.
15
>
if len(links) > maxAllowedLinks {
16
return serviceerror.NewInvalidArgumentf("cannot attach more than %d links per request, got %d", maxAllowedLinks, len(links))
17
}
20
return serviceerror.NewInvalidArgumentf("link exceeds allowed size of %d, got %d", maxSize, l.Size())
21
}
24
>
if t.WorkflowEvent.GetNamespace() == "" {
25
return serviceerror.NewInvalidArgument("workflow event link must not have an empty namespace field")
26
}
28
return serviceerror.NewInvalidArgument("workflow event link must not have an empty workflow ID field")
29
}
31
return serviceerror.NewInvalidArgument("workflow event link must not have an empty run ID field")
32
}
33
>
if t.WorkflowEvent.GetEventRef().GetEventType() == enumspb.EVENT_TYPE_UNSPECIFIED && t.WorkflowEvent.GetEventRef().GetEventId() != 0 {
validator.go
34
return serviceerror.NewInvalidArgument("workflow event link ref cannot have an unspecified event type and a non-zero event ID")
35
}
37
>
if t.BatchJob.GetJobId() == "" {
38
return serviceerror.NewInvalidArgument("batch job link must not have an empty job ID")
39
}
41
>
if t.NexusOperation.GetNamespace() == "" {
42
return serviceerror.NewInvalidArgument("nexus operation link must not have an empty namespace field")
43
}
45
return serviceerror.NewInvalidArgument("nexus operation link must not have an empty operation ID field")
46
}
48
return serviceerror.NewInvalidArgument("nexus operation link must not have an empty run ID field")
49
}
51
>
if t.Activity.GetNamespace() == "" {
52
return serviceerror.NewInvalidArgument("activity link must not have an empty namespace field")
53
}
55
return serviceerror.NewInvalidArgument("activity link must not have an empty activity ID field")
56
}
58
return serviceerror.NewInvalidArgument("activity link must not have an empty run ID field")
59
}