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

// PostIssuedCertificatesReader is a Reader for the PostIssuedCertificates structure.
type PostIssuedCertificatesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostIssuedCertificatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostIssuedCertificatesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPostIssuedCertificatesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostIssuedCertificatesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPostIssuedCertificatesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPostIssuedCertificatesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostIssuedCertificatesInternalServerError()
		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())
	}
}

// NewPostIssuedCertificatesOK creates a PostIssuedCertificatesOK with default headers values
func NewPostIssuedCertificatesOK() *PostIssuedCertificatesOK {
	return &PostIssuedCertificatesOK{}
}

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

IssuedCertificate Response Object
*/
type PostIssuedCertificatesOK struct {
	Payload *members_models.IssuedCertificateResponse
}

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

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

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

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

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

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

func (o *PostIssuedCertificatesOK) Error() string {
	return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificatesOK  %+v", 200, o.Payload)
}

func (o *PostIssuedCertificatesOK) String() string {
	return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificatesOK  %+v", 200, o.Payload)
}

func (o *PostIssuedCertificatesOK) GetPayload() *members_models.IssuedCertificateResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.IssuedCertificateResponse)

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

	return nil
}

// NewPostIssuedCertificatesUnauthorized creates a PostIssuedCertificatesUnauthorized with default headers values
func NewPostIssuedCertificatesUnauthorized() *PostIssuedCertificatesUnauthorized {
	return &PostIssuedCertificatesUnauthorized{}
}

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

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

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

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

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

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

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

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

func (o *PostIssuedCertificatesUnauthorized) Error() string {
	return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificatesUnauthorized  %+v", 401, o.Payload)
}

func (o *PostIssuedCertificatesUnauthorized) String() string {
	return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificatesUnauthorized  %+v", 401, o.Payload)
}

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

func (o *PostIssuedCertificatesUnauthorized) 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
}

// NewPostIssuedCertificatesForbidden creates a PostIssuedCertificatesForbidden with default headers values
func NewPostIssuedCertificatesForbidden() *PostIssuedCertificatesForbidden {
	return &PostIssuedCertificatesForbidden{}
}

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

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

	Payload *members_models.Error
}

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

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

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

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

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

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

func (o *PostIssuedCertificatesForbidden) Error() string {
	return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificatesForbidden  %+v", 403, o.Payload)
}

func (o *PostIssuedCertificatesForbidden) String() string {
	return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificatesForbidden  %+v", 403, o.Payload)
}

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

func (o *PostIssuedCertificatesForbidden) 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
}

// NewPostIssuedCertificatesNotFound creates a PostIssuedCertificatesNotFound with default headers values
func NewPostIssuedCertificatesNotFound() *PostIssuedCertificatesNotFound {
	return &PostIssuedCertificatesNotFound{}
}

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

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

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

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

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

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

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

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

func (o *PostIssuedCertificatesNotFound) Error() string {
	return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificatesNotFound  %+v", 404, o.Payload)
}

func (o *PostIssuedCertificatesNotFound) String() string {
	return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificatesNotFound  %+v", 404, o.Payload)
}

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

func (o *PostIssuedCertificatesNotFound) 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
}

// NewPostIssuedCertificatesUnprocessableEntity creates a PostIssuedCertificatesUnprocessableEntity with default headers values
func NewPostIssuedCertificatesUnprocessableEntity() *PostIssuedCertificatesUnprocessableEntity {
	return &PostIssuedCertificatesUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

func (o *PostIssuedCertificatesUnprocessableEntity) Error() string {
	return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificatesUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PostIssuedCertificatesUnprocessableEntity) String() string {
	return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificatesUnprocessableEntity  %+v", 422, o.Payload)
}

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

func (o *PostIssuedCertificatesUnprocessableEntity) 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
}

// NewPostIssuedCertificatesInternalServerError creates a PostIssuedCertificatesInternalServerError with default headers values
func NewPostIssuedCertificatesInternalServerError() *PostIssuedCertificatesInternalServerError {
	return &PostIssuedCertificatesInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *PostIssuedCertificatesInternalServerError) Error() string {
	return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificatesInternalServerError  %+v", 500, o.Payload)
}

func (o *PostIssuedCertificatesInternalServerError) String() string {
	return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificatesInternalServerError  %+v", 500, o.Payload)
}

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

func (o *PostIssuedCertificatesInternalServerError) 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
}
