mongodb / go-client-mongodb-atlas

Go Client for MongoDB Atlas
https://www.mongodb.com/docs/atlas/reference/api-resources-spec/
Apache License 2.0
79 stars 34 forks source link

fix: externalise structure for query and path params #463

Closed wtrocki closed 1 year ago

wtrocki commented 1 year ago

Description

Create separate structure for query params

Long

As part of the migration, I see recurrent theme where GET url arguments are returned as part of the Fluent API. E.g

 s.clientv2.PerformanceAdvisorApi.
        ListSuggestedIndexes(s.ctx, projectID, processName).
        NExamples(1) // This is query param
        Execute()       

Due to the architecture in the CLI (stores) we see need to pass those arguments to functions This usually means:

Manual SDKs have been supporting this by GET arguments being represented as struct: https://github.com/mongodb/go-client-mongodb-atlas/blob/437d9b43222e10c0fd565d979eafd85f80c199e2/mongodbatlas/performance_advisor.go#L105-L130

This PR brings parity (with level of backwards compatibility between both SDKs.