// InvalidEmail returns a ProblemDetails representing an invalid email address
// error
491573
func InvalidEmail(detail string, a ...interface{}) *ProblemDetails {
	return &ProblemDetails{
		Type:       InvalidEmailProblem,
		Detail:     fmt.Sprintf(detail, a...),
		HTTPStatus: http.StatusBadRequest,
	}
}
11938
func (s *CreateDeliverabilityTestReportInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "CreateDeliverabilityTestReportInput"}
	if s.Content == nil {
		invalidParams.Add(request.NewErrParamRequired("Content"))
	}
	if s.FromEmailAddress == nil {
		invalidParams.Add(request.NewErrParamRequired("FromEmailAddress"))
	}
	if s.Content != nil {
		if err := s.Content.Validate(); err != nil {
			invalidParams.AddNested("Content", err.(request.ErrInvalidParams))
		}
	}
	if s.Tags != nil {
		for i, v := range s.Tags {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
			}
		}
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
610853
func (s *BatchUpdateUserInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "BatchUpdateUserInput"}
	if s.AccountId == nil {
		invalidParams.Add(request.NewErrParamRequired("AccountId"))
	}
	if s.AccountId != nil && len(*s.AccountId) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("AccountId", 1))
	}
	if s.UpdateUserRequestItems == nil {
		invalidParams.Add(request.NewErrParamRequired("UpdateUserRequestItems"))
	}
	if s.UpdateUserRequestItems != nil {
		for i, v := range s.UpdateUserRequestItems {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "UpdateUserRequestItems", i), err.(request.ErrInvalidParams))
			}
		}
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
1295729
func InvalidParameter(err error) error {
	if err == nil || IsInvalidParameter(err) {
		return err
	}
	return errInvalidParameter{err}
}
300790
func (s *TargetLocation) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "TargetLocation"}
	if s.Accounts != nil && len(s.Accounts) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("Accounts", 1))
	}
	if s.ExecutionRoleName != nil && len(*s.ExecutionRoleName) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleName", 1))
	}
	if s.Regions != nil && len(s.Regions) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("Regions", 1))
	}
	if s.TargetLocationMaxConcurrency != nil && len(*s.TargetLocationMaxConcurrency) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("TargetLocationMaxConcurrency", 1))
	}
	if s.TargetLocationMaxErrors != nil && len(*s.TargetLocationMaxErrors) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("TargetLocationMaxErrors", 1))
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
57232
func (s *UpdateStackInstancesInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "UpdateStackInstancesInput"}
	if s.Accounts == nil {
		invalidParams.Add(request.NewErrParamRequired("Accounts"))
	}
	if s.OperationId != nil && len(*s.OperationId) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("OperationId", 1))
	}
	if s.Regions == nil {
		invalidParams.Add(request.NewErrParamRequired("Regions"))
	}
	if s.StackSetName == nil {
		invalidParams.Add(request.NewErrParamRequired("StackSetName"))
	}
	if s.OperationPreferences != nil {
		if err := s.OperationPreferences.Validate(); err != nil {
			invalidParams.AddNested("OperationPreferences", err.(request.ErrInvalidParams))
		}
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
1329393
func (s *DeleteEmailIdentityInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "DeleteEmailIdentityInput"}
	if s.EmailIdentity == nil {
		invalidParams.Add(request.NewErrParamRequired("EmailIdentity"))
	}
	if s.EmailIdentity != nil && len(*s.EmailIdentity) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("EmailIdentity", 1))
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
1090977
func (s *SendEmailInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "SendEmailInput"}
	if s.Destination == nil {
		invalidParams.Add(request.NewErrParamRequired("Destination"))
	}
	if s.Message == nil {
		invalidParams.Add(request.NewErrParamRequired("Message"))
	}
	if s.Source == nil {
		invalidParams.Add(request.NewErrParamRequired("Source"))
	}
	if s.Message != nil {
		if err := s.Message.Validate(); err != nil {
			invalidParams.AddNested("Message", err.(request.ErrInvalidParams))
		}
	}
	if s.Tags != nil {
		for i, v := range s.Tags {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
			}
		}
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
675804
func (c *Contact) ValidContact() error {
	if c.Email == "" && c.Number == "" {
		return fmt.Errorf("you must provide either an Email or a Phone Number to create a contact target")
	}

	if c.Number != "" && c.CountryCode == "" {
		return fmt.Errorf("you must provide a Country Code if providing a phone number")
	}

	if c.Provider != "" && (c.Number == "" || c.CountryCode == "") {
		return fmt.Errorf("you must provide CountryCode and Number if Provider is provided")
	}

	return nil
}
39438
func (s *UpdateDomainContactInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "UpdateDomainContactInput"}
	if s.DomainName == nil {
		invalidParams.Add(request.NewErrParamRequired("DomainName"))
	}
	if s.AdminContact != nil {
		if err := s.AdminContact.Validate(); err != nil {
			invalidParams.AddNested("AdminContact", err.(request.ErrInvalidParams))
		}
	}
	if s.RegistrantContact != nil {
		if err := s.RegistrantContact.Validate(); err != nil {
			invalidParams.AddNested("RegistrantContact", err.(request.ErrInvalidParams))
		}
	}
	if s.TechContact != nil {
		if err := s.TechContact.Validate(); err != nil {
			invalidParams.AddNested("TechContact", err.(request.ErrInvalidParams))
		}
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
772833
func (s *SendBulkTemplatedEmailInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "SendBulkTemplatedEmailInput"}
	if s.Destinations == nil {
		invalidParams.Add(request.NewErrParamRequired("Destinations"))
	}
	if s.Source == nil {
		invalidParams.Add(request.NewErrParamRequired("Source"))
	}
	if s.Template == nil {
		invalidParams.Add(request.NewErrParamRequired("Template"))
	}
	if s.DefaultTags != nil {
		for i, v := range s.DefaultTags {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DefaultTags", i), err.(request.ErrInvalidParams))
			}
		}
	}
	if s.Destinations != nil {
		for i, v := range s.Destinations {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Destinations", i), err.(request.ErrInvalidParams))
			}
		}
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
250776
func IsValidEmail(email string) bool {
	if len(email) > 254 {
		return false
	}
	return emailRegexp.MatchString(email)
}
1331855
func (s *WorkmailAction) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "WorkmailAction"}
	if s.OrganizationArn == nil {
		invalidParams.Add(request.NewErrParamRequired("OrganizationArn"))
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
572335
func (r Security_Certificate_Request) ResendEmail(emailType *string) (resp bool, err error) {
	params := []interface{}{
		emailType,
	}
	err = r.Session.DoRequest("SoftLayer_Security_Certificate_Request", "resendEmail", params, &r.Options, &resp)
	return
}
269588
func (s *StopContactInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "StopContactInput"}
	if s.ContactId == nil {
		invalidParams.Add(request.NewErrParamRequired("ContactId"))
	}
	if s.ContactId != nil && len(*s.ContactId) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("ContactId", 1))
	}
	if s.InstanceId == nil {
		invalidParams.Add(request.NewErrParamRequired("InstanceId"))
	}
	if s.InstanceId != nil && len(*s.InstanceId) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1))
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
182271
func (s *SendCustomVerificationEmailInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "SendCustomVerificationEmailInput"}
	if s.EmailAddress == nil {
		invalidParams.Add(request.NewErrParamRequired("EmailAddress"))
	}
	if s.TemplateName == nil {
		invalidParams.Add(request.NewErrParamRequired("TemplateName"))
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}
1223479
func (s *CreateMembersInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "CreateMembersInput"}
	if s.AccountDetails == nil {
		invalidParams.Add(request.NewErrParamRequired("AccountDetails"))
	}
	if s.DetectorId == nil {
		invalidParams.Add(request.NewErrParamRequired("DetectorId"))
	}
	if s.DetectorId != nil && len(*s.DetectorId) < 1 {
		invalidParams.Add(request.NewErrParamMinLen("DetectorId", 1))
	}
	if s.AccountDetails != nil {
		for i, v := range s.AccountDetails {
			if v == nil {
				continue
			}
			if err := v.Validate(); err != nil {
				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AccountDetails", i), err.(request.ErrInvalidParams))
			}
		}
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}