peridot/vendor/github.com/ory/hydra-client-go/client/admin/get_consent_request_responses.go

182 lines
5.4 KiB
Go
Raw Normal View History

2022-07-07 20:11:50 +00:00
// 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 (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/ory/hydra-client-go/models"
)
// GetConsentRequestReader is a Reader for the GetConsentRequest structure.
type GetConsentRequestReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetConsentRequestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetConsentRequestOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 404:
result := NewGetConsentRequestNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 410:
result := NewGetConsentRequestGone()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetConsentRequestInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetConsentRequestOK creates a GetConsentRequestOK with default headers values
func NewGetConsentRequestOK() *GetConsentRequestOK {
return &GetConsentRequestOK{}
}
/* GetConsentRequestOK describes a response with status code 200, with default header values.
consentRequest
*/
type GetConsentRequestOK struct {
Payload *models.ConsentRequest
}
func (o *GetConsentRequestOK) Error() string {
return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestOK %+v", 200, o.Payload)
}
func (o *GetConsentRequestOK) GetPayload() *models.ConsentRequest {
return o.Payload
}
func (o *GetConsentRequestOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.ConsentRequest)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetConsentRequestNotFound creates a GetConsentRequestNotFound with default headers values
func NewGetConsentRequestNotFound() *GetConsentRequestNotFound {
return &GetConsentRequestNotFound{}
}
/* GetConsentRequestNotFound describes a response with status code 404, with default header values.
jsonError
*/
type GetConsentRequestNotFound struct {
Payload *models.JSONError
}
func (o *GetConsentRequestNotFound) Error() string {
return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestNotFound %+v", 404, o.Payload)
}
func (o *GetConsentRequestNotFound) GetPayload() *models.JSONError {
return o.Payload
}
func (o *GetConsentRequestNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.JSONError)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetConsentRequestGone creates a GetConsentRequestGone with default headers values
func NewGetConsentRequestGone() *GetConsentRequestGone {
return &GetConsentRequestGone{}
}
/* GetConsentRequestGone describes a response with status code 410, with default header values.
requestWasHandledResponse
*/
type GetConsentRequestGone struct {
Payload *models.RequestWasHandledResponse
}
func (o *GetConsentRequestGone) Error() string {
return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestGone %+v", 410, o.Payload)
}
func (o *GetConsentRequestGone) GetPayload() *models.RequestWasHandledResponse {
return o.Payload
}
func (o *GetConsentRequestGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.RequestWasHandledResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetConsentRequestInternalServerError creates a GetConsentRequestInternalServerError with default headers values
func NewGetConsentRequestInternalServerError() *GetConsentRequestInternalServerError {
return &GetConsentRequestInternalServerError{}
}
/* GetConsentRequestInternalServerError describes a response with status code 500, with default header values.
jsonError
*/
type GetConsentRequestInternalServerError struct {
Payload *models.JSONError
}
func (o *GetConsentRequestInternalServerError) Error() string {
return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestInternalServerError %+v", 500, o.Payload)
}
func (o *GetConsentRequestInternalServerError) GetPayload() *models.JSONError {
return o.Payload
}
func (o *GetConsentRequestInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.JSONError)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}