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

package internal_transit_gateway

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

// InternalV1TransitgatewayGetReader is a Reader for the InternalV1TransitgatewayGet structure.
type InternalV1TransitgatewayGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *InternalV1TransitgatewayGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewInternalV1TransitgatewayGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewInternalV1TransitgatewayGetForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /internal/v1/transit-gateway/{powervs_service_crn}] internal.v1.transitgateway.get", response, response.Code())
	}
}

// NewInternalV1TransitgatewayGetOK creates a InternalV1TransitgatewayGetOK with default headers values
func NewInternalV1TransitgatewayGetOK() *InternalV1TransitgatewayGetOK {
	return &InternalV1TransitgatewayGetOK{}
}

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

OK
*/
type InternalV1TransitgatewayGetOK struct {
	Payload *models.TransitGatewayInstance
}

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

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

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

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

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

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

func (o *InternalV1TransitgatewayGetOK) Error() string {
	return fmt.Sprintf("[GET /internal/v1/transit-gateway/{powervs_service_crn}][%d] internalV1TransitgatewayGetOK  %+v", 200, o.Payload)
}

func (o *InternalV1TransitgatewayGetOK) String() string {
	return fmt.Sprintf("[GET /internal/v1/transit-gateway/{powervs_service_crn}][%d] internalV1TransitgatewayGetOK  %+v", 200, o.Payload)
}

func (o *InternalV1TransitgatewayGetOK) GetPayload() *models.TransitGatewayInstance {
	return o.Payload
}

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

	o.Payload = new(models.TransitGatewayInstance)

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

	return nil
}

// NewInternalV1TransitgatewayGetForbidden creates a InternalV1TransitgatewayGetForbidden with default headers values
func NewInternalV1TransitgatewayGetForbidden() *InternalV1TransitgatewayGetForbidden {
	return &InternalV1TransitgatewayGetForbidden{}
}

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

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

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

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

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

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

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

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

func (o *InternalV1TransitgatewayGetForbidden) Error() string {
	return fmt.Sprintf("[GET /internal/v1/transit-gateway/{powervs_service_crn}][%d] internalV1TransitgatewayGetForbidden  %+v", 403, o.Payload)
}

func (o *InternalV1TransitgatewayGetForbidden) String() string {
	return fmt.Sprintf("[GET /internal/v1/transit-gateway/{powervs_service_crn}][%d] internalV1TransitgatewayGetForbidden  %+v", 403, o.Payload)
}

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

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