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: //