question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create Class for every ressources

See original GitHub issue

Description Currently, the python SDK contains only a few classes including Index and Client. it would be nice to implement all the resources returned by the API of Meilisearch in class that would have the effect to return more precise types.

Basic example Every resource could be defined as a class like:

class DocumentsInfo():
    results: List[Dict[str, Any]]
    offset: int
    limit: int
    total: int
    def get_documents(self, parameters: Optional[Dict[str, Any]] = None) -> DocumentsInfo:

See this repository as a perfect example.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ElamCcommented, Aug 7, 2022

#513 Introduces this to the project so there are still changes to be made to ensure other resources also return class models

1reaction
sanders41commented, Aug 4, 2022

Hi @ElamC, Thank you so much for taking care of this ❤️. I prefer the second option also can’t we use this library as it has been implemented here?

Just a note if you go this direction. Make sure to install camel-converter with the Pydantic extra pipenv install camel-converter[pydantic]

Read more comments on GitHub >

github_iconTop Results From Across the Web

An elegant way to implement shared classes that load heavy ...
An elegant way to implement shared classes that load heavy resources (in Java) ; public class ; ParserWrapper · private ; static final ......
Read more >
Writing a custom DSC resource with PowerShell classes
This article shows how to create a simple resource that manages a file in a specified path.
Read more >
Create custom resource classes - Sitefinity CMS Development
Create a new resource class and register it in Sitefinity. Resource classes distribute labels among ... Every resource is using the ResourceEntry attribute....
Read more >
Chapter 3 Creating a RESTful Resource Class
Resource methods are methods of a resource class annotated with a request method designator. This section describes how to use Jersey to annotate...
Read more >
Creating your own resource class - alt:V Documentation
To create our own resource class, we need to extend from the alt::IResource::Impl interface, and implement its methods. ... Remember that resources can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found