141
func (v *CommandAttrValidator) ValidateTimerScheduleAttributes(
142
attributes *commandpb.StartTimerCommandAttributes,
144
>
145
>
const failedCause = enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_START_TIMER_ATTRIBUTES
146
>
147
>
if attributes == nil {
148
return failedCause, serviceerror.NewInvalidArgument("StartTimerCommandAttributes is not set on StartTimerCommand.")
149
}
150
152
>
153
>
if timerID == "" {
154
return failedCause, serviceerror.NewInvalidArgument("TimerId is not set on StartTimerCommand.")
155
}
157
return failedCause, serviceerror.NewInvalidArgumentf("TimerId on StartTimerCommand exceeds length limit. TimerId=%s Length=%d Limit=%d", timerID, len(timerID), v.maxIDLengthLimit)
158
}
159
>
if err := timestamp.ValidateAndCapProtoDuration(attributes.GetStartToFireTimeout()); err != nil {
command_attr_validator.go
160
return failedCause, serviceerror.NewInvalidArgumentf("An invalid StartToFireTimeout is set on StartTimerCommand: %v. TimerId=%s", err, timerID)
161
}
163
}
164