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

package p_cloud_tenants_ssh_keys

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

// PcloudTenantsSshkeysGetReader is a Reader for the PcloudTenantsSshkeysGet structure.
type PcloudTenantsSshkeysGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudTenantsSshkeysGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudTenantsSshkeysGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudTenantsSshkeysGetBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudTenantsSshkeysGetUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudTenantsSshkeysGetForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudTenantsSshkeysGetNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudTenantsSshkeysGetInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}] pcloud.tenants.sshkeys.get", response, response.Code())
	}
}

// NewPcloudTenantsSshkeysGetOK creates a PcloudTenantsSshkeysGetOK with default headers values
func NewPcloudTenantsSshkeysGetOK() *PcloudTenantsSshkeysGetOK {
	return &PcloudTenantsSshkeysGetOK{}
}

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

OK
*/
type PcloudTenantsSshkeysGetOK struct {
	Payload *models.SSHKey
}

// IsSuccess returns true when this pcloud tenants sshkeys get o k response has a 2xx status code
func (o *PcloudTenantsSshkeysGetOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this pcloud tenants sshkeys get o k response has a 3xx status code
func (o *PcloudTenantsSshkeysGetOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud tenants sshkeys get o k response has a 4xx status code
func (o *PcloudTenantsSshkeysGetOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this pcloud tenants sshkeys get o k response has a 5xx status code
func (o *PcloudTenantsSshkeysGetOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the pcloud tenants sshkeys get o k response
func (o *PcloudTenantsSshkeysGetOK) Code() int {
	return 200
}

func (o *PcloudTenantsSshkeysGetOK) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetOK  %+v", 200, o.Payload)
}

func (o *PcloudTenantsSshkeysGetOK) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetOK  %+v", 200, o.Payload)
}

func (o *PcloudTenantsSshkeysGetOK) GetPayload() *models.SSHKey {
	return o.Payload
}

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

	o.Payload = new(models.SSHKey)

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

	return nil
}

// NewPcloudTenantsSshkeysGetBadRequest creates a PcloudTenantsSshkeysGetBadRequest with default headers values
func NewPcloudTenantsSshkeysGetBadRequest() *PcloudTenantsSshkeysGetBadRequest {
	return &PcloudTenantsSshkeysGetBadRequest{}
}

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

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

// IsSuccess returns true when this pcloud tenants sshkeys get bad request response has a 2xx status code
func (o *PcloudTenantsSshkeysGetBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud tenants sshkeys get bad request response has a 3xx status code
func (o *PcloudTenantsSshkeysGetBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud tenants sshkeys get bad request response has a 4xx status code
func (o *PcloudTenantsSshkeysGetBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud tenants sshkeys get bad request response has a 5xx status code
func (o *PcloudTenantsSshkeysGetBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the pcloud tenants sshkeys get bad request response
func (o *PcloudTenantsSshkeysGetBadRequest) Code() int {
	return 400
}

func (o *PcloudTenantsSshkeysGetBadRequest) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudTenantsSshkeysGetBadRequest) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetBadRequest  %+v", 400, o.Payload)
}

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

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

// NewPcloudTenantsSshkeysGetUnauthorized creates a PcloudTenantsSshkeysGetUnauthorized with default headers values
func NewPcloudTenantsSshkeysGetUnauthorized() *PcloudTenantsSshkeysGetUnauthorized {
	return &PcloudTenantsSshkeysGetUnauthorized{}
}

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

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

// IsSuccess returns true when this pcloud tenants sshkeys get unauthorized response has a 2xx status code
func (o *PcloudTenantsSshkeysGetUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud tenants sshkeys get unauthorized response has a 3xx status code
func (o *PcloudTenantsSshkeysGetUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud tenants sshkeys get unauthorized response has a 4xx status code
func (o *PcloudTenantsSshkeysGetUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud tenants sshkeys get unauthorized response has a 5xx status code
func (o *PcloudTenantsSshkeysGetUnauthorized) IsServerError() bool {
	return false
}

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

// Code gets the status code for the pcloud tenants sshkeys get unauthorized response
func (o *PcloudTenantsSshkeysGetUnauthorized) Code() int {
	return 401
}

func (o *PcloudTenantsSshkeysGetUnauthorized) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudTenantsSshkeysGetUnauthorized) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPcloudTenantsSshkeysGetForbidden creates a PcloudTenantsSshkeysGetForbidden with default headers values
func NewPcloudTenantsSshkeysGetForbidden() *PcloudTenantsSshkeysGetForbidden {
	return &PcloudTenantsSshkeysGetForbidden{}
}

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

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

// IsSuccess returns true when this pcloud tenants sshkeys get forbidden response has a 2xx status code
func (o *PcloudTenantsSshkeysGetForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud tenants sshkeys get forbidden response has a 3xx status code
func (o *PcloudTenantsSshkeysGetForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud tenants sshkeys get forbidden response has a 4xx status code
func (o *PcloudTenantsSshkeysGetForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud tenants sshkeys get forbidden response has a 5xx status code
func (o *PcloudTenantsSshkeysGetForbidden) IsServerError() bool {
	return false
}

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

// Code gets the status code for the pcloud tenants sshkeys get forbidden response
func (o *PcloudTenantsSshkeysGetForbidden) Code() int {
	return 403
}

func (o *PcloudTenantsSshkeysGetForbidden) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetForbidden  %+v", 403, o.Payload)
}

func (o *PcloudTenantsSshkeysGetForbidden) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetForbidden  %+v", 403, o.Payload)
}

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

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

// NewPcloudTenantsSshkeysGetNotFound creates a PcloudTenantsSshkeysGetNotFound with default headers values
func NewPcloudTenantsSshkeysGetNotFound() *PcloudTenantsSshkeysGetNotFound {
	return &PcloudTenantsSshkeysGetNotFound{}
}

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

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

// IsSuccess returns true when this pcloud tenants sshkeys get not found response has a 2xx status code
func (o *PcloudTenantsSshkeysGetNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud tenants sshkeys get not found response has a 3xx status code
func (o *PcloudTenantsSshkeysGetNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud tenants sshkeys get not found response has a 4xx status code
func (o *PcloudTenantsSshkeysGetNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud tenants sshkeys get not found response has a 5xx status code
func (o *PcloudTenantsSshkeysGetNotFound) IsServerError() bool {
	return false
}

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

// Code gets the status code for the pcloud tenants sshkeys get not found response
func (o *PcloudTenantsSshkeysGetNotFound) Code() int {
	return 404
}

func (o *PcloudTenantsSshkeysGetNotFound) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetNotFound  %+v", 404, o.Payload)
}

func (o *PcloudTenantsSshkeysGetNotFound) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetNotFound  %+v", 404, o.Payload)
}

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

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

// NewPcloudTenantsSshkeysGetInternalServerError creates a PcloudTenantsSshkeysGetInternalServerError with default headers values
func NewPcloudTenantsSshkeysGetInternalServerError() *PcloudTenantsSshkeysGetInternalServerError {
	return &PcloudTenantsSshkeysGetInternalServerError{}
}

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

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

// IsSuccess returns true when this pcloud tenants sshkeys get internal server error response has a 2xx status code
func (o *PcloudTenantsSshkeysGetInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud tenants sshkeys get internal server error response has a 3xx status code
func (o *PcloudTenantsSshkeysGetInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud tenants sshkeys get internal server error response has a 4xx status code
func (o *PcloudTenantsSshkeysGetInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this pcloud tenants sshkeys get internal server error response has a 5xx status code
func (o *PcloudTenantsSshkeysGetInternalServerError) IsServerError() bool {
	return true
}

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

// Code gets the status code for the pcloud tenants sshkeys get internal server error response
func (o *PcloudTenantsSshkeysGetInternalServerError) Code() int {
	return 500
}

func (o *PcloudTenantsSshkeysGetInternalServerError) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudTenantsSshkeysGetInternalServerError) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetInternalServerError  %+v", 500, o.Payload)
}

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

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