// Code generated by go-swagger; DO NOT EDIT.

package ops

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

// OperationOperationApproverFromParam The approver is generated from param
//
// swagger:model operation.OperationApprover from_param
type OperationOperationApproverFromParam struct {
	OperationOperationApproverForParam
}

// UnmarshalJSON unmarshals this object from a JSON structure
func (m *OperationOperationApproverFromParam) UnmarshalJSON(raw []byte) error {
	// AO0
	var aO0 OperationOperationApproverForParam
	if err := swag.ReadJSON(raw, &aO0); err != nil {
		return err
	}
	m.OperationOperationApproverForParam = aO0

	return nil
}

// MarshalJSON marshals this object to a JSON structure
func (m OperationOperationApproverFromParam) MarshalJSON() ([]byte, error) {
	_parts := make([][]byte, 0, 1)

	aO0, err := swag.WriteJSON(m.OperationOperationApproverForParam)
	if err != nil {
		return nil, err
	}
	_parts = append(_parts, aO0)
	return swag.ConcatJSON(_parts...), nil
}

// Validate validates this operation operation approver from param
func (m *OperationOperationApproverFromParam) Validate(formats strfmt.Registry) error {
	var res []error

	// validation for a type composition with OperationOperationApproverForParam
	if err := m.OperationOperationApproverForParam.Validate(formats); err != nil {
		res = append(res, err)
	}

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

// ContextValidate validate this operation operation approver from param based on the context it is used
func (m *OperationOperationApproverFromParam) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

	// validation for a type composition with OperationOperationApproverForParam
	if err := m.OperationOperationApproverForParam.ContextValidate(ctx, formats); err != nil {
		res = append(res, err)
	}

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

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

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