[FEATURE] Add a GitHub client class for API interactions #279
Open
Description
Create a new GitHub client class for the Pancake project. This class will use the Pancake\Request
class to interact with the GitHub API.
Requirements:
-
Authentication:
- Accept app data and/or a user token for authenticated API requests.
- Dynamically use the appropriate credentials based on the type of request.
-
API Methods:
- Implement GitHub API endpoints as methods within the class.
- Ensure the methods follow GitHub API's best practices and provide user-friendly abstractions.
-
Error Management:
- Handle errors internally with flexibility:
- Option to log errors using the
Pancake\Logger
class. - Option to throw exceptions for unhandled errors.
- Allow configuration of ignored HTTP status codes.
- Option to log errors using the
- Handle errors internally with flexibility:
-
Testing:
- Provide unit and integration tests for the GitHub client class.
- Ensure comprehensive coverage for both success and error scenarios.
-
Documentation:
- Update the project documentation to include:
- Class overview.
- Usage examples for common operations.
- Explanation of error-handling options.
- Update the project documentation to include:
Benefits:
This feature will enhance Pancake's functionality by providing a robust and reusable interface for interacting with the GitHub API. It will simplify API calls and centralize error handling, promoting better maintainability and usability.
Notes:
- Ensure the class is extensible for potential future API endpoints.
- Maintain adherence to the Pancake project’s coding standards and structure.
Acceptance Criteria:
- The GitHub client class has been implemented and is fully tested.
- Documentation is updated with clear examples.
- The error-handling mechanism works as configured (logging, throwing exceptions, ignoring specific status codes).