musixmatch.api.ResponseStatusCode Class Reference
Inheritance diagram for musixmatch.api.ResponseStatusCode:
Inheritance graph
Collaboration diagram for musixmatch.api.ResponseStatusCode:
Collaboration graph

Public Member Functions

def __str__ (self)
 
def __repr__ (self)
 
def __nonzero__ (self)
 
def __str__ (self)
 
def __repr__ (self)
 
def __nonzero__ (self)
 
def __str__ (self)
 
def __repr__ (self)
 
def __nonzero__ (self)
 
def __str__ (self)
 
def __repr__ (self)
 
def __nonzero__ (self)
 

Static Private Attributes

dictionary __status__
 

Detailed Description

Represents response message status code. Casting a
:py:class:`ResponseStatusCode` to :py:class:`str` returns the message
associated with the status code:

>>> from musixmatch.api import ResponseStatusCode
>>> str(ResponseStatusCode(200))
'The request was successful.'
>>> str(ResponseStatusCode(401))
'Authentication failed, probably because of a bad API key.'

The status code to description mapping is:

+------+-----------------------------------------------------------+
| Code | Description                                               |
+======+===========================================================+
| 200  | The request was successful.                               |
+------+-----------------------------------------------------------+
| 400  | The request had bad syntax or was inherently              |
|      | impossible to be satisfied.                               |
+------+-----------------------------------------------------------+
| 401  | Authentication failed, probably because of a bad API key. |
+------+-----------------------------------------------------------+
| 402  | A limit was reached, either you exceeded per hour         |
|      | requests limits or your balance is insufficient.          |
+------+-----------------------------------------------------------+
| 403  | You are not authorized to perform this operation or       |
|      | the api version you're trying to use has been shut down.  |
+------+-----------------------------------------------------------+
| 404  | Requested resource was not found.                         |
+------+-----------------------------------------------------------+
| 405  | Requested method was not found.                           |
+------+-----------------------------------------------------------+

Any other status code will produce a default message:

>>> from musixmatch.api import ResponseStatusCode
>>> str(ResponseStatusCode(666))
'Unknown status code 666!'

Casting a :py:class:`ResponseStatusCode` to :py:class:`bool` returns True if
status code is 200, False otherwise:

>>> from musixmatch.api import ResponseStatusCode
>>> bool(ResponseStatusCode(200))
True
>>> bool(ResponseStatusCode(400))
False
>>> bool(ResponseStatusCode(666))
False

Definition at line 47 of file musixmatch-master/build/lib/musixmatch/api.py.

Member Function Documentation

def musixmatch.api.ResponseStatusCode.__nonzero__ (   self)
def musixmatch.api.ResponseStatusCode.__nonzero__ (   self)
def musixmatch.api.ResponseStatusCode.__nonzero__ (   self)

Definition at line 119 of file musixmatch-master/musixmatch/api.py.

def musixmatch.api.ResponseStatusCode.__nonzero__ (   self)

Definition at line 119 of file Yading/musixmatch-master/musixmatch/api.py.

def musixmatch.api.ResponseStatusCode.__repr__ (   self)
def musixmatch.api.ResponseStatusCode.__repr__ (   self)
def musixmatch.api.ResponseStatusCode.__repr__ (   self)

Definition at line 116 of file musixmatch-master/musixmatch/api.py.

def musixmatch.api.ResponseStatusCode.__repr__ (   self)

Definition at line 116 of file Yading/musixmatch-master/musixmatch/api.py.

def musixmatch.api.ResponseStatusCode.__str__ (   self)
def musixmatch.api.ResponseStatusCode.__str__ (   self)

Definition at line 113 of file musixmatch-master/musixmatch/api.py.

def musixmatch.api.ResponseStatusCode.__str__ (   self)

Definition at line 113 of file Yading/musixmatch-master/musixmatch/api.py.

def musixmatch.api.ResponseStatusCode.__str__ (   self)

Field Documentation

dictionary musixmatch.api.ResponseStatusCode.__status__
staticprivate
Initial value:
1 = {
2  200: "The request was successful.",
3  400: "The request had bad syntax or was inherently " + \
4  "impossible to be satisfied.",
5  401: "Authentication failed, probably because of a bad API key.",
6  402: "A limit was reached, either you exceeded per hour " + \
7  "requests limits or your balance is insufficient.",
8  403: "You are not authorized to perform this operation or " + \
9  "the api version you're trying to use has been shut down.",
10  404: "Requested resource was not found.",
11  405: "Requested method was not found.",
12  }

Definition at line 100 of file musixmatch-master/build/lib/musixmatch/api.py.


The documentation for this class was generated from the following file: