Policy status notification handling - initial rollup
[ric-plt/a1.git] / pkg / restapi / operations / a1_mediator / a1_controller_get_all_instances_for_type_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         "gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/models"
34 )
35
36 // A1ControllerGetAllInstancesForTypeOKCode is the HTTP code returned for type A1ControllerGetAllInstancesForTypeOK
37 const A1ControllerGetAllInstancesForTypeOKCode int = 200
38
39 /*A1ControllerGetAllInstancesForTypeOK list of all policy instance ids for this policy type id
40
41 swagger:response a1ControllerGetAllInstancesForTypeOK
42 */
43 type A1ControllerGetAllInstancesForTypeOK struct {
44
45         /*
46           In: Body
47         */
48         Payload []models.PolicyInstanceID `json:"body,omitempty"`
49 }
50
51 // NewA1ControllerGetAllInstancesForTypeOK creates A1ControllerGetAllInstancesForTypeOK with default headers values
52 func NewA1ControllerGetAllInstancesForTypeOK() *A1ControllerGetAllInstancesForTypeOK {
53
54         return &A1ControllerGetAllInstancesForTypeOK{}
55 }
56
57 // WithPayload adds the payload to the a1 controller get all instances for type o k response
58 func (o *A1ControllerGetAllInstancesForTypeOK) WithPayload(payload []models.PolicyInstanceID) *A1ControllerGetAllInstancesForTypeOK {
59         o.Payload = payload
60         return o
61 }
62
63 // SetPayload sets the payload to the a1 controller get all instances for type o k response
64 func (o *A1ControllerGetAllInstancesForTypeOK) SetPayload(payload []models.PolicyInstanceID) {
65         o.Payload = payload
66 }
67
68 // WriteResponse to the client
69 func (o *A1ControllerGetAllInstancesForTypeOK) 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.PolicyInstanceID, 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 // A1ControllerGetAllInstancesForTypeServiceUnavailableCode is the HTTP code returned for type A1ControllerGetAllInstancesForTypeServiceUnavailable
84 const A1ControllerGetAllInstancesForTypeServiceUnavailableCode int = 503
85
86 /*A1ControllerGetAllInstancesForTypeServiceUnavailable Potentially transient backend database error. Client should attempt to retry later.
87
88 swagger:response a1ControllerGetAllInstancesForTypeServiceUnavailable
89 */
90 type A1ControllerGetAllInstancesForTypeServiceUnavailable struct {
91 }
92
93 // NewA1ControllerGetAllInstancesForTypeServiceUnavailable creates A1ControllerGetAllInstancesForTypeServiceUnavailable with default headers values
94 func NewA1ControllerGetAllInstancesForTypeServiceUnavailable() *A1ControllerGetAllInstancesForTypeServiceUnavailable {
95
96         return &A1ControllerGetAllInstancesForTypeServiceUnavailable{}
97 }
98
99 // WriteResponse to the client
100 func (o *A1ControllerGetAllInstancesForTypeServiceUnavailable) 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 }