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

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

// PostWebhooksClerkReader is a Reader for the PostWebhooksClerk structure.
type PostWebhooksClerkReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostWebhooksClerkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 201:
		result := NewPostWebhooksClerkCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPostWebhooksClerkUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostWebhooksClerkForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPostWebhooksClerkNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPostWebhooksClerkUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostWebhooksClerkInternalServerError()
		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())
	}
}

// NewPostWebhooksClerkCreated creates a PostWebhooksClerkCreated with default headers values
func NewPostWebhooksClerkCreated() *PostWebhooksClerkCreated {
	return &PostWebhooksClerkCreated{}
}

/*
PostWebhooksClerkCreated describes a response with status code 201, with default header values.

WebhookClerk Response Object
*/
type PostWebhooksClerkCreated struct {
	Payload *members_models.WebhookClerkResponse
}

// IsSuccess returns true when this post webhooks clerk created response has a 2xx status code
func (o *PostWebhooksClerkCreated) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this post webhooks clerk created response has a 3xx status code
func (o *PostWebhooksClerkCreated) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post webhooks clerk created response has a 4xx status code
func (o *PostWebhooksClerkCreated) IsClientError() bool {
	return false
}

// IsServerError returns true when this post webhooks clerk created response has a 5xx status code
func (o *PostWebhooksClerkCreated) IsServerError() bool {
	return false
}

// IsCode returns true when this post webhooks clerk created response a status code equal to that given
func (o *PostWebhooksClerkCreated) IsCode(code int) bool {
	return code == 201
}

// Code gets the status code for the post webhooks clerk created response
func (o *PostWebhooksClerkCreated) Code() int {
	return 201
}

func (o *PostWebhooksClerkCreated) Error() string {
	return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkCreated  %+v", 201, o.Payload)
}

func (o *PostWebhooksClerkCreated) String() string {
	return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkCreated  %+v", 201, o.Payload)
}

func (o *PostWebhooksClerkCreated) GetPayload() *members_models.WebhookClerkResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.WebhookClerkResponse)

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

	return nil
}

// NewPostWebhooksClerkUnauthorized creates a PostWebhooksClerkUnauthorized with default headers values
func NewPostWebhooksClerkUnauthorized() *PostWebhooksClerkUnauthorized {
	return &PostWebhooksClerkUnauthorized{}
}

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

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

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

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

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

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

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

// Code gets the status code for the post webhooks clerk unauthorized response
func (o *PostWebhooksClerkUnauthorized) Code() int {
	return 401
}

func (o *PostWebhooksClerkUnauthorized) Error() string {
	return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkUnauthorized  %+v", 401, o.Payload)
}

func (o *PostWebhooksClerkUnauthorized) String() string {
	return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPostWebhooksClerkForbidden creates a PostWebhooksClerkForbidden with default headers values
func NewPostWebhooksClerkForbidden() *PostWebhooksClerkForbidden {
	return &PostWebhooksClerkForbidden{}
}

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

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

	Payload *members_models.Error
}

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

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

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

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

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

// Code gets the status code for the post webhooks clerk forbidden response
func (o *PostWebhooksClerkForbidden) Code() int {
	return 403
}

func (o *PostWebhooksClerkForbidden) Error() string {
	return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkForbidden  %+v", 403, o.Payload)
}

func (o *PostWebhooksClerkForbidden) String() string {
	return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkForbidden  %+v", 403, o.Payload)
}

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

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

// NewPostWebhooksClerkNotFound creates a PostWebhooksClerkNotFound with default headers values
func NewPostWebhooksClerkNotFound() *PostWebhooksClerkNotFound {
	return &PostWebhooksClerkNotFound{}
}

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

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

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

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

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

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

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

// Code gets the status code for the post webhooks clerk not found response
func (o *PostWebhooksClerkNotFound) Code() int {
	return 404
}

func (o *PostWebhooksClerkNotFound) Error() string {
	return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkNotFound  %+v", 404, o.Payload)
}

func (o *PostWebhooksClerkNotFound) String() string {
	return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkNotFound  %+v", 404, o.Payload)
}

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

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

// NewPostWebhooksClerkUnprocessableEntity creates a PostWebhooksClerkUnprocessableEntity with default headers values
func NewPostWebhooksClerkUnprocessableEntity() *PostWebhooksClerkUnprocessableEntity {
	return &PostWebhooksClerkUnprocessableEntity{}
}

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

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

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

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

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

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

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

// Code gets the status code for the post webhooks clerk unprocessable entity response
func (o *PostWebhooksClerkUnprocessableEntity) Code() int {
	return 422
}

func (o *PostWebhooksClerkUnprocessableEntity) Error() string {
	return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PostWebhooksClerkUnprocessableEntity) String() string {
	return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkUnprocessableEntity  %+v", 422, o.Payload)
}

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

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

// NewPostWebhooksClerkInternalServerError creates a PostWebhooksClerkInternalServerError with default headers values
func NewPostWebhooksClerkInternalServerError() *PostWebhooksClerkInternalServerError {
	return &PostWebhooksClerkInternalServerError{}
}

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

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

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

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

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

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

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

// Code gets the status code for the post webhooks clerk internal server error response
func (o *PostWebhooksClerkInternalServerError) Code() int {
	return 500
}

func (o *PostWebhooksClerkInternalServerError) Error() string {
	return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkInternalServerError  %+v", 500, o.Payload)
}

func (o *PostWebhooksClerkInternalServerError) String() string {
	return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkInternalServerError  %+v", 500, o.Payload)
}

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

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