// Code generated by go-swagger; DO NOT EDIT. package control // 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" strfmt "github.com/go-openapi/strfmt" clientmodel "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel" ) // SubscribeControlReader is a Reader for the SubscribeControl structure. type SubscribeControlReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *SubscribeControlReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 201: result := NewSubscribeControlCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: result := NewSubscribeControlBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewSubscribeControlInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } // NewSubscribeControlCreated creates a SubscribeControlCreated with default headers values func NewSubscribeControlCreated() *SubscribeControlCreated { return &SubscribeControlCreated{} } /*SubscribeControlCreated handles this case with default header values. Subscription successfully created */ type SubscribeControlCreated struct { Payload clientmodel.SubscriptionResult } func (o *SubscribeControlCreated) Error() string { return fmt.Sprintf("[POST /subscriptions/control][%d] subscribeControlCreated %+v", 201, o.Payload) } func (o *SubscribeControlCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } return nil } // NewSubscribeControlBadRequest creates a SubscribeControlBadRequest with default headers values func NewSubscribeControlBadRequest() *SubscribeControlBadRequest { return &SubscribeControlBadRequest{} } /*SubscribeControlBadRequest handles this case with default header values. Invalid input */ type SubscribeControlBadRequest struct { } func (o *SubscribeControlBadRequest) Error() string { return fmt.Sprintf("[POST /subscriptions/control][%d] subscribeControlBadRequest ", 400) } func (o *SubscribeControlBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewSubscribeControlInternalServerError creates a SubscribeControlInternalServerError with default headers values func NewSubscribeControlInternalServerError() *SubscribeControlInternalServerError { return &SubscribeControlInternalServerError{} } /*SubscribeControlInternalServerError handles this case with default header values. Internal error */ type SubscribeControlInternalServerError struct { } func (o *SubscribeControlInternalServerError) Error() string { return fmt.Sprintf("[POST /subscriptions/control][%d] subscribeControlInternalServerError ", 500) } func (o *SubscribeControlInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil }