Add interface to read metrics
[ric-plt/xapp-frame.git] / pkg / restapi / operations / report / subscribe_report_responses.go
index d175d73..9e9d18d 100644 (file)
@@ -25,7 +25,7 @@ type SubscribeReportCreated struct {
        /*
          In: Body
        */
-       Payload models.SubscriptionResult `json:"body,omitempty"`
+       Payload *models.SubscriptionResponse `json:"body,omitempty"`
 }
 
 // NewSubscribeReportCreated creates SubscribeReportCreated with default headers values
@@ -35,13 +35,13 @@ func NewSubscribeReportCreated() *SubscribeReportCreated {
 }
 
 // WithPayload adds the payload to the subscribe report created response
-func (o *SubscribeReportCreated) WithPayload(payload models.SubscriptionResult) *SubscribeReportCreated {
+func (o *SubscribeReportCreated) WithPayload(payload *models.SubscriptionResponse) *SubscribeReportCreated {
        o.Payload = payload
        return o
 }
 
 // SetPayload sets the payload to the subscribe report created response
-func (o *SubscribeReportCreated) SetPayload(payload models.SubscriptionResult) {
+func (o *SubscribeReportCreated) SetPayload(payload *models.SubscriptionResponse) {
        o.Payload = payload
 }
 
@@ -49,14 +49,11 @@ func (o *SubscribeReportCreated) SetPayload(payload models.SubscriptionResult) {
 func (o *SubscribeReportCreated) 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
+       if o.Payload != nil {
+               payload := o.Payload
+               if err := producer.Produce(rw, payload); err != nil {
+                       panic(err) // let the recovery middleware deal with this
+               }
        }
 }