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

// OperationOperationApprovalCc ApprovalCC defines who can receive the approval cc after approved.
//
// swagger:model operation.Operation approval_cc
type OperationOperationApprovalCc struct {
	OperationOperationApprover
}

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

	return nil
}

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

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

// Validate validates this operation operation approval cc
func (m *OperationOperationApprovalCc) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

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

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