GetProfileEntitiesRequest¶
- class wwt_api_client.communities.GetProfileEntitiesRequest(communities_client)[source]¶
Bases:
CommunitiesAPIRequest
Get “entities” associated with the logged-in user.
Entities include communities, folders, and content files. The response is JSON.
Attributes Summary
What page of search results to return -- starting at 1.
What kind of entity to query.
How many items to return per page of search results.
Methods Summary
Check whether the parameters of this request are valid.
Generate a
requests.Request
from the current parameters.Attributes Documentation
- current_page = 1¶
What page of search results to return – starting at 1.
- entity_type = 'Content'¶
What kind of entity to query. Only COMMUNITY and CONTENT are allowed.
- page_size = 99999¶
How many items to return per page of search results.
Methods Documentation
- invalidity_reason()[source]¶
Check whether the parameters of this request are valid.
- Returns:
- reasonstring or None
If None, indicates that this request is valid. Otherwise, the returned string explains what about the request’ parameters is invalid.
Examples
You can manually check if a request is correctly set up:
>>> from wwt_api_client import Client >>> req = Client().show_image('http://example.com/space.jpg', 'My Image') >>> assert req.invalidity_reason() is None
- make_request()[source]¶
Generate a
requests.Request
from the current parameters.This method returns a
requests.Request
object ready for sending to the API server.- Returns:
- request
requests.Request
object The HTTP request.
- request
Examples
Get the URL that will be accessed for a request:
>>> from urllib.parse import urlparse >>> from wwt_api_client import Client >>> req = Client().show_image('http://example.com/space.jpg', 'My Image') >>> parsed_url = urlparse(req.make_request().prepare().url) >>> print(parsed_url.path) /WWTWeb/ShowImage.aspx