Add header missing license header
[ric-plt/resource-status-manager.git] / RSM / models / resource_status_response.go
1 //
2 // Copyright 2019 AT&T Intellectual Property
3 // Copyright 2019 Nokia
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
18
19 //  This source code is part of the near-RT RIC (RAN Intelligent Controller)
20 //  platform project (RICP).
21
22 package models
23
24 import (
25         "fmt"
26         "strings"
27 )
28
29 type MeasurementFailureCause struct {
30         MeasurementFailedReportCharacteristics []byte
31 }
32
33 func (r MeasurementFailureCause) String() string {
34         return fmt.Sprintf("MeasurementFailedReportCharacteristics: %x", r.MeasurementFailedReportCharacteristics)
35 }
36
37 type MeasurementInitiationResult struct {
38         CellId                   string
39         MeasurementFailureCauses []*MeasurementFailureCause
40 }
41
42 func (r MeasurementInitiationResult) String() string {
43         var strBuilder strings.Builder
44         strBuilder.WriteString("[ ")
45         for _, cause := range r.MeasurementFailureCauses {
46                 strBuilder.WriteString(cause.String())
47                 strBuilder.WriteString(" ")
48         }
49         strBuilder.WriteString(" ]")
50         return fmt.Sprintf("CellId: %s, MeasurementFailureCauses: %s", r.CellId, strBuilder.String())
51 }
52
53 type ResourceStatusResponse struct {
54         ENB1_Measurement_ID          int64
55         ENB2_Measurement_ID          int64
56         MeasurementInitiationResults []*MeasurementInitiationResult
57 }
58
59 func (r ResourceStatusResponse) String() string {
60         var strBuilder strings.Builder
61         strBuilder.WriteString("[ ")
62         for _, result := range r.MeasurementInitiationResults {
63                 strBuilder.WriteString(result.String())
64                 strBuilder.WriteString(" ")
65         }
66         strBuilder.WriteString(" ]")
67         return fmt.Sprintf("ENB1_Measurement_ID: %d, ENB2_Measurement_ID: %d, MeasurementInitiationResults:%s", r.ENB1_Measurement_ID, r.ENB2_Measurement_ID, strBuilder.String())
68 }