// Code generated by go-swagger; DO NOT EDIT. package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // I18nConfig i18n config // // swagger:model I18nConfig type I18nConfig struct { // Format used to display date values (see PHP function date_format) Date string `json:"date,omitempty"` // Format used to display date-time values (see PHP function date_format) DateTime string `json:"dateTime,omitempty"` // Format used to display durations (replace: %h with hours, %m with minutes, %s with seconds) Duration string `json:"duration,omitempty"` // Format used for toolbar queries FormDate string `json:"formDate,omitempty"` // Whether a twenty-four hour format is used (true) or 12-hours AM/PM format (false) Is24hours bool `json:"is24hours,omitempty"` // The current time of the user // Format: date-time Now strfmt.DateTime `json:"now,omitempty"` // Format used to display times (see PHP function date_format) Time string `json:"time,omitempty"` } // Validate validates this i18n config func (m *I18nConfig) Validate(formats strfmt.Registry) error { var res []error if err := m.validateNow(formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (m *I18nConfig) validateNow(formats strfmt.Registry) error { if swag.IsZero(m.Now) { // not required return nil } if err := validate.FormatOf("now", "body", "date-time", m.Now.String(), formats); err != nil { return err } return nil } // ContextValidate validates this i18n config based on context it is used func (m *I18nConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation func (m *I18nConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } return swag.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *I18nConfig) UnmarshalBinary(b []byte) error { var res I18nConfig if err := swag.ReadJSON(b, &res); err != nil { return err } *m = res return nil }