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

// DataflowCreateReplicationResp dataflow create replication resp
//
// swagger:model dataflowCreateReplicationResp
type DataflowCreateReplicationResp struct {

	// base resp
	BaseResp *BaseBaseResp `json:"base_resp,omitempty"`

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

// Validate validates this dataflow create replication resp
func (m *DataflowCreateReplicationResp) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (m *DataflowCreateReplicationResp) validateBaseResp(formats strfmt.Registry) error {
	if swag.IsZero(m.BaseResp) { // not required
		return nil
	}

	if m.BaseResp != nil {
		if err := m.BaseResp.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("base_resp")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("base_resp")
			}
			return err
		}
	}

	return nil
}

// ContextValidate validate this dataflow create replication resp based on the context it is used
func (m *DataflowCreateReplicationResp) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

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

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

func (m *DataflowCreateReplicationResp) contextValidateBaseResp(ctx context.Context, formats strfmt.Registry) error {

	if m.BaseResp != nil {
		if err := m.BaseResp.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("base_resp")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("base_resp")
			}
			return err
		}
	}

	return nil
}

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

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