feat: add project features - #31
Conversation
xDarksome
left a comment
There was a problem hiding this comment.
Adding more of these ProjectDataWith* is weird. Next time consider introducing ProjectDataWith struct where each of these additional pieces of data are either Option or serde(default). Then you can specify which ones you want to query in the fn arguments.
struct ProjectDataWithQuery<'a> {
id: &'a str,
include_limits: bool,
include_features: bool,
}
trait RegistryClient {
fn project_data_with(&self, query: ProjectDataWithQuery<'_>) -> RegistryResult<Option<ProjectDataWith>>;
}Or, considering that we are doing multiple network calls either way, we could put those query fns on ProjectData itself.
struct ProjectData {
...
}
impl ProjectData {
async fn features(&self) -> RegistryResult<Vec<Feature>> {
todo!()
}
async fn limits(&self) -> RegistryResult<Limits> {
todo!()
}
}|
@xDarksome Good point. I was a bit lazy, wanted to do it asap. I like the idea of doing it in Went with the first approach, just used different naming for the query. Please give it another look when you can and lmk wdyt 🙏 |
|
@xDarksome PR checks need to be updated in the settings. |
Description
Add new
project_data_withmethod that allows for the querying of the additional data along with the base project data.Currently, supported additional data are limits and features
Resolves # (issue)
How Has This Been Tested?
Due Diligence