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

package service_bindings

// 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/IBM-Cloud/power-go-client/power/models"
)

// ServiceBindingGetReader is a Reader for the ServiceBindingGet structure.
type ServiceBindingGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ServiceBindingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewServiceBindingGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewServiceBindingGetBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewServiceBindingGetUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewServiceBindingGetForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewServiceBindingGetNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}] serviceBinding.get", response, response.Code())
	}
}

// NewServiceBindingGetOK creates a ServiceBindingGetOK with default headers values
func NewServiceBindingGetOK() *ServiceBindingGetOK {
	return &ServiceBindingGetOK{}
}

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

OK
*/
type ServiceBindingGetOK struct {
	Payload *models.ServiceBindingResource
}

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

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

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

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

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

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

func (o *ServiceBindingGetOK) Error() string {
	return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetOK  %+v", 200, o.Payload)
}

func (o *ServiceBindingGetOK) String() string {
	return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetOK  %+v", 200, o.Payload)
}

func (o *ServiceBindingGetOK) GetPayload() *models.ServiceBindingResource {
	return o.Payload
}

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

	o.Payload = new(models.ServiceBindingResource)

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

	return nil
}

// NewServiceBindingGetBadRequest creates a ServiceBindingGetBadRequest with default headers values
func NewServiceBindingGetBadRequest() *ServiceBindingGetBadRequest {
	return &ServiceBindingGetBadRequest{}
}

/*
ServiceBindingGetBadRequest describes a response with status code 400, with default header values.

Bad Request
*/
type ServiceBindingGetBadRequest struct {
	Payload *models.Error
}

// IsSuccess returns true when this service binding get bad request response has a 2xx status code
func (o *ServiceBindingGetBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this service binding get bad request response has a 3xx status code
func (o *ServiceBindingGetBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this service binding get bad request response has a 4xx status code
func (o *ServiceBindingGetBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this service binding get bad request response has a 5xx status code
func (o *ServiceBindingGetBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this service binding get bad request response a status code equal to that given
func (o *ServiceBindingGetBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the service binding get bad request response
func (o *ServiceBindingGetBadRequest) Code() int {
	return 400
}

func (o *ServiceBindingGetBadRequest) Error() string {
	return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetBadRequest  %+v", 400, o.Payload)
}

func (o *ServiceBindingGetBadRequest) String() string {
	return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetBadRequest  %+v", 400, o.Payload)
}

func (o *ServiceBindingGetBadRequest) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}

// NewServiceBindingGetUnauthorized creates a ServiceBindingGetUnauthorized with default headers values
func NewServiceBindingGetUnauthorized() *ServiceBindingGetUnauthorized {
	return &ServiceBindingGetUnauthorized{}
}

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

Unauthorized
*/
type ServiceBindingGetUnauthorized struct {
	Payload *models.Error
}

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

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

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

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

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

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

func (o *ServiceBindingGetUnauthorized) Error() string {
	return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetUnauthorized  %+v", 401, o.Payload)
}

func (o *ServiceBindingGetUnauthorized) String() string {
	return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetUnauthorized  %+v", 401, o.Payload)
}

func (o *ServiceBindingGetUnauthorized) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}

// NewServiceBindingGetForbidden creates a ServiceBindingGetForbidden with default headers values
func NewServiceBindingGetForbidden() *ServiceBindingGetForbidden {
	return &ServiceBindingGetForbidden{}
}

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

Forbidden
*/
type ServiceBindingGetForbidden struct {
	Payload *models.Error
}

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

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

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

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

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

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

func (o *ServiceBindingGetForbidden) Error() string {
	return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetForbidden  %+v", 403, o.Payload)
}

func (o *ServiceBindingGetForbidden) String() string {
	return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetForbidden  %+v", 403, o.Payload)
}

func (o *ServiceBindingGetForbidden) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}

// NewServiceBindingGetNotFound creates a ServiceBindingGetNotFound with default headers values
func NewServiceBindingGetNotFound() *ServiceBindingGetNotFound {
	return &ServiceBindingGetNotFound{}
}

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

Not Found
*/
type ServiceBindingGetNotFound struct {
	Payload *models.Error
}

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

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

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

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

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

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

func (o *ServiceBindingGetNotFound) Error() string {
	return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetNotFound  %+v", 404, o.Payload)
}

func (o *ServiceBindingGetNotFound) String() string {
	return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetNotFound  %+v", 404, o.Payload)
}

func (o *ServiceBindingGetNotFound) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}
