Add models
[ric-plt/xapp-frame.git] / pkg / restapi / operations / control / subscribe_control_responses.go
1 // Code generated by go-swagger; DO NOT EDIT.
2
3 package control
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         "net/http"
10
11         "github.com/go-openapi/runtime"
12
13         models "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
14 )
15
16 // SubscribeControlCreatedCode is the HTTP code returned for type SubscribeControlCreated
17 const SubscribeControlCreatedCode int = 201
18
19 /*SubscribeControlCreated Subscription successfully created
20
21 swagger:response subscribeControlCreated
22 */
23 type SubscribeControlCreated struct {
24
25         /*
26           In: Body
27         */
28         Payload models.SubscriptionResult `json:"body,omitempty"`
29 }
30
31 // NewSubscribeControlCreated creates SubscribeControlCreated with default headers values
32 func NewSubscribeControlCreated() *SubscribeControlCreated {
33
34         return &SubscribeControlCreated{}
35 }
36
37 // WithPayload adds the payload to the subscribe control created response
38 func (o *SubscribeControlCreated) WithPayload(payload models.SubscriptionResult) *SubscribeControlCreated {
39         o.Payload = payload
40         return o
41 }
42
43 // SetPayload sets the payload to the subscribe control created response
44 func (o *SubscribeControlCreated) SetPayload(payload models.SubscriptionResult) {
45         o.Payload = payload
46 }
47
48 // WriteResponse to the client
49 func (o *SubscribeControlCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
50
51         rw.WriteHeader(201)
52         payload := o.Payload
53         if payload == nil {
54                 // return empty array
55                 payload = models.SubscriptionResult{}
56         }
57
58         if err := producer.Produce(rw, payload); err != nil {
59                 panic(err) // let the recovery middleware deal with this
60         }
61 }
62
63 // SubscribeControlBadRequestCode is the HTTP code returned for type SubscribeControlBadRequest
64 const SubscribeControlBadRequestCode int = 400
65
66 /*SubscribeControlBadRequest Invalid input
67
68 swagger:response subscribeControlBadRequest
69 */
70 type SubscribeControlBadRequest struct {
71 }
72
73 // NewSubscribeControlBadRequest creates SubscribeControlBadRequest with default headers values
74 func NewSubscribeControlBadRequest() *SubscribeControlBadRequest {
75
76         return &SubscribeControlBadRequest{}
77 }
78
79 // WriteResponse to the client
80 func (o *SubscribeControlBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
81
82         rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
83
84         rw.WriteHeader(400)
85 }
86
87 // SubscribeControlInternalServerErrorCode is the HTTP code returned for type SubscribeControlInternalServerError
88 const SubscribeControlInternalServerErrorCode int = 500
89
90 /*SubscribeControlInternalServerError Internal error
91
92 swagger:response subscribeControlInternalServerError
93 */
94 type SubscribeControlInternalServerError struct {
95 }
96
97 // NewSubscribeControlInternalServerError creates SubscribeControlInternalServerError with default headers values
98 func NewSubscribeControlInternalServerError() *SubscribeControlInternalServerError {
99
100         return &SubscribeControlInternalServerError{}
101 }
102
103 // WriteResponse to the client
104 func (o *SubscribeControlInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
105
106         rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
107
108         rw.WriteHeader(500)
109 }