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

// HashicorpCloudCommonSortingRequest SortingRequest are the parameters for a sorted list request.
//
// swagger:model hashicorp.cloud.common.SortingRequest
type HashicorpCloudCommonSortingRequest struct {

	// Specifies the list of per field ordering that should be used for sorting.
	// The order matters as rows are sorted in order by fields and when the field
	// matches, the next field is used to tie break the ordering.
	// The per field default ordering is ascending.
	//
	// The fields should be immutabile, unique, and orderable. If the field is
	// not unique, more than one sort fields should be passed.
	//
	// Example: oder_by=name,age desc,created_at asc
	// In that case, 'name' will get the default 'ascending' order.
	OrderBy []string `json:"order_by"`
}

// Validate validates this hashicorp cloud common sorting request
func (m *HashicorpCloudCommonSortingRequest) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this hashicorp cloud common sorting request based on context it is used
func (m *HashicorpCloudCommonSortingRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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