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

package workspaces

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

// V1WorkspacesGetReader is a Reader for the V1WorkspacesGet structure.
type V1WorkspacesGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *V1WorkspacesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewV1WorkspacesGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewV1WorkspacesGetBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewV1WorkspacesGetUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewV1WorkspacesGetForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewV1WorkspacesGetNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 429:
		result := NewV1WorkspacesGetTooManyRequests()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewV1WorkspacesGetInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /v1/workspaces/{workspace_id}] v1.workspaces.get", response, response.Code())
	}
}

// NewV1WorkspacesGetOK creates a V1WorkspacesGetOK with default headers values
func NewV1WorkspacesGetOK() *V1WorkspacesGetOK {
	return &V1WorkspacesGetOK{}
}

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

OK
*/
type V1WorkspacesGetOK struct {
	Payload *models.Workspace
}

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

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

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

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

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

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

func (o *V1WorkspacesGetOK) Error() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetOK  %+v", 200, o.Payload)
}

func (o *V1WorkspacesGetOK) String() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetOK  %+v", 200, o.Payload)
}

func (o *V1WorkspacesGetOK) GetPayload() *models.Workspace {
	return o.Payload
}

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

	o.Payload = new(models.Workspace)

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

	return nil
}

// NewV1WorkspacesGetBadRequest creates a V1WorkspacesGetBadRequest with default headers values
func NewV1WorkspacesGetBadRequest() *V1WorkspacesGetBadRequest {
	return &V1WorkspacesGetBadRequest{}
}

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

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

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

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

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

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

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

// Code gets the status code for the v1 workspaces get bad request response
func (o *V1WorkspacesGetBadRequest) Code() int {
	return 400
}

func (o *V1WorkspacesGetBadRequest) Error() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetBadRequest  %+v", 400, o.Payload)
}

func (o *V1WorkspacesGetBadRequest) String() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetBadRequest  %+v", 400, o.Payload)
}

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

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

// NewV1WorkspacesGetUnauthorized creates a V1WorkspacesGetUnauthorized with default headers values
func NewV1WorkspacesGetUnauthorized() *V1WorkspacesGetUnauthorized {
	return &V1WorkspacesGetUnauthorized{}
}

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

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

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

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

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

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

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

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

func (o *V1WorkspacesGetUnauthorized) Error() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetUnauthorized  %+v", 401, o.Payload)
}

func (o *V1WorkspacesGetUnauthorized) String() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewV1WorkspacesGetForbidden creates a V1WorkspacesGetForbidden with default headers values
func NewV1WorkspacesGetForbidden() *V1WorkspacesGetForbidden {
	return &V1WorkspacesGetForbidden{}
}

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

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

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

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

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

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

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

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

func (o *V1WorkspacesGetForbidden) Error() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetForbidden  %+v", 403, o.Payload)
}

func (o *V1WorkspacesGetForbidden) String() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetForbidden  %+v", 403, o.Payload)
}

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

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

// NewV1WorkspacesGetNotFound creates a V1WorkspacesGetNotFound with default headers values
func NewV1WorkspacesGetNotFound() *V1WorkspacesGetNotFound {
	return &V1WorkspacesGetNotFound{}
}

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

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

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

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

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

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

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

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

func (o *V1WorkspacesGetNotFound) Error() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetNotFound  %+v", 404, o.Payload)
}

func (o *V1WorkspacesGetNotFound) String() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetNotFound  %+v", 404, o.Payload)
}

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

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

// NewV1WorkspacesGetTooManyRequests creates a V1WorkspacesGetTooManyRequests with default headers values
func NewV1WorkspacesGetTooManyRequests() *V1WorkspacesGetTooManyRequests {
	return &V1WorkspacesGetTooManyRequests{}
}

/*
V1WorkspacesGetTooManyRequests describes a response with status code 429, with default header values.

Too Many Requests
*/
type V1WorkspacesGetTooManyRequests struct {
	Payload *models.Error
}

// IsSuccess returns true when this v1 workspaces get too many requests response has a 2xx status code
func (o *V1WorkspacesGetTooManyRequests) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v1 workspaces get too many requests response has a 3xx status code
func (o *V1WorkspacesGetTooManyRequests) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v1 workspaces get too many requests response has a 4xx status code
func (o *V1WorkspacesGetTooManyRequests) IsClientError() bool {
	return true
}

// IsServerError returns true when this v1 workspaces get too many requests response has a 5xx status code
func (o *V1WorkspacesGetTooManyRequests) IsServerError() bool {
	return false
}

// IsCode returns true when this v1 workspaces get too many requests response a status code equal to that given
func (o *V1WorkspacesGetTooManyRequests) IsCode(code int) bool {
	return code == 429
}

// Code gets the status code for the v1 workspaces get too many requests response
func (o *V1WorkspacesGetTooManyRequests) Code() int {
	return 429
}

func (o *V1WorkspacesGetTooManyRequests) Error() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetTooManyRequests  %+v", 429, o.Payload)
}

func (o *V1WorkspacesGetTooManyRequests) String() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetTooManyRequests  %+v", 429, o.Payload)
}

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

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

// NewV1WorkspacesGetInternalServerError creates a V1WorkspacesGetInternalServerError with default headers values
func NewV1WorkspacesGetInternalServerError() *V1WorkspacesGetInternalServerError {
	return &V1WorkspacesGetInternalServerError{}
}

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

Internal Server Error
*/
type V1WorkspacesGetInternalServerError struct {
	Payload *models.Error
}

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

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

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

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

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

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

func (o *V1WorkspacesGetInternalServerError) Error() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetInternalServerError  %+v", 500, o.Payload)
}

func (o *V1WorkspacesGetInternalServerError) String() string {
	return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetInternalServerError  %+v", 500, o.Payload)
}

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

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