Browse Source

regenerate pkg/models

marco 1 year ago
parent
commit
8315daf85a

+ 1 - 0
.golangci.yml

@@ -5,6 +5,7 @@ run:
     - pkg/time/rate
     - pkg/time/rate
   skip-files:
   skip-files:
     - pkg/database/ent/generate.go
     - pkg/database/ent/generate.go
+    - pkg/models/*.go
     - pkg/yamlpatch/merge.go
     - pkg/yamlpatch/merge.go
     - pkg/yamlpatch/merge_test.go
     - pkg/yamlpatch/merge_test.go
 
 

+ 5 - 0
pkg/models/add_alerts_request.go

@@ -54,6 +54,11 @@ func (m AddAlertsRequest) ContextValidate(ctx context.Context, formats strfmt.Re
 	for i := 0; i < len(m); i++ {
 	for i := 0; i < len(m); i++ {
 
 
 		if m[i] != nil {
 		if m[i] != nil {
+
+			if swag.IsZero(m[i]) { // not required
+				return nil
+			}
+
 			if err := m[i].ContextValidate(ctx, formats); err != nil {
 			if err := m[i].ContextValidate(ctx, formats); err != nil {
 				if ve, ok := err.(*errors.Validation); ok {
 				if ve, ok := err.(*errors.Validation); ok {
 					return ve.ValidateName(strconv.Itoa(i))
 					return ve.ValidateName(strconv.Itoa(i))

+ 11 - 0
pkg/models/alert.go

@@ -399,6 +399,11 @@ func (m *Alert) contextValidateDecisions(ctx context.Context, formats strfmt.Reg
 	for i := 0; i < len(m.Decisions); i++ {
 	for i := 0; i < len(m.Decisions); i++ {
 
 
 		if m.Decisions[i] != nil {
 		if m.Decisions[i] != nil {
+
+			if swag.IsZero(m.Decisions[i]) { // not required
+				return nil
+			}
+
 			if err := m.Decisions[i].ContextValidate(ctx, formats); err != nil {
 			if err := m.Decisions[i].ContextValidate(ctx, formats); err != nil {
 				if ve, ok := err.(*errors.Validation); ok {
 				if ve, ok := err.(*errors.Validation); ok {
 					return ve.ValidateName("decisions" + "." + strconv.Itoa(i))
 					return ve.ValidateName("decisions" + "." + strconv.Itoa(i))
@@ -419,6 +424,11 @@ func (m *Alert) contextValidateEvents(ctx context.Context, formats strfmt.Regist
 	for i := 0; i < len(m.Events); i++ {
 	for i := 0; i < len(m.Events); i++ {
 
 
 		if m.Events[i] != nil {
 		if m.Events[i] != nil {
+
+			if swag.IsZero(m.Events[i]) { // not required
+				return nil
+			}
+
 			if err := m.Events[i].ContextValidate(ctx, formats); err != nil {
 			if err := m.Events[i].ContextValidate(ctx, formats); err != nil {
 				if ve, ok := err.(*errors.Validation); ok {
 				if ve, ok := err.(*errors.Validation); ok {
 					return ve.ValidateName("events" + "." + strconv.Itoa(i))
 					return ve.ValidateName("events" + "." + strconv.Itoa(i))
@@ -469,6 +479,7 @@ func (m *Alert) contextValidateMeta(ctx context.Context, formats strfmt.Registry
 func (m *Alert) contextValidateSource(ctx context.Context, formats strfmt.Registry) error {
 func (m *Alert) contextValidateSource(ctx context.Context, formats strfmt.Registry) error {
 
 
 	if m.Source != nil {
 	if m.Source != nil {
+
 		if err := m.Source.ContextValidate(ctx, formats); err != nil {
 		if err := m.Source.ContextValidate(ctx, formats); err != nil {
 			if ve, ok := err.(*errors.Validation); ok {
 			if ve, ok := err.(*errors.Validation); ok {
 				return ve.ValidateName("source")
 				return ve.ValidateName("source")

+ 159 - 0
pkg/models/all_metrics.go

@@ -0,0 +1,159 @@
+// 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"
+	"strconv"
+
+	"github.com/go-openapi/errors"
+	"github.com/go-openapi/strfmt"
+	"github.com/go-openapi/swag"
+)
+
+// AllMetrics AllMetrics
+//
+// swagger:model AllMetrics
+type AllMetrics struct {
+
+	// log processors metrics
+	LogProcessors []LogProcessorsMetrics `json:"log_processors"`
+
+	// remediation components metrics
+	RemediationComponents []RemediationComponentsMetrics `json:"remediation_components"`
+}
+
+// Validate validates this all metrics
+func (m *AllMetrics) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	if err := m.validateLogProcessors(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateRemediationComponents(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *AllMetrics) validateLogProcessors(formats strfmt.Registry) error {
+	if swag.IsZero(m.LogProcessors) { // not required
+		return nil
+	}
+
+	for i := 0; i < len(m.LogProcessors); i++ {
+
+		if err := m.LogProcessors[i].Validate(formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("log_processors" + "." + strconv.Itoa(i))
+			} else if ce, ok := err.(*errors.CompositeError); ok {
+				return ce.ValidateName("log_processors" + "." + strconv.Itoa(i))
+			}
+			return err
+		}
+
+	}
+
+	return nil
+}
+
+func (m *AllMetrics) validateRemediationComponents(formats strfmt.Registry) error {
+	if swag.IsZero(m.RemediationComponents) { // not required
+		return nil
+	}
+
+	for i := 0; i < len(m.RemediationComponents); i++ {
+
+		if err := m.RemediationComponents[i].Validate(formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("remediation_components" + "." + strconv.Itoa(i))
+			} else if ce, ok := err.(*errors.CompositeError); ok {
+				return ce.ValidateName("remediation_components" + "." + strconv.Itoa(i))
+			}
+			return err
+		}
+
+	}
+
+	return nil
+}
+
+// ContextValidate validate this all metrics based on the context it is used
+func (m *AllMetrics) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+	var res []error
+
+	if err := m.contextValidateLogProcessors(ctx, formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.contextValidateRemediationComponents(ctx, formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *AllMetrics) contextValidateLogProcessors(ctx context.Context, formats strfmt.Registry) error {
+
+	for i := 0; i < len(m.LogProcessors); i++ {
+
+		if err := m.LogProcessors[i].ContextValidate(ctx, formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("log_processors" + "." + strconv.Itoa(i))
+			} else if ce, ok := err.(*errors.CompositeError); ok {
+				return ce.ValidateName("log_processors" + "." + strconv.Itoa(i))
+			}
+			return err
+		}
+
+	}
+
+	return nil
+}
+
+func (m *AllMetrics) contextValidateRemediationComponents(ctx context.Context, formats strfmt.Registry) error {
+
+	for i := 0; i < len(m.RemediationComponents); i++ {
+
+		if err := m.RemediationComponents[i].ContextValidate(ctx, formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("remediation_components" + "." + strconv.Itoa(i))
+			} else if ce, ok := err.(*errors.CompositeError); ok {
+				return ce.ValidateName("remediation_components" + "." + strconv.Itoa(i))
+			}
+			return err
+		}
+
+	}
+
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *AllMetrics) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *AllMetrics) UnmarshalBinary(b []byte) error {
+	var res AllMetrics
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}

+ 240 - 0
pkg/models/base_metrics.go

@@ -0,0 +1,240 @@
+// 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"
+	"strconv"
+
+	"github.com/go-openapi/errors"
+	"github.com/go-openapi/strfmt"
+	"github.com/go-openapi/swag"
+	"github.com/go-openapi/validate"
+)
+
+// BaseMetrics BaseMetrics
+//
+// swagger:model BaseMetrics
+type BaseMetrics struct {
+
+	// feature flags (expected to be empty for remediation components)
+	FeatureFlags []string `json:"feature_flags"`
+
+	// metrics meta
+	// Required: true
+	Meta *MetricsMeta `json:"meta"`
+
+	// metrics details
+	Metrics []*MetricsDetailItem `json:"metrics"`
+
+	// OS information
+	// Required: true
+	Os *OSversion `json:"os"`
+
+	// version of the remediation component
+	// Required: true
+	Version *string `json:"version"`
+}
+
+// Validate validates this base metrics
+func (m *BaseMetrics) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	if err := m.validateMeta(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateMetrics(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateOs(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateVersion(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *BaseMetrics) validateMeta(formats strfmt.Registry) error {
+
+	if err := validate.Required("meta", "body", m.Meta); err != nil {
+		return err
+	}
+
+	if m.Meta != nil {
+		if err := m.Meta.Validate(formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("meta")
+			} else if ce, ok := err.(*errors.CompositeError); ok {
+				return ce.ValidateName("meta")
+			}
+			return err
+		}
+	}
+
+	return nil
+}
+
+func (m *BaseMetrics) validateMetrics(formats strfmt.Registry) error {
+	if swag.IsZero(m.Metrics) { // not required
+		return nil
+	}
+
+	for i := 0; i < len(m.Metrics); i++ {
+		if swag.IsZero(m.Metrics[i]) { // not required
+			continue
+		}
+
+		if m.Metrics[i] != nil {
+			if err := m.Metrics[i].Validate(formats); err != nil {
+				if ve, ok := err.(*errors.Validation); ok {
+					return ve.ValidateName("metrics" + "." + strconv.Itoa(i))
+				} else if ce, ok := err.(*errors.CompositeError); ok {
+					return ce.ValidateName("metrics" + "." + strconv.Itoa(i))
+				}
+				return err
+			}
+		}
+
+	}
+
+	return nil
+}
+
+func (m *BaseMetrics) validateOs(formats strfmt.Registry) error {
+
+	if err := validate.Required("os", "body", m.Os); err != nil {
+		return err
+	}
+
+	if m.Os != nil {
+		if err := m.Os.Validate(formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("os")
+			} else if ce, ok := err.(*errors.CompositeError); ok {
+				return ce.ValidateName("os")
+			}
+			return err
+		}
+	}
+
+	return nil
+}
+
+func (m *BaseMetrics) validateVersion(formats strfmt.Registry) error {
+
+	if err := validate.Required("version", "body", m.Version); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// ContextValidate validate this base metrics based on the context it is used
+func (m *BaseMetrics) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+	var res []error
+
+	if err := m.contextValidateMeta(ctx, formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.contextValidateMetrics(ctx, formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.contextValidateOs(ctx, formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *BaseMetrics) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
+
+	if m.Meta != nil {
+
+		if err := m.Meta.ContextValidate(ctx, formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("meta")
+			} else if ce, ok := err.(*errors.CompositeError); ok {
+				return ce.ValidateName("meta")
+			}
+			return err
+		}
+	}
+
+	return nil
+}
+
+func (m *BaseMetrics) contextValidateMetrics(ctx context.Context, formats strfmt.Registry) error {
+
+	for i := 0; i < len(m.Metrics); i++ {
+
+		if m.Metrics[i] != nil {
+
+			if swag.IsZero(m.Metrics[i]) { // not required
+				return nil
+			}
+
+			if err := m.Metrics[i].ContextValidate(ctx, formats); err != nil {
+				if ve, ok := err.(*errors.Validation); ok {
+					return ve.ValidateName("metrics" + "." + strconv.Itoa(i))
+				} else if ce, ok := err.(*errors.CompositeError); ok {
+					return ce.ValidateName("metrics" + "." + strconv.Itoa(i))
+				}
+				return err
+			}
+		}
+
+	}
+
+	return nil
+}
+
+func (m *BaseMetrics) contextValidateOs(ctx context.Context, formats strfmt.Registry) error {
+
+	if m.Os != nil {
+
+		if err := m.Os.ContextValidate(ctx, formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("os")
+			} else if ce, ok := err.(*errors.CompositeError); ok {
+				return ce.ValidateName("os")
+			}
+			return err
+		}
+	}
+
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *BaseMetrics) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *BaseMetrics) UnmarshalBinary(b []byte) error {
+	var res BaseMetrics
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}

+ 27 - 0
pkg/models/console_options.go

@@ -0,0 +1,27 @@
+// 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/strfmt"
+)
+
+// ConsoleOptions ConsoleOptions
+//
+// swagger:model ConsoleOptions
+type ConsoleOptions []string
+
+// Validate validates this console options
+func (m ConsoleOptions) Validate(formats strfmt.Registry) error {
+	return nil
+}
+
+// ContextValidate validates this console options based on context it is used
+func (m ConsoleOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+	return nil
+}

+ 5 - 0
pkg/models/get_alerts_response.go

@@ -54,6 +54,11 @@ func (m GetAlertsResponse) ContextValidate(ctx context.Context, formats strfmt.R
 	for i := 0; i < len(m); i++ {
 	for i := 0; i < len(m); i++ {
 
 
 		if m[i] != nil {
 		if m[i] != nil {
+
+			if swag.IsZero(m[i]) { // not required
+				return nil
+			}
+
 			if err := m[i].ContextValidate(ctx, formats); err != nil {
 			if err := m[i].ContextValidate(ctx, formats); err != nil {
 				if ve, ok := err.(*errors.Validation); ok {
 				if ve, ok := err.(*errors.Validation); ok {
 					return ve.ValidateName(strconv.Itoa(i))
 					return ve.ValidateName(strconv.Itoa(i))

+ 5 - 0
pkg/models/get_decisions_response.go

@@ -54,6 +54,11 @@ func (m GetDecisionsResponse) ContextValidate(ctx context.Context, formats strfm
 	for i := 0; i < len(m); i++ {
 	for i := 0; i < len(m); i++ {
 
 
 		if m[i] != nil {
 		if m[i] != nil {
+
+			if swag.IsZero(m[i]) { // not required
+				return nil
+			}
+
 			if err := m[i].ContextValidate(ctx, formats); err != nil {
 			if err := m[i].ContextValidate(ctx, formats); err != nil {
 				if ve, ok := err.(*errors.Validation); ok {
 				if ve, ok := err.(*errors.Validation); ok {
 					return ve.ValidateName(strconv.Itoa(i))
 					return ve.ValidateName(strconv.Itoa(i))

+ 239 - 0
pkg/models/log_processors_metrics.go

@@ -0,0 +1,239 @@
+// 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"
+	"strconv"
+
+	"github.com/go-openapi/errors"
+	"github.com/go-openapi/strfmt"
+	"github.com/go-openapi/swag"
+	"github.com/go-openapi/validate"
+)
+
+// LogProcessorsMetrics LogProcessorsMetrics
+//
+// swagger:model LogProcessorsMetrics
+type LogProcessorsMetrics []*LogProcessorsMetricsItems0
+
+// Validate validates this log processors metrics
+func (m LogProcessorsMetrics) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	iLogProcessorsMetricsSize := int64(len(m))
+
+	if err := validate.MaxItems("", "body", iLogProcessorsMetricsSize, 1); err != nil {
+		return err
+	}
+
+	for i := 0; i < len(m); i++ {
+		if swag.IsZero(m[i]) { // not required
+			continue
+		}
+
+		if m[i] != nil {
+			if err := m[i].Validate(formats); err != nil {
+				if ve, ok := err.(*errors.Validation); ok {
+					return ve.ValidateName(strconv.Itoa(i))
+				} else if ce, ok := err.(*errors.CompositeError); ok {
+					return ce.ValidateName(strconv.Itoa(i))
+				}
+				return err
+			}
+		}
+
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+// ContextValidate validate this log processors metrics based on the context it is used
+func (m LogProcessorsMetrics) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+	var res []error
+
+	for i := 0; i < len(m); i++ {
+
+		if m[i] != nil {
+
+			if swag.IsZero(m[i]) { // not required
+				return nil
+			}
+
+			if err := m[i].ContextValidate(ctx, formats); err != nil {
+				if ve, ok := err.(*errors.Validation); ok {
+					return ve.ValidateName(strconv.Itoa(i))
+				} else if ce, ok := err.(*errors.CompositeError); ok {
+					return ce.ValidateName(strconv.Itoa(i))
+				}
+				return err
+			}
+		}
+
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+// LogProcessorsMetricsItems0 log processors metrics items0
+//
+// swagger:model LogProcessorsMetricsItems0
+type LogProcessorsMetricsItems0 struct {
+	BaseMetrics
+
+	// console options
+	ConsoleOptions ConsoleOptions `json:"console_options,omitempty"`
+
+	// Number of datasources per type
+	Datasources map[string]int64 `json:"datasources,omitempty"`
+}
+
+// UnmarshalJSON unmarshals this object from a JSON structure
+func (m *LogProcessorsMetricsItems0) UnmarshalJSON(raw []byte) error {
+	// AO0
+	var aO0 BaseMetrics
+	if err := swag.ReadJSON(raw, &aO0); err != nil {
+		return err
+	}
+	m.BaseMetrics = aO0
+
+	// AO1
+	var dataAO1 struct {
+		ConsoleOptions ConsoleOptions `json:"console_options,omitempty"`
+
+		Datasources map[string]int64 `json:"datasources,omitempty"`
+	}
+	if err := swag.ReadJSON(raw, &dataAO1); err != nil {
+		return err
+	}
+
+	m.ConsoleOptions = dataAO1.ConsoleOptions
+
+	m.Datasources = dataAO1.Datasources
+
+	return nil
+}
+
+// MarshalJSON marshals this object to a JSON structure
+func (m LogProcessorsMetricsItems0) MarshalJSON() ([]byte, error) {
+	_parts := make([][]byte, 0, 2)
+
+	aO0, err := swag.WriteJSON(m.BaseMetrics)
+	if err != nil {
+		return nil, err
+	}
+	_parts = append(_parts, aO0)
+	var dataAO1 struct {
+		ConsoleOptions ConsoleOptions `json:"console_options,omitempty"`
+
+		Datasources map[string]int64 `json:"datasources,omitempty"`
+	}
+
+	dataAO1.ConsoleOptions = m.ConsoleOptions
+
+	dataAO1.Datasources = m.Datasources
+
+	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
+	if errAO1 != nil {
+		return nil, errAO1
+	}
+	_parts = append(_parts, jsonDataAO1)
+	return swag.ConcatJSON(_parts...), nil
+}
+
+// Validate validates this log processors metrics items0
+func (m *LogProcessorsMetricsItems0) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	// validation for a type composition with BaseMetrics
+	if err := m.BaseMetrics.Validate(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateConsoleOptions(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *LogProcessorsMetricsItems0) validateConsoleOptions(formats strfmt.Registry) error {
+
+	if swag.IsZero(m.ConsoleOptions) { // not required
+		return nil
+	}
+
+	if err := m.ConsoleOptions.Validate(formats); err != nil {
+		if ve, ok := err.(*errors.Validation); ok {
+			return ve.ValidateName("console_options")
+		} else if ce, ok := err.(*errors.CompositeError); ok {
+			return ce.ValidateName("console_options")
+		}
+		return err
+	}
+
+	return nil
+}
+
+// ContextValidate validate this log processors metrics items0 based on the context it is used
+func (m *LogProcessorsMetricsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+	var res []error
+
+	// validation for a type composition with BaseMetrics
+	if err := m.BaseMetrics.ContextValidate(ctx, formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.contextValidateConsoleOptions(ctx, formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *LogProcessorsMetricsItems0) contextValidateConsoleOptions(ctx context.Context, formats strfmt.Registry) error {
+
+	if err := m.ConsoleOptions.ContextValidate(ctx, formats); err != nil {
+		if ve, ok := err.(*errors.Validation); ok {
+			return ve.ValidateName("console_options")
+		} else if ce, ok := err.(*errors.CompositeError); ok {
+			return ce.ValidateName("console_options")
+		}
+		return err
+	}
+
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *LogProcessorsMetricsItems0) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *LogProcessorsMetricsItems0) UnmarshalBinary(b []byte) error {
+	var res LogProcessorsMetricsItems0
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}

+ 5 - 0
pkg/models/meta.go

@@ -56,6 +56,11 @@ func (m Meta) ContextValidate(ctx context.Context, formats strfmt.Registry) erro
 	for i := 0; i < len(m); i++ {
 	for i := 0; i < len(m); i++ {
 
 
 		if m[i] != nil {
 		if m[i] != nil {
+
+			if swag.IsZero(m[i]) { // not required
+				return nil
+			}
+
 			if err := m[i].ContextValidate(ctx, formats); err != nil {
 			if err := m[i].ContextValidate(ctx, formats); err != nil {
 				if ve, ok := err.(*errors.Validation); ok {
 				if ve, ok := err.(*errors.Validation); ok {
 					return ve.ValidateName(strconv.Itoa(i))
 					return ve.ValidateName(strconv.Itoa(i))

+ 10 - 0
pkg/models/metrics.go

@@ -141,6 +141,11 @@ func (m *Metrics) contextValidateBouncers(ctx context.Context, formats strfmt.Re
 	for i := 0; i < len(m.Bouncers); i++ {
 	for i := 0; i < len(m.Bouncers); i++ {
 
 
 		if m.Bouncers[i] != nil {
 		if m.Bouncers[i] != nil {
+
+			if swag.IsZero(m.Bouncers[i]) { // not required
+				return nil
+			}
+
 			if err := m.Bouncers[i].ContextValidate(ctx, formats); err != nil {
 			if err := m.Bouncers[i].ContextValidate(ctx, formats); err != nil {
 				if ve, ok := err.(*errors.Validation); ok {
 				if ve, ok := err.(*errors.Validation); ok {
 					return ve.ValidateName("bouncers" + "." + strconv.Itoa(i))
 					return ve.ValidateName("bouncers" + "." + strconv.Itoa(i))
@@ -161,6 +166,11 @@ func (m *Metrics) contextValidateMachines(ctx context.Context, formats strfmt.Re
 	for i := 0; i < len(m.Machines); i++ {
 	for i := 0; i < len(m.Machines); i++ {
 
 
 		if m.Machines[i] != nil {
 		if m.Machines[i] != nil {
+
+			if swag.IsZero(m.Machines[i]) { // not required
+				return nil
+			}
+
 			if err := m.Machines[i].ContextValidate(ctx, formats); err != nil {
 			if err := m.Machines[i].ContextValidate(ctx, formats); err != nil {
 				if ve, ok := err.(*errors.Validation); ok {
 				if ve, ok := err.(*errors.Validation); ok {
 					return ve.ValidateName("machines" + "." + strconv.Itoa(i))
 					return ve.ValidateName("machines" + "." + strconv.Itoa(i))

+ 115 - 0
pkg/models/metrics_detail_item.go

@@ -0,0 +1,115 @@
+// 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"
+)
+
+// MetricsDetailItem MetricsDetailItem
+//
+// swagger:model MetricsDetailItem
+type MetricsDetailItem struct {
+
+	// labels of the metric
+	Labels MetricsLabels `json:"labels,omitempty"`
+
+	// name of the metric
+	Name string `json:"name,omitempty"`
+
+	// unit of the metric
+	Unit string `json:"unit,omitempty"`
+
+	// value of the metric
+	Value float64 `json:"value,omitempty"`
+}
+
+// Validate validates this metrics detail item
+func (m *MetricsDetailItem) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	if err := m.validateLabels(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *MetricsDetailItem) validateLabels(formats strfmt.Registry) error {
+	if swag.IsZero(m.Labels) { // not required
+		return nil
+	}
+
+	if m.Labels != nil {
+		if err := m.Labels.Validate(formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("labels")
+			} else if ce, ok := err.(*errors.CompositeError); ok {
+				return ce.ValidateName("labels")
+			}
+			return err
+		}
+	}
+
+	return nil
+}
+
+// ContextValidate validate this metrics detail item based on the context it is used
+func (m *MetricsDetailItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+	var res []error
+
+	if err := m.contextValidateLabels(ctx, formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *MetricsDetailItem) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error {
+
+	if swag.IsZero(m.Labels) { // not required
+		return nil
+	}
+
+	if err := m.Labels.ContextValidate(ctx, formats); err != nil {
+		if ve, ok := err.(*errors.Validation); ok {
+			return ve.ValidateName("labels")
+		} else if ce, ok := err.(*errors.CompositeError); ok {
+			return ce.ValidateName("labels")
+		}
+		return err
+	}
+
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *MetricsDetailItem) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *MetricsDetailItem) UnmarshalBinary(b []byte) error {
+	var res MetricsDetailItem
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}

+ 27 - 0
pkg/models/metrics_labels.go

@@ -0,0 +1,27 @@
+// 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/strfmt"
+)
+
+// MetricsLabels MetricsLabels
+//
+// swagger:model MetricsLabels
+type MetricsLabels map[string]string
+
+// Validate validates this metrics labels
+func (m MetricsLabels) Validate(formats strfmt.Registry) error {
+	return nil
+}
+
+// ContextValidate validates this metrics labels based on context it is used
+func (m MetricsLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+	return nil
+}

+ 56 - 0
pkg/models/metrics_meta.go

@@ -0,0 +1,56 @@
+// 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/strfmt"
+	"github.com/go-openapi/swag"
+)
+
+// MetricsMeta MetricsMeta
+//
+// swagger:model MetricsMeta
+type MetricsMeta struct {
+
+	// UTC timestamp of the current time
+	UtcNowTimestamp float64 `json:"utc_now_timestamp,omitempty"`
+
+	// UTC timestamp of the startup of the software
+	UtcStartupTimestamp float64 `json:"utc_startup_timestamp,omitempty"`
+
+	// Size, in seconds, of the window used to compute the metric
+	WindowSizeSeconds int64 `json:"window_size_seconds,omitempty"`
+}
+
+// Validate validates this metrics meta
+func (m *MetricsMeta) Validate(formats strfmt.Registry) error {
+	return nil
+}
+
+// ContextValidate validates this metrics meta based on context it is used
+func (m *MetricsMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *MetricsMeta) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *MetricsMeta) UnmarshalBinary(b []byte) error {
+	var res MetricsMeta
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}

+ 53 - 0
pkg/models/o_sversion.go

@@ -0,0 +1,53 @@
+// 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/strfmt"
+	"github.com/go-openapi/swag"
+)
+
+// OSversion OSversion
+//
+// swagger:model OSversion
+type OSversion struct {
+
+	// name of the OS
+	Name string `json:"name,omitempty"`
+
+	// version of the OS
+	Version string `json:"version,omitempty"`
+}
+
+// Validate validates this o sversion
+func (m *OSversion) Validate(formats strfmt.Registry) error {
+	return nil
+}
+
+// ContextValidate validates this o sversion based on context it is used
+func (m *OSversion) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *OSversion) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *OSversion) UnmarshalBinary(b []byte) error {
+	var res OSversion
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}

+ 188 - 0
pkg/models/remediation_components_metrics.go

@@ -0,0 +1,188 @@
+// 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"
+	"strconv"
+
+	"github.com/go-openapi/errors"
+	"github.com/go-openapi/strfmt"
+	"github.com/go-openapi/swag"
+	"github.com/go-openapi/validate"
+)
+
+// RemediationComponentsMetrics RemediationComponentsMetrics
+//
+// swagger:model RemediationComponentsMetrics
+type RemediationComponentsMetrics []*RemediationComponentsMetricsItems0
+
+// Validate validates this remediation components metrics
+func (m RemediationComponentsMetrics) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	iRemediationComponentsMetricsSize := int64(len(m))
+
+	if err := validate.MaxItems("", "body", iRemediationComponentsMetricsSize, 1); err != nil {
+		return err
+	}
+
+	for i := 0; i < len(m); i++ {
+		if swag.IsZero(m[i]) { // not required
+			continue
+		}
+
+		if m[i] != nil {
+			if err := m[i].Validate(formats); err != nil {
+				if ve, ok := err.(*errors.Validation); ok {
+					return ve.ValidateName(strconv.Itoa(i))
+				} else if ce, ok := err.(*errors.CompositeError); ok {
+					return ce.ValidateName(strconv.Itoa(i))
+				}
+				return err
+			}
+		}
+
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+// ContextValidate validate this remediation components metrics based on the context it is used
+func (m RemediationComponentsMetrics) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+	var res []error
+
+	for i := 0; i < len(m); i++ {
+
+		if m[i] != nil {
+
+			if swag.IsZero(m[i]) { // not required
+				return nil
+			}
+
+			if err := m[i].ContextValidate(ctx, formats); err != nil {
+				if ve, ok := err.(*errors.Validation); ok {
+					return ve.ValidateName(strconv.Itoa(i))
+				} else if ce, ok := err.(*errors.CompositeError); ok {
+					return ce.ValidateName(strconv.Itoa(i))
+				}
+				return err
+			}
+		}
+
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+// RemediationComponentsMetricsItems0 remediation components metrics items0
+//
+// swagger:model RemediationComponentsMetricsItems0
+type RemediationComponentsMetricsItems0 struct {
+	BaseMetrics
+
+	// type of the remediation component
+	Type string `json:"type,omitempty"`
+}
+
+// UnmarshalJSON unmarshals this object from a JSON structure
+func (m *RemediationComponentsMetricsItems0) UnmarshalJSON(raw []byte) error {
+	// AO0
+	var aO0 BaseMetrics
+	if err := swag.ReadJSON(raw, &aO0); err != nil {
+		return err
+	}
+	m.BaseMetrics = aO0
+
+	// AO1
+	var dataAO1 struct {
+		Type string `json:"type,omitempty"`
+	}
+	if err := swag.ReadJSON(raw, &dataAO1); err != nil {
+		return err
+	}
+
+	m.Type = dataAO1.Type
+
+	return nil
+}
+
+// MarshalJSON marshals this object to a JSON structure
+func (m RemediationComponentsMetricsItems0) MarshalJSON() ([]byte, error) {
+	_parts := make([][]byte, 0, 2)
+
+	aO0, err := swag.WriteJSON(m.BaseMetrics)
+	if err != nil {
+		return nil, err
+	}
+	_parts = append(_parts, aO0)
+	var dataAO1 struct {
+		Type string `json:"type,omitempty"`
+	}
+
+	dataAO1.Type = m.Type
+
+	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
+	if errAO1 != nil {
+		return nil, errAO1
+	}
+	_parts = append(_parts, jsonDataAO1)
+	return swag.ConcatJSON(_parts...), nil
+}
+
+// Validate validates this remediation components metrics items0
+func (m *RemediationComponentsMetricsItems0) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	// validation for a type composition with BaseMetrics
+	if err := m.BaseMetrics.Validate(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+// ContextValidate validate this remediation components metrics items0 based on the context it is used
+func (m *RemediationComponentsMetricsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+	var res []error
+
+	// validation for a type composition with BaseMetrics
+	if err := m.BaseMetrics.ContextValidate(ctx, formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *RemediationComponentsMetricsItems0) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *RemediationComponentsMetricsItems0) UnmarshalBinary(b []byte) error {
+	var res RemediationComponentsMetricsItems0
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}

+ 73 - 0
pkg/models/success_response.go

@@ -0,0 +1,73 @@
+// 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"
+)
+
+// SuccessResponse success response
+//
+// success response return by the API
+//
+// swagger:model SuccessResponse
+type SuccessResponse struct {
+
+	// message
+	// Required: true
+	Message *string `json:"message"`
+}
+
+// Validate validates this success response
+func (m *SuccessResponse) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	if err := m.validateMessage(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *SuccessResponse) validateMessage(formats strfmt.Registry) error {
+
+	if err := validate.Required("message", "body", m.Message); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// ContextValidate validates this success response based on context it is used
+func (m *SuccessResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SuccessResponse) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SuccessResponse) UnmarshalBinary(b []byte) error {
+	var res SuccessResponse
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}