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

package application_service

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

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

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"git.huangwc.com/pig/pig-farm-controller/internal/infra/transport/lora/chirp_stack_proto/models"
)

// ApplicationServiceGetThingsBoardIntegrationReader is a Reader for the ApplicationServiceGetThingsBoardIntegration structure.
type ApplicationServiceGetThingsBoardIntegrationReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ApplicationServiceGetThingsBoardIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewApplicationServiceGetThingsBoardIntegrationOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	default:
		result := NewApplicationServiceGetThingsBoardIntegrationDefault(response.Code())
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		if response.Code()/100 == 2 {
			return result, nil
		}
		return nil, result
	}
}

// NewApplicationServiceGetThingsBoardIntegrationOK creates a ApplicationServiceGetThingsBoardIntegrationOK with default headers values
func NewApplicationServiceGetThingsBoardIntegrationOK() *ApplicationServiceGetThingsBoardIntegrationOK {
	return &ApplicationServiceGetThingsBoardIntegrationOK{}
}

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

A successful response.
*/
type ApplicationServiceGetThingsBoardIntegrationOK struct {
	Payload *models.APIGetThingsBoardIntegrationResponse
}

// IsSuccess returns true when this application service get things board integration o k response has a 2xx status code
func (o *ApplicationServiceGetThingsBoardIntegrationOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this application service get things board integration o k response has a 3xx status code
func (o *ApplicationServiceGetThingsBoardIntegrationOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this application service get things board integration o k response has a 4xx status code
func (o *ApplicationServiceGetThingsBoardIntegrationOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this application service get things board integration o k response has a 5xx status code
func (o *ApplicationServiceGetThingsBoardIntegrationOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the application service get things board integration o k response
func (o *ApplicationServiceGetThingsBoardIntegrationOK) Code() int {
	return 200
}

func (o *ApplicationServiceGetThingsBoardIntegrationOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/thingsboard][%d] applicationServiceGetThingsBoardIntegrationOK %s", 200, payload)
}

func (o *ApplicationServiceGetThingsBoardIntegrationOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/thingsboard][%d] applicationServiceGetThingsBoardIntegrationOK %s", 200, payload)
}

func (o *ApplicationServiceGetThingsBoardIntegrationOK) GetPayload() *models.APIGetThingsBoardIntegrationResponse {
	return o.Payload
}

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

	o.Payload = new(models.APIGetThingsBoardIntegrationResponse)

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

	return nil
}

// NewApplicationServiceGetThingsBoardIntegrationDefault creates a ApplicationServiceGetThingsBoardIntegrationDefault with default headers values
func NewApplicationServiceGetThingsBoardIntegrationDefault(code int) *ApplicationServiceGetThingsBoardIntegrationDefault {
	return &ApplicationServiceGetThingsBoardIntegrationDefault{
		_statusCode: code,
	}
}

/*
ApplicationServiceGetThingsBoardIntegrationDefault describes a response with status code -1, with default header values.

An unexpected error response.
*/
type ApplicationServiceGetThingsBoardIntegrationDefault struct {
	_statusCode int

	Payload *models.RPCStatus
}

// IsSuccess returns true when this application service get things board integration default response has a 2xx status code
func (o *ApplicationServiceGetThingsBoardIntegrationDefault) IsSuccess() bool {
	return o._statusCode/100 == 2
}

// IsRedirect returns true when this application service get things board integration default response has a 3xx status code
func (o *ApplicationServiceGetThingsBoardIntegrationDefault) IsRedirect() bool {
	return o._statusCode/100 == 3
}

// IsClientError returns true when this application service get things board integration default response has a 4xx status code
func (o *ApplicationServiceGetThingsBoardIntegrationDefault) IsClientError() bool {
	return o._statusCode/100 == 4
}

// IsServerError returns true when this application service get things board integration default response has a 5xx status code
func (o *ApplicationServiceGetThingsBoardIntegrationDefault) IsServerError() bool {
	return o._statusCode/100 == 5
}

// IsCode returns true when this application service get things board integration default response a status code equal to that given
func (o *ApplicationServiceGetThingsBoardIntegrationDefault) IsCode(code int) bool {
	return o._statusCode == code
}

// Code gets the status code for the application service get things board integration default response
func (o *ApplicationServiceGetThingsBoardIntegrationDefault) Code() int {
	return o._statusCode
}

func (o *ApplicationServiceGetThingsBoardIntegrationDefault) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/thingsboard][%d] ApplicationService_GetThingsBoardIntegration default %s", o._statusCode, payload)
}

func (o *ApplicationServiceGetThingsBoardIntegrationDefault) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/thingsboard][%d] ApplicationService_GetThingsBoardIntegration default %s", o._statusCode, payload)
}

func (o *ApplicationServiceGetThingsBoardIntegrationDefault) GetPayload() *models.RPCStatus {
	return o.Payload
}

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

	o.Payload = new(models.RPCStatus)

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

	return nil
}
