diff --git a/databases.go b/databases.go index 276fb4a6..c7e53d2d 100644 --- a/databases.go +++ b/databases.go @@ -828,6 +828,10 @@ type databaseTopicsRoot struct { Topics []DatabaseTopic `json:"topics"` } +type databaseLogsinkRoot struct { + Sink *DatabaseLogsink `json:"sink"` +} + type databaseLogsinksRoot struct { Sinks []DatabaseLogsink `json:"sinks"` } @@ -1886,12 +1890,13 @@ func (svc *DatabasesServiceOp) CreateLogsink(ctx context.Context, databaseID str return nil, nil, err } - root := new(DatabaseLogsink) + root := new(databaseLogsinkRoot) + resp, err := svc.client.Do(ctx, req, root) if err != nil { return nil, resp, err } - return root, resp, nil + return root.Sink, resp, nil } // GetLogsink gets a logsink for a database @@ -1902,7 +1907,9 @@ func (svc *DatabasesServiceOp) GetLogsink(ctx context.Context, databaseID string return nil, nil, err } + // root := new(databaseLogsinkRoot) root := new(DatabaseLogsink) + resp, err := svc.client.Do(ctx, req, root) if err != nil { return nil, resp, err @@ -1937,7 +1944,8 @@ func (svc *DatabasesServiceOp) UpdateLogsink(ctx context.Context, databaseID str return nil, err } - resp, err := svc.client.Do(ctx, req, nil) + root := new(databaseLogsinkRoot) + resp, err := svc.client.Do(ctx, req, root) if err != nil { return resp, err }