dae459e617f51bf802ccfb698b81b09982f9d169
[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 package models
19
20 import (
21         "fmt"
22         "strings"
23 )
24
25 type MeasurementFailureCause struct {
26         MeasurementFailedReportCharacteristics []byte
27 }
28
29 func (r MeasurementFailureCause) String() string {
30         return fmt.Sprintf("MeasurementFailedReportCharacteristics: %x", r.MeasurementFailedReportCharacteristics)
31 }
32
33 type MeasurementInitiationResult struct {
34         CellId                   string
35         MeasurementFailureCauses []*MeasurementFailureCause
36 }
37
38 func (r MeasurementInitiationResult) String() string {
39         var strBuilder strings.Builder
40         strBuilder.WriteString("[ ")
41         for _, cause := range r.MeasurementFailureCauses {
42                 strBuilder.WriteString(cause.String())
43                 strBuilder.WriteString(" ")
44         }
45         strBuilder.WriteString(" ]")
46         return fmt.Sprintf("CellId: %s, MeasurementFailureCauses: %s", r.CellId, strBuilder.String())
47 }
48
49 type ResourceStatusResponse struct {
50         ENB1_Measurement_ID          int64
51         ENB2_Measurement_ID          int64
52         MeasurementInitiationResults []*MeasurementInitiationResult
53 }
54
55 func (r ResourceStatusResponse) String() string {
56         var strBuilder strings.Builder
57         strBuilder.WriteString("[ ")
58         for _, result := range r.MeasurementInitiationResults {
59                 strBuilder.WriteString(result.String())
60                 strBuilder.WriteString(" ")
61         }
62         strBuilder.WriteString(" ]")
63         return fmt.Sprintf("ENB1_Measurement_ID: %d, ENB2_Measurement_ID: %d, MeasurementInitiationResults:%s", r.ENB1_Measurement_ID, r.ENB2_Measurement_ID, strBuilder.String())
64 }