From 1b286cd8e83997f95288f65e5e6dc5a3ad36d066 Mon Sep 17 00:00:00 2001 From: Yogesh Deshpande Date: Mon, 15 Apr 2024 13:27:12 -0400 Subject: [PATCH] Restore the functions Signed-off-by: Yogesh Deshpande --- comid/measurement.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/comid/measurement.go b/comid/measurement.go index 25852b97..8fe7bec8 100644 --- a/comid/measurement.go +++ b/comid/measurement.go @@ -70,6 +70,32 @@ func (o Mkey) Valid() error { return nil } +func (o Mkey) GetPSARefValID() (PSARefValID, error) { + if !o.IsSet() { + return PSARefValID{}, errors.New("MKey is not set") + } + switch t := o.Value.(type) { + case TaggedPSARefValID: + return PSARefValID(t), nil + default: + return PSARefValID{}, fmt.Errorf("measurement-key type is: %T", t) + } + +} + +func (o Mkey) GetCCAPlatformConfigID() (CCAPlatformConfigID, error) { + if !o.IsSet() { + return "", errors.New("MKey is not set") + } + switch t := o.Value.(type) { + case TaggedCCAPlatformConfigID: + return CCAPlatformConfigID(t), nil + default: + return "", fmt.Errorf("measurement-key type is: %T", t) + } + +} + // UnmarshalJSON deserializes the supplied JSON object into the target MKey // The key object must have the following shape: //