2018-10-22 17:40:16 +00:00
|
|
|
from .cards_object import CardsObject
|
|
|
|
|
|
|
|
class ArenaId(CardsObject):
|
|
|
|
"""
|
|
|
|
cards/id
|
|
|
|
Get a card by the Arena id.
|
|
|
|
|
2018-10-23 21:32:44 +00:00
|
|
|
Args:
|
|
|
|
id (string):
|
2018-10-24 00:54:28 +00:00
|
|
|
The Arena Id of the card.
|
2018-10-23 21:32:44 +00:00
|
|
|
format (string, optional):
|
|
|
|
Defaults to 'json'.
|
|
|
|
Returns data in the specified method.
|
|
|
|
face (string, optional):
|
|
|
|
Defaults to empty string.
|
|
|
|
If you're using the `image` format, this will specify if you want the front or back face.
|
|
|
|
version (string, optional):
|
|
|
|
Defaults to empty string.
|
|
|
|
If you're using the `image` format, this will specify if you want the small, normal,
|
|
|
|
large, etc version of the image.
|
|
|
|
pretty (string, optional):
|
|
|
|
Defaults to empty string.
|
|
|
|
Returns a prettier version of the json object.
|
|
|
|
Note that this may break functionality with Scrython.
|
2018-10-22 17:40:16 +00:00
|
|
|
|
2018-10-26 21:24:34 +00:00
|
|
|
Returns:
|
|
|
|
N/A
|
|
|
|
|
2018-10-24 00:54:28 +00:00
|
|
|
Raises:
|
|
|
|
Exception: If the 'id' parameter is not provided.
|
|
|
|
Exception: If the object returned is an error.
|
2018-10-22 17:40:16 +00:00
|
|
|
|
2018-10-26 21:24:34 +00:00
|
|
|
Examples:
|
2018-10-22 17:40:16 +00:00
|
|
|
>>> card = scrython.cards.ArenaId(id="66975")
|
|
|
|
>>> card.name()
|
|
|
|
"""
|
|
|
|
def __init__(self, **kwargs):
|
|
|
|
if kwargs.get('id') is None:
|
2018-10-24 00:54:28 +00:00
|
|
|
raise Exception('No id provided to search by')
|
2018-10-22 17:40:16 +00:00
|
|
|
|
|
|
|
self.url = 'cards/arena/{}?'.format(str(kwargs.get('id')))
|
|
|
|
super(ArenaId, self).__init__(self.url)
|