// Code generated by go-swagger; DO NOT EDIT.

package admin

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"
	"fmt"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
)

// GrantsReader is a Reader for the Grants structure.
type GrantsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GrantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGrantsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGrantsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGrantsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGrantsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /grants] grants", response, response.Code())
	}
}

// NewGrantsOK creates a GrantsOK with default headers values
func NewGrantsOK() *GrantsOK {
	return &GrantsOK{}
}

/*
GrantsOK describes a response with status code 200, with default header values.

ok
*/
type GrantsOK struct {
}

// IsSuccess returns true when this grants o k response has a 2xx status code
func (o *GrantsOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this grants o k response has a 3xx status code
func (o *GrantsOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this grants o k response has a 4xx status code
func (o *GrantsOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this grants o k response has a 5xx status code
func (o *GrantsOK) IsServerError() bool {
	return false
}

// IsCode returns true when this grants o k response a status code equal to that given
func (o *GrantsOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the grants o k response
func (o *GrantsOK) Code() int {
	return 200
}

func (o *GrantsOK) Error() string {
	return fmt.Sprintf("[POST /grants][%d] grantsOK ", 200)
}

func (o *GrantsOK) String() string {
	return fmt.Sprintf("[POST /grants][%d] grantsOK ", 200)
}

func (o *GrantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	return nil
}

// NewGrantsUnauthorized creates a GrantsUnauthorized with default headers values
func NewGrantsUnauthorized() *GrantsUnauthorized {
	return &GrantsUnauthorized{}
}

/*
GrantsUnauthorized describes a response with status code 401, with default header values.

unauthorized
*/
type GrantsUnauthorized struct {
}

// IsSuccess returns true when this grants unauthorized response has a 2xx status code
func (o *GrantsUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this grants unauthorized response has a 3xx status code
func (o *GrantsUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this grants unauthorized response has a 4xx status code
func (o *GrantsUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this grants unauthorized response has a 5xx status code
func (o *GrantsUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this grants unauthorized response a status code equal to that given
func (o *GrantsUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the grants unauthorized response
func (o *GrantsUnauthorized) Code() int {
	return 401
}

func (o *GrantsUnauthorized) Error() string {
	return fmt.Sprintf("[POST /grants][%d] grantsUnauthorized ", 401)
}

func (o *GrantsUnauthorized) String() string {
	return fmt.Sprintf("[POST /grants][%d] grantsUnauthorized ", 401)
}

func (o *GrantsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	return nil
}

// NewGrantsNotFound creates a GrantsNotFound with default headers values
func NewGrantsNotFound() *GrantsNotFound {
	return &GrantsNotFound{}
}

/*
GrantsNotFound describes a response with status code 404, with default header values.

not found
*/
type GrantsNotFound struct {
}

// IsSuccess returns true when this grants not found response has a 2xx status code
func (o *GrantsNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this grants not found response has a 3xx status code
func (o *GrantsNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this grants not found response has a 4xx status code
func (o *GrantsNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this grants not found response has a 5xx status code
func (o *GrantsNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this grants not found response a status code equal to that given
func (o *GrantsNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the grants not found response
func (o *GrantsNotFound) Code() int {
	return 404
}

func (o *GrantsNotFound) Error() string {
	return fmt.Sprintf("[POST /grants][%d] grantsNotFound ", 404)
}

func (o *GrantsNotFound) String() string {
	return fmt.Sprintf("[POST /grants][%d] grantsNotFound ", 404)
}

func (o *GrantsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	return nil
}

// NewGrantsInternalServerError creates a GrantsInternalServerError with default headers values
func NewGrantsInternalServerError() *GrantsInternalServerError {
	return &GrantsInternalServerError{}
}

/*
GrantsInternalServerError describes a response with status code 500, with default header values.

internal server error
*/
type GrantsInternalServerError struct {
}

// IsSuccess returns true when this grants internal server error response has a 2xx status code
func (o *GrantsInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this grants internal server error response has a 3xx status code
func (o *GrantsInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this grants internal server error response has a 4xx status code
func (o *GrantsInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this grants internal server error response has a 5xx status code
func (o *GrantsInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this grants internal server error response a status code equal to that given
func (o *GrantsInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the grants internal server error response
func (o *GrantsInternalServerError) Code() int {
	return 500
}

func (o *GrantsInternalServerError) Error() string {
	return fmt.Sprintf("[POST /grants][%d] grantsInternalServerError ", 500)
}

func (o *GrantsInternalServerError) String() string {
	return fmt.Sprintf("[POST /grants][%d] grantsInternalServerError ", 500)
}

func (o *GrantsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	return nil
}

/*
GrantsBody grants body
swagger:model GrantsBody
*/
type GrantsBody struct {

	// email
	Email string `json:"email,omitempty"`
}

// Validate validates this grants body
func (o *GrantsBody) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this grants body based on context it is used
func (o *GrantsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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