func NewPostOauthTokensInternalServerError() *PostOauthTokensInternalServerError {
	return &PostOauthTokensInternalServerError{}
}
NewPostOauthTokensInternalServerError creates a PostOauthTokensInternalServerError with default headers values
package o_auth
import (
	"encoding/json"
	"fmt"
	"io"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/validate"
	strfmt "github.com/go-openapi/strfmt"
	"github.com/manifoldco/grafton/generated/connector/models"
)
type PostOauthTokensReader struct {
	formats strfmt.Registry
}
func (o *PostOauthTokensReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 201:
		result := NewPostOauthTokensCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostOauthTokensBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostOauthTokensUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostOauthTokensInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("unknown error", response, response.Code())
	}
}
func NewPostOauthTokensCreated() *PostOauthTokensCreated {
	return &PostOauthTokensCreated{}
}
type PostOauthTokensCreated struct {
	Payload *models.AccessToken
}
func (o *PostOauthTokensCreated) Error() string {
	return fmt.Sprintf("[POST /oauth/tokens][%d] postOauthTokensCreated  %+v", 201, o.Payload)
}
func (o *PostOauthTokensCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
	o.Payload = new(models.AccessToken)
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}
	return nil
}
func NewPostOauthTokensBadRequest() *PostOauthTokensBadRequest {
	return &PostOauthTokensBadRequest{}
}
type PostOauthTokensBadRequest struct {
	Payload PostOauthTokensBadRequestBody
}
func (o *PostOauthTokensBadRequest) Error() string {
	return fmt.Sprintf("[POST /oauth/tokens][%d] postOauthTokensBadRequest  %+v", 400, o.Payload)
}
func (o *PostOauthTokensBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}
	return nil
}
func NewPostOauthTokensUnauthorized() *PostOauthTokensUnauthorized {
	return &PostOauthTokensUnauthorized{}
}
type PostOauthTokensUnauthorized struct {
	Payload PostOauthTokensUnauthorizedBody
}
func (o *PostOauthTokensUnauthorized) Error() string {
	return fmt.Sprintf("[POST /oauth/tokens][%d] postOauthTokensUnauthorized  %+v", 401, o.Payload)
}
func (o *PostOauthTokensUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}
	return nil
}