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

// VaultRadar20230501ResourceV2 vault radar 20230501 resource v2
//
// swagger:model vault_radar_20230501ResourceV2
type VaultRadar20230501ResourceV2 struct {

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

	// content last modified time
	// Format: date-time
	ContentLastModifiedTime strfmt.DateTime `json:"content_last_modified_time,omitempty"`

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

	// critical count
	CriticalCount int64 `json:"critical_count,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"`

	// detector type
	DetectorType string `json:"detector_type,omitempty"`

	// hcp resource name
	HcpResourceName string `json:"hcp_resource_name,omitempty"`

	// hcp resource status
	HcpResourceStatus string `json:"hcp_resource_status,omitempty"`

	// high count
	HighCount int64 `json:"high_count,omitempty"`

	// id
	ID string `json:"id,omitempty"`

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

	// last state updated
	// Format: date-time
	LastStateUpdated strfmt.DateTime `json:"last_state_updated,omitempty"`

	// low count
	LowCount int64 `json:"low_count,omitempty"`

	// medium count
	MediumCount int64 `json:"medium_count,omitempty"`

	// name
	Name string `json:"name,omitempty"`

	// scan state
	ScanState string `json:"scan_state,omitempty"`

	// state
	State string `json:"state,omitempty"`

	// uri
	URI string `json:"uri,omitempty"`

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

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

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

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

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

func (m *VaultRadar20230501ResourceV2) validateContentLastModifiedTime(formats strfmt.Registry) error {
	if swag.IsZero(m.ContentLastModifiedTime) { // not required
		return nil
	}

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

	return nil
}

func (m *VaultRadar20230501ResourceV2) validateLastStateUpdated(formats strfmt.Registry) error {
	if swag.IsZero(m.LastStateUpdated) { // not required
		return nil
	}

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

	return nil
}

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

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

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