// 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/validate"
)

// KeyLifetime Policy key lifetime
// Example: 28800
//
// swagger:model KeyLifetime
type KeyLifetime int64

// Validate validates this key lifetime
func (m KeyLifetime) Validate(formats strfmt.Registry) error {
	var res []error

	if err := validate.MinimumInt("", "body", int64(m), 180, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("", "body", int64(m), 86400, false); err != nil {
		return err
	}

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

// ContextValidate validates this key lifetime based on context it is used
func (m KeyLifetime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
