// 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 *ConnectDirectoryInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "ConnectDirectoryInput"}
	if s.ConnectSettings == nil {
		invalidParams.Add(request.NewErrParamRequired("ConnectSettings"))
	}
	if s.Name == nil {
		invalidParams.Add(request.NewErrParamRequired("Name"))
	}
	if s.Password == nil {
		invalidParams.Add(request.NewErrParamRequired("Password"))
	}
	if s.Password != nil && len(*s.Password) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("Password", 1))
	}
	if s.Size == nil {
		invalidParams.Add(request.NewErrParamRequired("Size"))
	}
	if s.ConnectSettings != nil {
		if err := s.ConnectSettings.Validate(); err != nil {
			invalidParams.AddNested("ConnectSettings", err.(request.ErrInvalidParams))
		}
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
func ( s * ConnectDirectoryInput ) Validate ( ) error { invalidParams := request . ErrInvalidParams { Context : " " } if s . ConnectSettings == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . Name == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . Password == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . Password != nil && len ( * s . Password ) < 1 { invalidParams . Add ( request . NewErrParamMinLen ( " " , 1 ) ) } if s . Size == nil { invalidParams . Add ( request . NewErrParamRequired ( " " ) ) } if s . ConnectSettings != nil { if err := s . ConnectSettings . Validate ( ) ; err != nil { invalidParams . AddNested ( " " , 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 .