func (s *SendHeartbeatInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "SendHeartbeatInput"}
	if s.AgentVersion == nil {
		invalidParams.Add(request.NewErrParamRequired("AgentVersion"))
	}
	if s.AgentVersion != nil && len(*s.AgentVersion) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 1))
	}
	if s.DeviceFleetName == nil {
		invalidParams.Add(request.NewErrParamRequired("DeviceFleetName"))
	}
	if s.DeviceFleetName != nil && len(*s.DeviceFleetName) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("DeviceFleetName", 1))
	}
	if s.DeviceName == nil {
		invalidParams.Add(request.NewErrParamRequired("DeviceName"))
	}
	if s.DeviceName != nil && len(*s.DeviceName) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("DeviceName", 1))
	}
	if s.AgentMetrics != nil {
		for i, v := range s.AgentMetrics {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AgentMetrics", i), err.(request.ErrInvalidParams))
			}
		}
	}
	if s.Models != nil {
		for i, v := range s.Models {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Models", i), err.(request.ErrInvalidParams))
			}
		}
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
// Validate inspects the fields of the type to determine if they are valid.
Validate inspects the fields of the type to determine if they are valid.
// Validate inspects the fields of the type to determine if they are valid .
func (s *SendHeartbeatInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "SendHeartbeatInput"}
	if s.AgentVersion == nil {
		invalidParams.Add(request.NewErrParamRequired("AgentVersion"))
	}
	if s.AgentVersion != nil && len(*s.AgentVersion) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 1))
	}
	if s.DeviceFleetName == nil {
		invalidParams.Add(request.NewErrParamRequired("DeviceFleetName"))
	}
	if s.DeviceFleetName != nil && len(*s.DeviceFleetName) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("DeviceFleetName", 1))
	}
	if s.DeviceName == nil {
		invalidParams.Add(request.NewErrParamRequired("DeviceName"))
	}
	if s.DeviceName != nil && len(*s.DeviceName) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("DeviceName", 1))
	}
	if s.AgentMetrics != nil {
		for i, v := range s.AgentMetrics {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AgentMetrics", i), err.(request.ErrInvalidParams))
			}
		}
	}
	if s.Models != nil {
		for i, v := range s.Models {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Models", i), err.(request.ErrInvalidParams))
			}
		}
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
func ( s * SendHeartbeatInput ) Validate ( ) error { invalidParams := request . ErrInvalidParams { Context : " " } if s . AgentVersion == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . AgentVersion != nil && len ( * s . AgentVersion ) < 1 { invalidParams . Add ( request . NewErrParamMinLen ( " " , 1 ) ) } if s . DeviceFleetName == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . DeviceFleetName != nil && len ( * s . DeviceFleetName ) < 1 { invalidParams . Add ( request . NewErrParamMinLen ( " " , 1 ) ) } if s . DeviceName == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . DeviceName != nil && len ( * s . DeviceName ) < 1 { invalidParams . Add ( request . NewErrParamMinLen ( " " , 1 ) ) } if s . AgentMetrics != nil { for i , v := range s . AgentMetrics { if v == nil { continue } if err := v . Validate ( ) ; err != nil { invalidParams . AddNested ( fmt . Sprintf ( " " , " " , i ) , err . ( request . ErrInvalidParams ) ) } } } if s . Models != nil { for i , v := range s . Models { if v == nil { continue } if err := v . Validate ( ) ; err != nil { invalidParams . AddNested ( fmt . Sprintf ( " " , " " , i ) , err . ( request . ErrInvalidParams ) ) } } } if invalidParams . Len ( ) > 0 { return invalidParams } return nil }
Validate inspects the fields of the type to determine if they are valid.
Validate inspects the fields of the type to determine if they are valid .