Add models
[ric-plt/xapp-frame.git] / pkg / restapi / operations / policy / subscribe_policy_responses.go
1 // Code generated by go-swagger; DO NOT EDIT.
2
3 package policy
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 // SubscribePolicyCreatedCode is the HTTP code returned for type SubscribePolicyCreated
17 const SubscribePolicyCreatedCode int = 201
18
19 /*SubscribePolicyCreated Subscription successfully created
20
21 swagger:response subscribePolicyCreated
22 */
23 type SubscribePolicyCreated struct {
24
25         /*
26           In: Body
27         */
28         Payload models.SubscriptionResult `json:"body,omitempty"`
29 }
30
31 // NewSubscribePolicyCreated creates SubscribePolicyCreated with default headers values
32 func NewSubscribePolicyCreated() *SubscribePolicyCreated {
33
34         return &SubscribePolicyCreated{}
35 }
36
37 // WithPayload adds the payload to the subscribe policy created response
38 func (o *SubscribePolicyCreated) WithPayload(payload models.SubscriptionResult) *SubscribePolicyCreated {
39         o.Payload = payload
40         return o
41 }
42
43 // SetPayload sets the payload to the subscribe policy created response
44 func (o *SubscribePolicyCreated) SetPayload(payload models.SubscriptionResult) {
45         o.Payload = payload
46 }
47
48 // WriteResponse to the client
49 func (o *SubscribePolicyCreated) 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 // SubscribePolicyBadRequestCode is the HTTP code returned for type SubscribePolicyBadRequest
64 const SubscribePolicyBadRequestCode int = 400
65
66 /*SubscribePolicyBadRequest Invalid input
67
68 swagger:response subscribePolicyBadRequest
69 */
70 type SubscribePolicyBadRequest struct {
71 }
72
73 // NewSubscribePolicyBadRequest creates SubscribePolicyBadRequest with default headers values
74 func NewSubscribePolicyBadRequest() *SubscribePolicyBadRequest {
75
76         return &SubscribePolicyBadRequest{}
77 }
78
79 // WriteResponse to the client
80 func (o *SubscribePolicyBadRequest) 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 // SubscribePolicyInternalServerErrorCode is the HTTP code returned for type SubscribePolicyInternalServerError
88 const SubscribePolicyInternalServerErrorCode int = 500
89
90 /*SubscribePolicyInternalServerError Internal error
91
92 swagger:response subscribePolicyInternalServerError
93 */
94 type SubscribePolicyInternalServerError struct {
95 }
96
97 // NewSubscribePolicyInternalServerError creates SubscribePolicyInternalServerError with default headers values
98 func NewSubscribePolicyInternalServerError() *SubscribePolicyInternalServerError {
99
100         return &SubscribePolicyInternalServerError{}
101 }
102
103 // WriteResponse to the client
104 func (o *SubscribePolicyInternalServerError) 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 }