// 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"
	"github.com/go-openapi/validate"
)

// DataflowDescribeSchemaTableResp dataflow describe schema table resp
//
// swagger:model dataflowDescribeSchemaTableResp
type DataflowDescribeSchemaTableResp struct {

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

	// gc safe point
	// Format: date-time
	GcSafePoint strfmt.DateTime `json:"gc_safe_point,omitempty"`

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

	// replicate allow schema table
	ReplicateAllowSchemaTable []string `json:"replicate_allow_schema_table"`

	// replicate deny schema table
	ReplicateDenySchemaTable []string `json:"replicate_deny_schema_table"`
}

// Validate validates this dataflow describe schema table resp
func (m *DataflowDescribeSchemaTableResp) Validate(formats strfmt.Registry) error {
	var res []error

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

	if err := m.validateGcSafePoint(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 *DataflowDescribeSchemaTableResp) validateClusterID(formats strfmt.Registry) error {

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

	return nil
}

func (m *DataflowDescribeSchemaTableResp) validateGcSafePoint(formats strfmt.Registry) error {
	if swag.IsZero(m.GcSafePoint) { // not required
		return nil
	}

	if err := validate.FormatOf("gc_safe_point", "body", "date-time", m.GcSafePoint.String(), formats); err != nil {
		return err
	}

	return nil
}

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

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

	return nil
}

// ContextValidate validates this dataflow describe schema table resp based on context it is used
func (m *DataflowDescribeSchemaTableResp) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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