// SetErrorCode sets the ErrorCode field's value.
170697
func (s *PutTargetsResultEntry) SetErrorCode(v string) *PutTargetsResultEntry {
	s.ErrorCode = &v
	return s
}
71469
func (s *LambdaFunctionFailedEventDetails) SetError(v string) *LambdaFunctionFailedEventDetails {
	s.Error = &v
	return s
}
11855
func (s *Workspace) SetErrorMessage(v string) *Workspace {
	s.ErrorMessage = &v
	return s
}
30
func (s *TaskFailedEventDetails) SetError(v string) *TaskFailedEventDetails {
	s.Error = &v
	return s
}
185757
func (s *LambdaFunctionStartFailedEventDetails) SetError(v string) *LambdaFunctionStartFailedEventDetails {
	s.Error = &v
	return s
}
397977
func (s *TaskStartFailedEventDetails) SetError(v string) *TaskStartFailedEventDetails {
	s.Error = &v
	return s
}
957623
func (s *RecordError) SetCode(v string) *RecordError {
	s.Code = &v
	return s
}
1070982
func (s *AssessmentRunNotification) SetError(v bool) *AssessmentRunNotification {
	s.Error = &v
	return s
}
405772
func (s *WorkspaceImage) SetErrorCode(v string) *WorkspaceImage {
	s.ErrorCode = &v
	return s
}
313881
func (s *StackError) SetErrorCode(v string) *StackError {
	s.ErrorCode = &v
	return s
}
652105
func (s *ImageFailure) SetFailureCode(v string) *ImageFailure {
	s.FailureCode = &v
	return s
}
944294
func (s *ActivityScheduleFailedEventDetails) SetError(v string) *ActivityScheduleFailedEventDetails {
	s.Error = &v
	return s
}
607616
func (s *GetServiceLastAccessedDetailsOutput) SetError(v *ErrorDetails) *GetServiceLastAccessedDetailsOutput {
	s.Error = v
	return s
}
465029
func (s *UserError) SetErrorCode(v string) *UserError {
	s.ErrorCode = &v
	return s
}
126089
func (s *AggregatedSourceStatus) SetLastErrorCode(v string) *AggregatedSourceStatus {
	s.LastErrorCode = &v
	return s
}
76641
func (s *UnprocessedQueryExecutionId) SetErrorCode(v string) *UnprocessedQueryExecutionId {
	s.ErrorCode = &v
	return s
}
57
func (r *Rets) SetErrorCode() string {
	const code = `if r0 != 0 {
		%s = %sErrno(r0)
	}`
	if r.Name == "" && !r.ReturnsError {
		return ""
	}
	if r.Name == "" {
		return r.useLongHandleErrorCode("r1")
	}
	if r.Type == "error" {
		return fmt.Sprintf(code, r.Name, syscalldot())
	}
	s := ""
	switch {
	case r.Type[0] == '*':
		s = fmt.Sprintf("%s = (%s)(unsafe.Pointer(r0))", r.Name, r.Type)
	case r.Type == "bool":
		s = fmt.Sprintf("%s = r0 != 0", r.Name)
	default:
		s = fmt.Sprintf("%s = %s(r0)", r.Name, r.Type)
	}
	if !r.ReturnsError {
		return s
	}
	return s + "\n\t" + r.useLongHandleErrorCode(r.Name)
}