/
subscription_id_document.go
38 lines (31 loc) · 1.12 KB
/
subscription_id_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
/*
* NSSF NSSAI Availability
*
* NSSF NSSAI Availability Service
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package producer
import (
"github.com/nycu-ucr/gonet/http"
"github.com/nycu-ucr/http_wrapper"
"github.com/nycu-ucr/nssf/logger"
"github.com/nycu-ucr/openapi/models"
)
// HandleNSSAIAvailabilityUnsubscribe - Deletes an already existing NSSAI availability notification subscription
func HandleNSSAIAvailabilityUnsubscribe(request *http_wrapper.Request) *http_wrapper.Response {
logger.Nssaiavailability.Infof("Handle NSSAIAvailabilityUnsubscribe")
subscriptionID := request.Params["subscriptionId"]
problemDetails := NSSAIAvailabilityUnsubscribeProcedure(subscriptionID)
if problemDetails == nil {
return http_wrapper.NewResponse(http.StatusNoContent, nil, nil)
} else if problemDetails != nil {
return http_wrapper.NewResponse(int(problemDetails.Status), nil, problemDetails)
}
problemDetails = &models.ProblemDetails{
Status: http.StatusForbidden,
Cause: "UNSPECIFIED",
}
return http_wrapper.NewResponse(http.StatusForbidden, nil, problemDetails)
}