blob: 3163bf9aba20082ca0fcace0b500c942f16f171a [file] [log] [blame]
// Code generated by go-swagger; DO NOT EDIT.
package clientmodel
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// ImperativePolicyDefinition imperative policy definition
// swagger:model ImperativePolicyDefinition
type ImperativePolicyDefinition struct {
// policy parameter ID
// Required: true
PolicyParameterID *int64 `json:"PolicyParameterID"`
// policy parameter value
// Required: true
PolicyParameterValue *int64 `json:"PolicyParameterValue"`
}
// Validate validates this imperative policy definition
func (m *ImperativePolicyDefinition) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePolicyParameterID(formats); err != nil {
res = append(res, err)
}
if err := m.validatePolicyParameterValue(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ImperativePolicyDefinition) validatePolicyParameterID(formats strfmt.Registry) error {
if err := validate.Required("PolicyParameterID", "body", m.PolicyParameterID); err != nil {
return err
}
return nil
}
func (m *ImperativePolicyDefinition) validatePolicyParameterValue(formats strfmt.Registry) error {
if err := validate.Required("PolicyParameterValue", "body", m.PolicyParameterValue); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *ImperativePolicyDefinition) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ImperativePolicyDefinition) UnmarshalBinary(b []byte) error {
var res ImperativePolicyDefinition
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}