Moving RMR message reciver into go routine
[ric-plt/a1.git] / a1-go / pkg / restapi / operations / a1_mediator / a1_controller_get_all_instances_for_type.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 generate command
27
28 import (
29         "net/http"
30
31         "github.com/go-openapi/runtime/middleware"
32 )
33
34 // A1ControllerGetAllInstancesForTypeHandlerFunc turns a function with the right signature into a a1 controller get all instances for type handler
35 type A1ControllerGetAllInstancesForTypeHandlerFunc func(A1ControllerGetAllInstancesForTypeParams) middleware.Responder
36
37 // Handle executing the request and returning a response
38 func (fn A1ControllerGetAllInstancesForTypeHandlerFunc) Handle(params A1ControllerGetAllInstancesForTypeParams) middleware.Responder {
39         return fn(params)
40 }
41
42 // A1ControllerGetAllInstancesForTypeHandler interface for that can handle valid a1 controller get all instances for type params
43 type A1ControllerGetAllInstancesForTypeHandler interface {
44         Handle(A1ControllerGetAllInstancesForTypeParams) middleware.Responder
45 }
46
47 // NewA1ControllerGetAllInstancesForType creates a new http.Handler for the a1 controller get all instances for type operation
48 func NewA1ControllerGetAllInstancesForType(ctx *middleware.Context, handler A1ControllerGetAllInstancesForTypeHandler) *A1ControllerGetAllInstancesForType {
49         return &A1ControllerGetAllInstancesForType{Context: ctx, Handler: handler}
50 }
51
52 /*A1ControllerGetAllInstancesForType swagger:route GET /a1-p/policytypes/{policy_type_id}/policies A1 Mediator a1ControllerGetAllInstancesForType
53
54 get a list of all policy instance ids for this policy type id
55
56 */
57 type A1ControllerGetAllInstancesForType struct {
58         Context *middleware.Context
59         Handler A1ControllerGetAllInstancesForTypeHandler
60 }
61
62 func (o *A1ControllerGetAllInstancesForType) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
63         route, rCtx, _ := o.Context.RouteInfo(r)
64         if rCtx != nil {
65                 r = rCtx
66         }
67         var Params = NewA1ControllerGetAllInstancesForTypeParams()
68
69         if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
70                 o.Context.Respond(rw, r, route.Produces, route, err)
71                 return
72         }
73
74         res := o.Handler.Handle(Params) // actually handle the request
75
76         o.Context.Respond(rw, r, route.Produces, route, res)
77
78 }