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

// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package certificates

// 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"

	"code.tnxs.net/work/lib/api/members/members_models"
)

// GetCertificatesReader is a Reader for the GetCertificates structure.
type GetCertificatesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetCertificatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetCertificatesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetCertificatesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetCertificatesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetCertificatesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetCertificatesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetCertificatesInternalServerError()
		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())
	}
}

// NewGetCertificatesOK creates a GetCertificatesOK with default headers values
func NewGetCertificatesOK() *GetCertificatesOK {
	return &GetCertificatesOK{}
}

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

Certificate Response Object
*/
type GetCertificatesOK struct {
	Payload *members_models.CertificateResponse
}

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

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

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

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

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

// Code gets the status code for the get certificates o k response
func (o *GetCertificatesOK) Code() int {
	return 200
}

func (o *GetCertificatesOK) Error() string {
	return fmt.Sprintf("[GET /certificates][%d] getCertificatesOK  %+v", 200, o.Payload)
}

func (o *GetCertificatesOK) String() string {
	return fmt.Sprintf("[GET /certificates][%d] getCertificatesOK  %+v", 200, o.Payload)
}

func (o *GetCertificatesOK) GetPayload() *members_models.CertificateResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.CertificateResponse)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewGetCertificatesUnauthorized creates a GetCertificatesUnauthorized with default headers values
func NewGetCertificatesUnauthorized() *GetCertificatesUnauthorized {
	return &GetCertificatesUnauthorized{}
}

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

Access Unauthorized, invalid API-KEY was used
*/
type GetCertificatesUnauthorized struct {
	Payload *members_models.Error
}

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

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

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

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

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

// Code gets the status code for the get certificates unauthorized response
func (o *GetCertificatesUnauthorized) Code() int {
	return 401
}

func (o *GetCertificatesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /certificates][%d] getCertificatesUnauthorized  %+v", 401, o.Payload)
}

func (o *GetCertificatesUnauthorized) String() string {
	return fmt.Sprintf("[GET /certificates][%d] getCertificatesUnauthorized  %+v", 401, o.Payload)
}

func (o *GetCertificatesUnauthorized) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewGetCertificatesForbidden creates a GetCertificatesForbidden with default headers values
func NewGetCertificatesForbidden() *GetCertificatesForbidden {
	return &GetCertificatesForbidden{}
}

/*
GetCertificatesForbidden describes a response with status code 403, with default header values.

Access forbidden, account lacks access
*/
type GetCertificatesForbidden struct {
	AccessControlAllowOrigin string

	Payload *members_models.Error
}

// IsSuccess returns true when this get certificates forbidden response has a 2xx status code
func (o *GetCertificatesForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get certificates forbidden response has a 3xx status code
func (o *GetCertificatesForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get certificates forbidden response has a 4xx status code
func (o *GetCertificatesForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this get certificates forbidden response has a 5xx status code
func (o *GetCertificatesForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this get certificates forbidden response a status code equal to that given
func (o *GetCertificatesForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the get certificates forbidden response
func (o *GetCertificatesForbidden) Code() int {
	return 403
}

func (o *GetCertificatesForbidden) Error() string {
	return fmt.Sprintf("[GET /certificates][%d] getCertificatesForbidden  %+v", 403, o.Payload)
}

func (o *GetCertificatesForbidden) String() string {
	return fmt.Sprintf("[GET /certificates][%d] getCertificatesForbidden  %+v", 403, o.Payload)
}

func (o *GetCertificatesForbidden) GetPayload() *members_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(members_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewGetCertificatesNotFound creates a GetCertificatesNotFound with default headers values
func NewGetCertificatesNotFound() *GetCertificatesNotFound {
	return &GetCertificatesNotFound{}
}

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

Resource was not found
*/
type GetCertificatesNotFound struct {
	Payload *members_models.Error
}

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

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

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

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

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

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

func (o *GetCertificatesNotFound) Error() string {
	return fmt.Sprintf("[GET /certificates][%d] getCertificatesNotFound  %+v", 404, o.Payload)
}

func (o *GetCertificatesNotFound) String() string {
	return fmt.Sprintf("[GET /certificates][%d] getCertificatesNotFound  %+v", 404, o.Payload)
}

func (o *GetCertificatesNotFound) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewGetCertificatesUnprocessableEntity creates a GetCertificatesUnprocessableEntity with default headers values
func NewGetCertificatesUnprocessableEntity() *GetCertificatesUnprocessableEntity {
	return &GetCertificatesUnprocessableEntity{}
}

/*
GetCertificatesUnprocessableEntity describes a response with status code 422, with default header values.

Unprocessable Entity, likely a bad parameter
*/
type GetCertificatesUnprocessableEntity struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this get certificates unprocessable entity response has a 2xx status code
func (o *GetCertificatesUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get certificates unprocessable entity response has a 3xx status code
func (o *GetCertificatesUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get certificates unprocessable entity response has a 4xx status code
func (o *GetCertificatesUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this get certificates unprocessable entity response has a 5xx status code
func (o *GetCertificatesUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this get certificates unprocessable entity response a status code equal to that given
func (o *GetCertificatesUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the get certificates unprocessable entity response
func (o *GetCertificatesUnprocessableEntity) Code() int {
	return 422
}

func (o *GetCertificatesUnprocessableEntity) Error() string {
	return fmt.Sprintf("[GET /certificates][%d] getCertificatesUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetCertificatesUnprocessableEntity) String() string {
	return fmt.Sprintf("[GET /certificates][%d] getCertificatesUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetCertificatesUnprocessableEntity) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewGetCertificatesInternalServerError creates a GetCertificatesInternalServerError with default headers values
func NewGetCertificatesInternalServerError() *GetCertificatesInternalServerError {
	return &GetCertificatesInternalServerError{}
}

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

Server Internal Error
*/
type GetCertificatesInternalServerError struct {
	Payload *members_models.Error
}

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

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

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

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

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

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

func (o *GetCertificatesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /certificates][%d] getCertificatesInternalServerError  %+v", 500, o.Payload)
}

func (o *GetCertificatesInternalServerError) String() string {
	return fmt.Sprintf("[GET /certificates][%d] getCertificatesInternalServerError  %+v", 500, o.Payload)
}

func (o *GetCertificatesInternalServerError) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}
