func (m AuthorizationCode) MarshalJSON() ([]byte, error) {
	var data struct {
		ClientID manifold.ID `json:"client_id,omitempty"`
		ClientSecret OAuthClientSecret `json:"client_secret,omitempty"`
		GrantType string `json:"grant_type"`
		Code Code `json:"code"`
	}
	data.ClientID = m.clientIdField
	data.ClientSecret = m.clientSecretField
	data.Code = m.Code
	data.GrantType = "authorization_code"
	return json.Marshal(data)
}
MarshalJSON marshals this polymorphic type to a JSON structure
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 AuthorizationCode struct {
	clientIdField manifold.ID
	clientSecretField OAuthClientSecret
	Code Code `json:"code"`
}
func (m *AuthorizationCode) ClientID() manifold.ID {
	return m.clientIdField
}
func (m *AuthorizationCode) SetClientID(val manifold.ID) {
	m.clientIdField = val
}
func (m *AuthorizationCode) ClientSecret() OAuthClientSecret {
	return m.clientSecretField
}
func (m *AuthorizationCode) SetClientSecret(val OAuthClientSecret) {
	m.clientSecretField = val
}
func (m *AuthorizationCode) GrantType() string {
	return "authorization_code"
}
func (m *AuthorizationCode) SetGrantType(val string) {
}
func (m *AuthorizationCode) 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"`
		Code Code `json:"code"`
	}
	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
	m.Code = data.Code
	return nil
}