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

// VaultRadar20230501Event Event represents a single event in Vault Radar.
//
// swagger:model vault_radar_20230501Event
type VaultRadar20230501Event struct {

	// author
	Author string `json:"author,omitempty"`

	// author time
	// Format: date-time
	AuthorTime strfmt.DateTime `json:"author_time,omitempty"`

	// connection url
	ConnectionURL string `json:"connection_url,omitempty"`

	// content id
	ContentID string `json:"content_id,omitempty"`

	// content reference
	ContentReference string `json:"content_reference,omitempty"`

	// context
	Context string `json:"context,omitempty"`

	// context url
	ContextURL string `json:"context_url,omitempty"`

	// Group by count of events that match the search results when the 'groupBy' attribute is specified as part of the search.
	Count int64 `json:"count,omitempty"`

	// created
	// Format: date-time
	Created strfmt.DateTime `json:"created,omitempty"`

	// data source name
	DataSourceName string `json:"data_source_name,omitempty"`

	// data source type
	DataSourceType string `json:"data_source_type,omitempty"`

	// description
	Description string `json:"description,omitempty"`

	// Provide additional miscellaneous details about the event.
	Details interface{} `json:"details,omitempty"`

	// event id
	EventID string `json:"event_id,omitempty"`

	// in latest version
	InLatestVersion bool `json:"in_latest_version,omitempty"`

	// is monitored
	IsMonitored bool `json:"is_monitored,omitempty"`

	// last updated
	// Format: date-time
	LastUpdated strfmt.DateTime `json:"last_updated,omitempty"`

	// Provide additional information about managed locations associated with the event.
	ManagedLocations interface{} `json:"managed_locations,omitempty"`

	// resource name
	ResourceName string `json:"resource_name,omitempty"`

	// resource uri
	ResourceURI string `json:"resource_uri,omitempty"`

	// reviewed by
	ReviewedBy string `json:"reviewed_by,omitempty"`

	// risk category
	RiskCategory string `json:"risk_category,omitempty"`

	// secret activeness
	SecretActiveness string `json:"secret_activeness,omitempty"`

	// secret id
	SecretID string `json:"secret_id,omitempty"`

	// severity
	Severity string `json:"severity,omitempty"`

	// status
	Status string `json:"status,omitempty"`

	// sub type
	SubType string `json:"sub_type,omitempty"`

	// summary
	Summary string `json:"summary,omitempty"`

	// type
	Type string `json:"type,omitempty"`

	// updated by
	UpdatedBy string `json:"updated_by,omitempty"`

	// visibility
	Visibility string `json:"visibility,omitempty"`
}

// Validate validates this vault radar 20230501 event
func (m *VaultRadar20230501Event) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

func (m *VaultRadar20230501Event) validateAuthorTime(formats strfmt.Registry) error {
	if swag.IsZero(m.AuthorTime) { // not required
		return nil
	}

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

	return nil
}

func (m *VaultRadar20230501Event) validateCreated(formats strfmt.Registry) error {
	if swag.IsZero(m.Created) { // not required
		return nil
	}

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

	return nil
}

func (m *VaultRadar20230501Event) validateLastUpdated(formats strfmt.Registry) error {
	if swag.IsZero(m.LastUpdated) { // not required
		return nil
	}

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

	return nil
}

// ContextValidate validates this vault radar 20230501 event based on context it is used
func (m *VaultRadar20230501Event) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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