code: func (k *KeyringMemberClaimReason) UnmarshalJSON(b []byte) error {
  
  	raw := struct {
  		Type   KeyringMemberRevocationType `json:"type"`
  		Params json.RawMessage             `json:"params"`
  	}{}
  
  	err := json.Unmarshal(b, &raw)
  	if err != nil {
  		return err
  	}
  
  	k.Type = raw.Type
  
  	switch k.Type {
  	case OrgRemovalRevocationType: // no params
  		return nil
  	case KeyRevocationRevocationType:
  		k.Params = &KeyRevocationRevocationParams{}
  	case MachineDestroyRevocationType:
  		k.Params = &MachineDestroyRevocationParams{}
  	case MachineTokenDestroyRevocationType:
  		k.Params = &MachineTokenDestroyRevocationParams{}
  	}
  
  	return json.Unmarshal(raw.Params, k.Params)
  }
docs: // UnmarshalJSON implements the json.Unmarshaler interface.