diff --git a/databases.go b/databases.go index c21b620..ec9fb5b 100644 --- a/databases.go +++ b/databases.go @@ -1921,12 +1921,12 @@ func (svc *DatabasesServiceOp) GetLogsink(ctx context.Context, databaseID string return nil, nil, err } - root := new(databaseLogsinkRoot) - resp, err := svc.client.Do(ctx, req, root.Sink) + root := new(DatabaseLogsink) + resp, err := svc.client.Do(ctx, req, root) if err != nil { return nil, resp, err } - return &root.Sink, resp, nil + return root, resp, nil } // ListTopics returns all logsinks for a given database cluster. diff --git a/databases_test.go b/databases_test.go index 26247bd..7806b11 100644 --- a/databases_test.go +++ b/databases_test.go @@ -3919,14 +3919,12 @@ func TestDatabases_GetLogsink(t *testing.T) { } body := `{ - "sink":{ - "sink_id":"deadbeef-dead-4aa5-beef-deadbeef347d", - "sink_name":"logs-sink", - "sink_type":"opensearch", - "config":{ - "url":"https://user:passwd@192.168.0.1:25060", - "index_prefix":"opensearch-logs" - } + "sink_id":"deadbeef-dead-4aa5-beef-deadbeef347d", + "sink_name":"logs-sink", + "sink_type":"opensearch", + "config":{ + "url":"https://user:passwd@192.168.0.1:25060", + "index_prefix":"opensearch-logs" } }`