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

// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package portal_memberships

import (
	"encoding/json"
	stderrors "errors"
	"fmt"
	"io"

	"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// DeleteTenantMembershipReader is a Reader for the DeleteTenantMembership structure.
type DeleteTenantMembershipReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteTenantMembershipReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteTenantMembershipOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewDeleteTenantMembershipUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeleteTenantMembershipNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewDeleteTenantMembershipConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeleteTenantMembershipInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /tenantmemberships/{membershipId}] deleteTenantMembership", response, response.Code())
	}
}

// NewDeleteTenantMembershipOK creates a DeleteTenantMembershipOK with default headers values
func NewDeleteTenantMembershipOK() *DeleteTenantMembershipOK {
	return &DeleteTenantMembershipOK{}
}

// DeleteTenantMembershipOK describes a response with status code 200, with default header values.
//
// Revoked membership
type DeleteTenantMembershipOK struct {
	Payload *members_models.TenantMembershipResponse
}

// IsSuccess returns true when this delete tenant membership o k response has a 2xx status code
func (o *DeleteTenantMembershipOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this delete tenant membership o k response has a 3xx status code
func (o *DeleteTenantMembershipOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete tenant membership o k response has a 4xx status code
func (o *DeleteTenantMembershipOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete tenant membership o k response has a 5xx status code
func (o *DeleteTenantMembershipOK) IsServerError() bool {
	return false
}

// IsCode returns true when this delete tenant membership o k response a status code equal to that given
func (o *DeleteTenantMembershipOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the delete tenant membership o k response
func (o *DeleteTenantMembershipOK) Code() int {
	return 200
}

func (o *DeleteTenantMembershipOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /tenantmemberships/{membershipId}][%d] deleteTenantMembershipOK %s", 200, payload)
}

func (o *DeleteTenantMembershipOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /tenantmemberships/{membershipId}][%d] deleteTenantMembershipOK %s", 200, payload)
}

func (o *DeleteTenantMembershipOK) GetPayload() *members_models.TenantMembershipResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.TenantMembershipResponse)

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

	return nil
}

// NewDeleteTenantMembershipUnauthorized creates a DeleteTenantMembershipUnauthorized with default headers values
func NewDeleteTenantMembershipUnauthorized() *DeleteTenantMembershipUnauthorized {
	return &DeleteTenantMembershipUnauthorized{}
}

// DeleteTenantMembershipUnauthorized describes a response with status code 401, with default header values.
//
// Missing or invalid server or session credential
type DeleteTenantMembershipUnauthorized struct {
}

// IsSuccess returns true when this delete tenant membership unauthorized response has a 2xx status code
func (o *DeleteTenantMembershipUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete tenant membership unauthorized response has a 3xx status code
func (o *DeleteTenantMembershipUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete tenant membership unauthorized response has a 4xx status code
func (o *DeleteTenantMembershipUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete tenant membership unauthorized response has a 5xx status code
func (o *DeleteTenantMembershipUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this delete tenant membership unauthorized response a status code equal to that given
func (o *DeleteTenantMembershipUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the delete tenant membership unauthorized response
func (o *DeleteTenantMembershipUnauthorized) Code() int {
	return 401
}

func (o *DeleteTenantMembershipUnauthorized) Error() string {
	return fmt.Sprintf("[DELETE /tenantmemberships/{membershipId}][%d] deleteTenantMembershipUnauthorized", 401)
}

func (o *DeleteTenantMembershipUnauthorized) String() string {
	return fmt.Sprintf("[DELETE /tenantmemberships/{membershipId}][%d] deleteTenantMembershipUnauthorized", 401)
}

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

	return nil
}

// NewDeleteTenantMembershipNotFound creates a DeleteTenantMembershipNotFound with default headers values
func NewDeleteTenantMembershipNotFound() *DeleteTenantMembershipNotFound {
	return &DeleteTenantMembershipNotFound{}
}

// DeleteTenantMembershipNotFound describes a response with status code 404, with default header values.
//
// Membership is absent, foreign, or unauthorized
type DeleteTenantMembershipNotFound struct {
}

// IsSuccess returns true when this delete tenant membership not found response has a 2xx status code
func (o *DeleteTenantMembershipNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete tenant membership not found response has a 3xx status code
func (o *DeleteTenantMembershipNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete tenant membership not found response has a 4xx status code
func (o *DeleteTenantMembershipNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete tenant membership not found response has a 5xx status code
func (o *DeleteTenantMembershipNotFound) IsServerError() bool {
	return false
}

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

// Code gets the status code for the delete tenant membership not found response
func (o *DeleteTenantMembershipNotFound) Code() int {
	return 404
}

func (o *DeleteTenantMembershipNotFound) Error() string {
	return fmt.Sprintf("[DELETE /tenantmemberships/{membershipId}][%d] deleteTenantMembershipNotFound", 404)
}

func (o *DeleteTenantMembershipNotFound) String() string {
	return fmt.Sprintf("[DELETE /tenantmemberships/{membershipId}][%d] deleteTenantMembershipNotFound", 404)
}

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

	return nil
}

// NewDeleteTenantMembershipConflict creates a DeleteTenantMembershipConflict with default headers values
func NewDeleteTenantMembershipConflict() *DeleteTenantMembershipConflict {
	return &DeleteTenantMembershipConflict{}
}

// DeleteTenantMembershipConflict describes a response with status code 409, with default header values.
//
// Optimistic, self-change, owner, or state conflict
type DeleteTenantMembershipConflict struct {
}

// IsSuccess returns true when this delete tenant membership conflict response has a 2xx status code
func (o *DeleteTenantMembershipConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete tenant membership conflict response has a 3xx status code
func (o *DeleteTenantMembershipConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete tenant membership conflict response has a 4xx status code
func (o *DeleteTenantMembershipConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete tenant membership conflict response has a 5xx status code
func (o *DeleteTenantMembershipConflict) IsServerError() bool {
	return false
}

// IsCode returns true when this delete tenant membership conflict response a status code equal to that given
func (o *DeleteTenantMembershipConflict) IsCode(code int) bool {
	return code == 409
}

// Code gets the status code for the delete tenant membership conflict response
func (o *DeleteTenantMembershipConflict) Code() int {
	return 409
}

func (o *DeleteTenantMembershipConflict) Error() string {
	return fmt.Sprintf("[DELETE /tenantmemberships/{membershipId}][%d] deleteTenantMembershipConflict", 409)
}

func (o *DeleteTenantMembershipConflict) String() string {
	return fmt.Sprintf("[DELETE /tenantmemberships/{membershipId}][%d] deleteTenantMembershipConflict", 409)
}

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

	return nil
}

// NewDeleteTenantMembershipInternalServerError creates a DeleteTenantMembershipInternalServerError with default headers values
func NewDeleteTenantMembershipInternalServerError() *DeleteTenantMembershipInternalServerError {
	return &DeleteTenantMembershipInternalServerError{}
}

// DeleteTenantMembershipInternalServerError describes a response with status code 500, with default header values.
//
// Server error
type DeleteTenantMembershipInternalServerError struct {
}

// IsSuccess returns true when this delete tenant membership internal server error response has a 2xx status code
func (o *DeleteTenantMembershipInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete tenant membership internal server error response has a 3xx status code
func (o *DeleteTenantMembershipInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete tenant membership internal server error response has a 4xx status code
func (o *DeleteTenantMembershipInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete tenant membership internal server error response has a 5xx status code
func (o *DeleteTenantMembershipInternalServerError) IsServerError() bool {
	return true
}

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

// Code gets the status code for the delete tenant membership internal server error response
func (o *DeleteTenantMembershipInternalServerError) Code() int {
	return 500
}

func (o *DeleteTenantMembershipInternalServerError) Error() string {
	return fmt.Sprintf("[DELETE /tenantmemberships/{membershipId}][%d] deleteTenantMembershipInternalServerError", 500)
}

func (o *DeleteTenantMembershipInternalServerError) String() string {
	return fmt.Sprintf("[DELETE /tenantmemberships/{membershipId}][%d] deleteTenantMembershipInternalServerError", 500)
}

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

	return nil
}
