Initial code for the a1 implementation for go
[ric-plt/a1.git] / a1-go / pkg / restapi / operations / a1_mediator / a1_controller_get_all_policy_types_responses.go
1 /*
2 ==================================================================================
3   Copyright (c) 2021 Samsung
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17    This source code is part of the near-RT RIC (RAN Intelligent Controller)
18    platform project (RICP).
19 ==================================================================================
20 */
21 // Code generated by go-swagger; DO NOT EDIT.
22
23 package a1_mediator
24
25 // This file was generated by the swagger tool.
26 // Editing this file might prove futile when you re-run the swagger generate command
27
28 import (
29         "net/http"
30
31         "github.com/go-openapi/runtime"
32
33         "subh.com/a1-go/pkg/models"
34 )
35
36 // A1ControllerGetAllPolicyTypesOKCode is the HTTP code returned for type A1ControllerGetAllPolicyTypesOK
37 const A1ControllerGetAllPolicyTypesOKCode int = 200
38
39 /*A1ControllerGetAllPolicyTypesOK list of all registered policy type ids
40
41 swagger:response a1ControllerGetAllPolicyTypesOK
42 */
43 type A1ControllerGetAllPolicyTypesOK struct {
44
45         /*
46           In: Body
47         */
48         Payload []models.PolicyTypeID `json:"body,omitempty"`
49 }
50
51 // NewA1ControllerGetAllPolicyTypesOK creates A1ControllerGetAllPolicyTypesOK with default headers values
52 func NewA1ControllerGetAllPolicyTypesOK() *A1ControllerGetAllPolicyTypesOK {
53
54         return &A1ControllerGetAllPolicyTypesOK{}
55 }
56
57 // WithPayload adds the payload to the a1 controller get all policy types o k response
58 func (o *A1ControllerGetAllPolicyTypesOK) WithPayload(payload []models.PolicyTypeID) *A1ControllerGetAllPolicyTypesOK {
59         o.Payload = payload
60         return o
61 }
62
63 // SetPayload sets the payload to the a1 controller get all policy types o k response
64 func (o *A1ControllerGetAllPolicyTypesOK) SetPayload(payload []models.PolicyTypeID) {
65         o.Payload = payload
66 }
67
68 // WriteResponse to the client
69 func (o *A1ControllerGetAllPolicyTypesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
70
71         rw.WriteHeader(200)
72         payload := o.Payload
73         if payload == nil {
74                 // return empty array
75                 payload = make([]models.PolicyTypeID, 0, 50)
76         }
77
78         if err := producer.Produce(rw, payload); err != nil {
79                 panic(err) // let the recovery middleware deal with this
80         }
81 }
82
83 // A1ControllerGetAllPolicyTypesServiceUnavailableCode is the HTTP code returned for type A1ControllerGetAllPolicyTypesServiceUnavailable
84 const A1ControllerGetAllPolicyTypesServiceUnavailableCode int = 503
85
86 /*A1ControllerGetAllPolicyTypesServiceUnavailable Potentially transient backend database error. Client should attempt to retry later.
87
88 swagger:response a1ControllerGetAllPolicyTypesServiceUnavailable
89 */
90 type A1ControllerGetAllPolicyTypesServiceUnavailable struct {
91 }
92
93 // NewA1ControllerGetAllPolicyTypesServiceUnavailable creates A1ControllerGetAllPolicyTypesServiceUnavailable with default headers values
94 func NewA1ControllerGetAllPolicyTypesServiceUnavailable() *A1ControllerGetAllPolicyTypesServiceUnavailable {
95
96         return &A1ControllerGetAllPolicyTypesServiceUnavailable{}
97 }
98
99 // WriteResponse to the client
100 func (o *A1ControllerGetAllPolicyTypesServiceUnavailable) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
101
102         rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
103
104         rw.WriteHeader(503)
105 }