X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=pkg%2Frestapi%2Foperations%2Fcontrol%2Fsubscribe_control_responses.go;fp=pkg%2Frestapi%2Foperations%2Fcontrol%2Fsubscribe_control_responses.go;h=7a56f7fb99380c3b290d2cfe1da741ab640df5ee;hb=3895a8c8775ef96652e6473414fdd7366c59f404;hp=0000000000000000000000000000000000000000;hpb=5120ec103eead26427b977f4b2456c2ce57b36ac;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/restapi/operations/control/subscribe_control_responses.go b/pkg/restapi/operations/control/subscribe_control_responses.go new file mode 100644 index 0000000..7a56f7f --- /dev/null +++ b/pkg/restapi/operations/control/subscribe_control_responses.go @@ -0,0 +1,109 @@ +// 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 ( + "net/http" + + "github.com/go-openapi/runtime" + + models "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models" +) + +// SubscribeControlCreatedCode is the HTTP code returned for type SubscribeControlCreated +const SubscribeControlCreatedCode int = 201 + +/*SubscribeControlCreated Subscription successfully created + +swagger:response subscribeControlCreated +*/ +type SubscribeControlCreated struct { + + /* + In: Body + */ + Payload models.SubscriptionResult `json:"body,omitempty"` +} + +// NewSubscribeControlCreated creates SubscribeControlCreated with default headers values +func NewSubscribeControlCreated() *SubscribeControlCreated { + + return &SubscribeControlCreated{} +} + +// WithPayload adds the payload to the subscribe control created response +func (o *SubscribeControlCreated) WithPayload(payload models.SubscriptionResult) *SubscribeControlCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the subscribe control created response +func (o *SubscribeControlCreated) SetPayload(payload models.SubscriptionResult) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubscribeControlCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + payload := o.Payload + if payload == nil { + // return empty array + payload = models.SubscriptionResult{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// SubscribeControlBadRequestCode is the HTTP code returned for type SubscribeControlBadRequest +const SubscribeControlBadRequestCode int = 400 + +/*SubscribeControlBadRequest Invalid input + +swagger:response subscribeControlBadRequest +*/ +type SubscribeControlBadRequest struct { +} + +// NewSubscribeControlBadRequest creates SubscribeControlBadRequest with default headers values +func NewSubscribeControlBadRequest() *SubscribeControlBadRequest { + + return &SubscribeControlBadRequest{} +} + +// WriteResponse to the client +func (o *SubscribeControlBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// SubscribeControlInternalServerErrorCode is the HTTP code returned for type SubscribeControlInternalServerError +const SubscribeControlInternalServerErrorCode int = 500 + +/*SubscribeControlInternalServerError Internal error + +swagger:response subscribeControlInternalServerError +*/ +type SubscribeControlInternalServerError struct { +} + +// NewSubscribeControlInternalServerError creates SubscribeControlInternalServerError with default headers values +func NewSubscribeControlInternalServerError() *SubscribeControlInternalServerError { + + return &SubscribeControlInternalServerError{} +} + +// WriteResponse to the client +func (o *SubscribeControlInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +}