github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/mtaclient/operations/start_mta_operation_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  
    11  	"github.com/go-openapi/errors"
    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  )
    18  
    19  // StartMtaOperationReader is a Reader for the StartMtaOperation structure.
    20  type StartMtaOperationReader struct {
    21  	formats strfmt.Registry
    22  }
    23  
    24  // ReadResponse reads a server response into the received o.
    25  func (o *StartMtaOperationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    26  	switch response.Code() {
    27  
    28  	case 202:
    29  		result := NewStartMtaOperationAccepted()
    30  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    31  			return nil, err
    32  		}
    33  		return result, nil
    34  
    35  	default:
    36  		return nil, baseclient.BuildErrorResponse(response, consumer, o.formats)
    37  	}
    38  }
    39  
    40  // NewStartMtaOperationAccepted creates a StartMtaOperationAccepted with default headers values
    41  func NewStartMtaOperationAccepted() *StartMtaOperationAccepted {
    42  	return &StartMtaOperationAccepted{}
    43  }
    44  
    45  /*StartMtaOperationAccepted handles this case with default header values.
    46  
    47  Accepted
    48  */
    49  type StartMtaOperationAccepted struct {
    50  	/*A Location header, used for transpassing between different resources
    51  
    52  	 */
    53  	Location strfmt.URI
    54  }
    55  
    56  func (o *StartMtaOperationAccepted) Error() string {
    57  	return fmt.Sprintf("[POST /operations][%d] startMtaOperationAccepted ", 202)
    58  }
    59  
    60  func (o *StartMtaOperationAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    61  
    62  	// response header Location
    63  
    64  	location, err := formats.Parse("uri", response.GetHeader("Location"))
    65  	if err != nil {
    66  		return errors.InvalidType("Location", "header", "strfmt.URI", response.GetHeader("Location"))
    67  	}
    68  	o.Location = *(location.(*strfmt.URI))
    69  
    70  	return nil
    71  }