github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/mtaclient/operations/get_mta_operations_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package operations
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"fmt"
    10  	"io"
    11  
    12  	"github.com/go-openapi/runtime"
    13  
    14  	strfmt "github.com/go-openapi/strfmt"
    15  
    16  	baseclient "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/baseclient"
    17  	"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/models"
    18  )
    19  
    20  // GetMtaOperationsReader is a Reader for the GetMtaOperations structure.
    21  type GetMtaOperationsReader struct {
    22  	formats strfmt.Registry
    23  }
    24  
    25  // ReadResponse reads a server response into the received o.
    26  func (o *GetMtaOperationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    27  	switch response.Code() {
    28  
    29  	case 200:
    30  		result := NewGetMtaOperationsOK()
    31  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    32  			return nil, err
    33  		}
    34  		return result, nil
    35  
    36  	default:
    37  		return nil, baseclient.BuildErrorResponse(response, consumer, o.formats)
    38  	}
    39  }
    40  
    41  // NewGetMtaOperationsOK creates a GetMtaOperationsOK with default headers values
    42  func NewGetMtaOperationsOK() *GetMtaOperationsOK {
    43  	return &GetMtaOperationsOK{}
    44  }
    45  
    46  /*GetMtaOperationsOK handles this case with default header values.
    47  
    48  OK
    49  */
    50  type GetMtaOperationsOK struct {
    51  	Payload models.GetMtaOperationsOKBody
    52  }
    53  
    54  func (o *GetMtaOperationsOK) Error() string {
    55  	return fmt.Sprintf("[GET /operations][%d] getMtaOperationsOK  %+v", 200, o.Payload)
    56  }
    57  
    58  func (o *GetMtaOperationsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    59  
    60  	// response payload
    61  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
    62  		return err
    63  	}
    64  
    65  	return nil
    66  }