Just another Python API for Travis CI (API).
A module which provides the requester object. It’s the object which communicates with the API endpoints.
- Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Project link:
- Project documentation:
MIT License Copyright (c) 2019, 2020 Nissar Chababy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Handles all our communication / requests to the Travis CI API.
This only provides lower level implementation. Meaning that you give it raw data and it provides you raw data in exchange. While working with this class, you don’t have access to enhanced feature provided by something like Resource Types objects.
You are not expected or invited to use this class directly if you don’t know what it may imply!
bind_endpoint_to_base_url(endpoint: str) → str¶
Binds the endpoint with the base url.
delete(endpoint: str, **kwargs) → dict¶
Sends a DELETE requests and returns the response.
get(endpoint: str, **kwargs) → dict¶
Sends a GET requests and returns the response.
get_error_message(api_response: dict, *, already_checked: bool = False) → Optional[str]¶
Provides the error message.
get_error_type(api_response: dict, *, already_checked: bool = False) → Optional[str]¶
Provides the error type.
head(endpoint: str, **kwargs) → dict¶
Sends a HEAD requests and returns the response.
is_error(api_response: dict) → bool¶
Checks if the API response is or contain an error as defined by the Travis CI API documentation.
options(endpoint: str, **kwargs) → dict¶
Sends a OPTIONS requests and returns the response.
patch(endpoint: str, **kwargs) → dict¶
Sends a PATCH requests and returns the response.
post(endpoint: str, **kwargs) → dict¶
Sends a POST requests and returns the response.
put(endpoint: str, **kwargs) → dict¶
Sends a PUT requests and returns the response.
raise_if_error(req: requests.models.Request, api_response: dict) → None¶
TravisCIErrorif the given API response contain an error.
A decorator which acts as an universal request factory.
Sets the authorization header.
Raises: TypeError – If
valueis not a string.