// Code generated by go-swagger; DO NOT EDIT.

package models

import (
	"context"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// HealthCheckResults health check results
//
// swagger:model HealthCheckResults
type HealthCheckResults struct {

	// o k
	OK *bool `json:"OK,omitempty"`

	// duration ns
	DurationNs int64 `json:"duration-ns,omitempty"`

	// generated at
	// Format: date-time
	GeneratedAt strfmt.DateTime `json:"generated-at,omitempty"`
}

// Validate validates this health check results
func (m *HealthCheckResults) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateGeneratedAt(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *HealthCheckResults) validateGeneratedAt(formats strfmt.Registry) error {
	if swag.IsZero(m.GeneratedAt) { // not required
		return nil
	}

	if err := validate.FormatOf("generated-at", "body", "date-time", m.GeneratedAt.String(), formats); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this health check results based on context it is used
func (m *HealthCheckResults) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (m *HealthCheckResults) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *HealthCheckResults) UnmarshalBinary(b []byte) error {
	var res HealthCheckResults
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
