From 6395bd9278787e7fcf7aba6169b8c0fa42741af4 Mon Sep 17 00:00:00 2001 From: hazanosher Date: Wed, 31 Aug 2022 10:34:23 +0300 Subject: [PATCH] Make clientID interface{} --- management/log.go | 2 +- management/management.gen.go | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/management/log.go b/management/log.go index baf02456..5dce2727 100644 --- a/management/log.go +++ b/management/log.go @@ -70,7 +70,7 @@ type Log struct { Type *string `json:"type"` // The id of the client - ClientID *string `json:"client_id"` + ClientID interface{} `json:"client_id"` // The name of the client ClientName *string `json:"client_name"` diff --git a/management/management.gen.go b/management/management.gen.go index c95902a3..915aef80 100644 --- a/management/management.gen.go +++ b/management/management.gen.go @@ -3156,7 +3156,17 @@ func (l *Log) GetClientID() string { if l == nil || l.ClientID == nil { return "" } - return *l.ClientID + switch clientID := l.ClientID.(type) { + case string: + return clientID + case *string: + if clientID == nil { + return "" + } + return *clientID + default: + return "" + } } // GetClientName returns the ClientName field if it's non-nil, zero value otherwise.