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

// OpenapiTableDataRow TableDataRow
//
// TableDataRow is a single row in a table.
//
// swagger:model openapiTableDataRow
type OpenapiTableDataRow struct {

	// The columns extracted from a table row.
	// Example: ["1","abc"]
	// Required: true
	Columns []string `json:"columns"`
}

// Validate validates this openapi table data row
func (m *OpenapiTableDataRow) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (m *OpenapiTableDataRow) validateColumns(formats strfmt.Registry) error {

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

	return nil
}

// ContextValidate validates this openapi table data row based on context it is used
func (m *OpenapiTableDataRow) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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