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

package model

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

// DataflowDumplingTaskID dataflow dumpling task ID
//
// swagger:model dataflowDumplingTaskID
type DataflowDumplingTaskID struct {

	// cluster id
	// Required: true
	ClusterID *string `json:"cluster_id"`

	// dumpling id
	// Required: true
	DumplingID *string `json:"dumpling_id"`

	// org id
	// Required: true
	OrgID *string `json:"org_id"`

	// project id
	// Required: true
	ProjectID *string `json:"project_id"`
}

// Validate validates this dataflow dumpling task ID
func (m *DataflowDumplingTaskID) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

func (m *DataflowDumplingTaskID) validateClusterID(formats strfmt.Registry) error {

	if err := validate.Required("cluster_id", "body", m.ClusterID); err != nil {
		return err
	}

	return nil
}

func (m *DataflowDumplingTaskID) validateDumplingID(formats strfmt.Registry) error {

	if err := validate.Required("dumpling_id", "body", m.DumplingID); err != nil {
		return err
	}

	return nil
}

func (m *DataflowDumplingTaskID) validateOrgID(formats strfmt.Registry) error {

	if err := validate.Required("org_id", "body", m.OrgID); err != nil {
		return err
	}

	return nil
}

func (m *DataflowDumplingTaskID) validateProjectID(formats strfmt.Registry) error {

	if err := validate.Required("project_id", "body", m.ProjectID); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this dataflow dumpling task ID based on context it is used
func (m *DataflowDumplingTaskID) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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