// IsFormat will check an input against a FormatChecker with the given name
// to see if it is the correct format
484808
func (c *FormatCheckerChain) IsFormat(name string, input interface{}) bool {
	lock.Lock()
	f, ok := c.formatters[name]
	lock.Unlock()

	if !ok {
		return false
	}

	return f.IsFormat(input)
}
839300
func (a *CaptureSnapshotArgs) SetFormat(format string) *CaptureSnapshotArgs {
	a.Format = &format
	return a
}
895333
func (s *AnalyticsS3BucketDestination) SetFormat(v string) *AnalyticsS3BucketDestination {
	s.Format = &v
	return s
}
385731
func (d *API) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) {
	if d.formats == nil {
		d.formats = strfmt.NewFormats()
	}
	d.formats.Add(name, format, validator)
}
382720
func (f UUIDFormatChecker) IsFormat(input interface{}) bool {
	asString, ok := input.(string)
	if !ok {
		return false
	}

	return rxUUID.MatchString(asString)
}
1051980
func compareFormatString(fmt1, fmt2 string) bool {
	if fmt1 == fmt2 {
		return true
	}
	if fmt1 == "" || strings.EqualFold(fmt1, "general") {
		fmt1 = "general"
	}
	if fmt2 == "" || strings.EqualFold(fmt2, "general") {
		fmt2 = "general"
	}
	return fmt1 == fmt2
}
1282766
func (s *CreateBusinessReportScheduleInput) SetFormat(v string) *CreateBusinessReportScheduleInput {
	s.Format = &v
	return s
}
19064
func validateFormatString(v contract.ValueDescriptor) error {
	// No formatting specified
	if v.Formatting == "" {
		return nil
	}

	match, err := regexp.MatchString(formatSpecifier, v.Formatting)

	if err != nil {
		LoggingClient.Error("Error checking for format string for value descriptor " + v.Name)
		return err
	}
	if !match {
		err = fmt.Errorf("format is not a valid printf format")
		LoggingClient.Error(fmt.Sprintf("Error posting value descriptor. %s", err.Error()))
		return errors.NewErrValueDescriptorInvalid(v.Name, err)
	}

	return nil
}
296797
func checkFormatXLValue(formatXL *formatXLV3) error {
	// Validate format version and format type.
	if formatXL.Version != formatMetaVersionV1 {
		return fmt.Errorf("Unsupported version of backend format [%s] found", formatXL.Version)
	}
	if formatXL.Format != formatBackendXL {
		return fmt.Errorf("Unsupported backend format [%s] found", formatXL.Format)
	}
	if formatXL.XL.Version != formatXLVersionV3 {
		return fmt.Errorf("Unsupported XL backend format found [%s]", formatXL.XL.Version)
	}
	return nil
}
1109893
func (s *AccessLogSettings) SetFormat(v string) *AccessLogSettings {
	s.Format = &v
	return s
}
414929
func (v *RegexMatch) IsValid(errors *validate.Errors) {
	r := regexp.MustCompile(v.Expr)
	if r.Match([]byte(v.Field)) {
		return
	}

	if len(v.Message) > 0 {
		errors.Add(GenerateKey(v.Name), v.Message)
		return
	}

	errors.Add(GenerateKey(v.Name), fmt.Sprintf("%s does not match the expected format.", v.Name))
}
1260759
func (s *CaptionFormat) SetFormat(v string) *CaptionFormat {
	s.Format = &v
	return s
}
1311114
func (a *CaptureScreenshotArgs) SetFormat(format string) *CaptureScreenshotArgs {
	a.Format = &format
	return a
}
969808
func (s *UpdateBusinessReportScheduleInput) SetFormat(v string) *UpdateBusinessReportScheduleInput {
	s.Format = &v
	return s
}
1349987
func getFormatStr(strLen int, padding int) string {
	formatStr := fmt.Sprintf("%ds", strLen+padding)
	return "%" + formatStr
}
972804
func (f IPV4FormatChecker) IsFormat(input interface{}) bool {
	asString, ok := input.(string)
	if !ok {
		return false
	}

	// Credit: https://github.com/asaskevich/govalidator
	ip := net.ParseIP(asString)
	return ip != nil && strings.Contains(asString, ".")
}
598071
func (f RelativeJSONPointerFormatChecker) IsFormat(input interface{}) bool {
	asString, ok := input.(string)
	if !ok {
		return false
	}

	return rxRelJSONPointer.MatchString(asString)
}