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

182 lines
5.3 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"
)
// UpdateJSONWebKeyReader is a Reader for the UpdateJSONWebKey structure.
type UpdateJSONWebKeyReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *UpdateJSONWebKeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewUpdateJSONWebKeyOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewUpdateJSONWebKeyUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewUpdateJSONWebKeyForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewUpdateJSONWebKeyInternalServerError()
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())
}
}
// NewUpdateJSONWebKeyOK creates a UpdateJSONWebKeyOK with default headers values
func NewUpdateJSONWebKeyOK() *UpdateJSONWebKeyOK {
return &UpdateJSONWebKeyOK{}
}
/* UpdateJSONWebKeyOK describes a response with status code 200, with default header values.
JSONWebKey
*/
type UpdateJSONWebKeyOK struct {
Payload *models.JSONWebKey
}
func (o *UpdateJSONWebKeyOK) Error() string {
return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyOK %+v", 200, o.Payload)
}
func (o *UpdateJSONWebKeyOK) GetPayload() *models.JSONWebKey {
return o.Payload
}
func (o *UpdateJSONWebKeyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.JSONWebKey)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewUpdateJSONWebKeyUnauthorized creates a UpdateJSONWebKeyUnauthorized with default headers values
func NewUpdateJSONWebKeyUnauthorized() *UpdateJSONWebKeyUnauthorized {
return &UpdateJSONWebKeyUnauthorized{}
}
/* UpdateJSONWebKeyUnauthorized describes a response with status code 401, with default header values.
jsonError
*/
type UpdateJSONWebKeyUnauthorized struct {
Payload *models.JSONError
}
func (o *UpdateJSONWebKeyUnauthorized) Error() string {
return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyUnauthorized %+v", 401, o.Payload)
}
func (o *UpdateJSONWebKeyUnauthorized) GetPayload() *models.JSONError {
return o.Payload
}
func (o *UpdateJSONWebKeyUnauthorized) 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
}
// NewUpdateJSONWebKeyForbidden creates a UpdateJSONWebKeyForbidden with default headers values
func NewUpdateJSONWebKeyForbidden() *UpdateJSONWebKeyForbidden {
return &UpdateJSONWebKeyForbidden{}
}
/* UpdateJSONWebKeyForbidden describes a response with status code 403, with default header values.
jsonError
*/
type UpdateJSONWebKeyForbidden struct {
Payload *models.JSONError
}
func (o *UpdateJSONWebKeyForbidden) Error() string {
return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyForbidden %+v", 403, o.Payload)
}
func (o *UpdateJSONWebKeyForbidden) GetPayload() *models.JSONError {
return o.Payload
}
func (o *UpdateJSONWebKeyForbidden) 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
}
// NewUpdateJSONWebKeyInternalServerError creates a UpdateJSONWebKeyInternalServerError with default headers values
func NewUpdateJSONWebKeyInternalServerError() *UpdateJSONWebKeyInternalServerError {
return &UpdateJSONWebKeyInternalServerError{}
}
/* UpdateJSONWebKeyInternalServerError describes a response with status code 500, with default header values.
jsonError
*/
type UpdateJSONWebKeyInternalServerError struct {
Payload *models.JSONError
}
func (o *UpdateJSONWebKeyInternalServerError) Error() string {
return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyInternalServerError %+v", 500, o.Payload)
}
func (o *UpdateJSONWebKeyInternalServerError) GetPayload() *models.JSONError {
return o.Payload
}
func (o *UpdateJSONWebKeyInternalServerError) 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
}