Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.

Proposal for resources #61

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

onhernandes
Copy link

Hi there. I want to present this new SDK, I don't know if its worth keeping developing, so here I am.

The idea is to give support for resources such as Category, User, Item, etc with custom methods, removing from developers the development of basic things involving the ML's API like validating/dealing with requests, category validation, items validation(pictures, listing types, buying modes, shipping modes, etc), getting data(category, user info, item info, etc) and more.

For now I made just two classes, it supports Users and Categories. Also, there'is some tests I made but they're still in development.

Quick comments:

  • Uses GuzzleHttp for requests, its safer and better
  • Every Resource(Category.php, User.php) inherits Resource.php, which gives some cool methods like faker() for generating a generic Faker instance, validate() for validating the current object, load() and fill() for dealing with the current object properties, etc
  • Every Resource receives a MeliRequestInterface(explained below) for making requests and a array for filling the current object
  • Using Meli as a class for making requests is optional, in case of the developer already using other custom class for requests involving DB and etc, the developer just needs to pass a class that implements the MeliRequestInterface.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant