This repository has been archived by the owner on Apr 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
api_individual_application_session_context_document.go
69 lines (52 loc) · 2.05 KB
/
api_individual_application_session_context_document.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* Npcf_PolicyAuthorization Service API
*
* This is the Policy Authorization Service
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package PolicyAuthorization
import (
"free5gc/lib/http_wrapper"
"free5gc/lib/openapi/models"
"free5gc/src/pcf/pcf_handler/pcf_message"
"github.com/gin-gonic/gin"
)
// DeleteAppSession - Deletes an existing Individual Application Session Context
func DeleteAppSession(c *gin.Context) {
var eventsSubscReqData *models.EventsSubscReqData
err := c.ShouldBindJSON(eventsSubscReqData)
if err != nil {
eventsSubscReqData = nil
}
req := http_wrapper.NewRequest(c.Request, eventsSubscReqData)
req.Params["appSessionId"], _ = c.Params.Get("appSessionId")
channelMsg := pcf_message.NewHttpChannelMessage(pcf_message.EventDeleteAppSession, req)
pcf_message.SendMessage(channelMsg)
recvMsg := <-channelMsg.HttpChannel
HTTPResponse := recvMsg.HTTPResponse
c.JSON(HTTPResponse.Status, HTTPResponse.Body)
}
// GetAppSession - Reads an existing Individual Application Session Context
func GetAppSession(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req.Params["appSessionId"], _ = c.Params.Get("appSessionId")
channelMsg := pcf_message.NewHttpChannelMessage(pcf_message.EventGetAppSession, req)
pcf_message.SendMessage(channelMsg)
recvMsg := <-channelMsg.HttpChannel
HTTPResponse := recvMsg.HTTPResponse
c.JSON(HTTPResponse.Status, HTTPResponse.Body)
}
// ModAppSession - Modifies an existing Individual Application Session Context
func ModAppSession(c *gin.Context) {
var appSessionContextUpdateData models.AppSessionContextUpdateData
c.ShouldBindJSON(&appSessionContextUpdateData)
req := http_wrapper.NewRequest(c.Request, appSessionContextUpdateData)
req.Params["appSessionId"], _ = c.Params.Get("appSessionId")
channelMsg := pcf_message.NewHttpChannelMessage(pcf_message.EventModAppSession, req)
pcf_message.SendMessage(channelMsg)
recvMsg := <-channelMsg.HttpChannel
HTTPResponse := recvMsg.HTTPResponse
c.JSON(HTTPResponse.Status, HTTPResponse.Body)
}