func (m *ClientCredentials) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateClientID(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateClientSecret(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
Validate validates this client credentials
package models
import (
	"bytes"
	"encoding/json"
	strfmt "github.com/go-openapi/strfmt"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
	manifold "github.com/manifoldco/go-manifold"
)
type ClientCredentials struct {
	clientIdField manifold.ID
	clientSecretField OAuthClientSecret
}
func (m *ClientCredentials) ClientID() manifold.ID {
	return m.clientIdField
}
func (m *ClientCredentials) SetClientID(val manifold.ID) {
	m.clientIdField = val
}
func (m *ClientCredentials) ClientSecret() OAuthClientSecret {
	return m.clientSecretField
}
func (m *ClientCredentials) SetClientSecret(val OAuthClientSecret) {
	m.clientSecretField = val
}
func (m *ClientCredentials) GrantType() string {
	return "client_credentials"
}
func (m *ClientCredentials) SetGrantType(val string) {
}
func (m *ClientCredentials) UnmarshalJSON(raw []byte) error {
	var data struct {
		ClientID manifold.ID `json:"client_id,omitempty"`
		ClientSecret OAuthClientSecret `json:"client_secret,omitempty"`
		GrantType string `json:"grant_type"`
	}
	buf := bytes.NewBuffer(raw)
	dec := json.NewDecoder(buf)
	dec.UseNumber()
	if err := dec.Decode(&data); err != nil {
		return err
	}
	m.clientIdField = data.ClientID
	m.clientSecretField = data.ClientSecret
	return nil
}
func (m ClientCredentials) MarshalJSON() ([]byte, error) {
	var data struct {
		ClientID manifold.ID `json:"client_id,omitempty"`
		ClientSecret OAuthClientSecret `json:"client_secret,omitempty"`
		GrantType string `json:"grant_type"`
	}
	data.ClientID = m.clientIdField
	data.ClientSecret = m.clientSecretField
	data.GrantType = "client_credentials"
	return json.Marshal(data)
}