spotifywebapipython.spotifyapimessage

@export
class SpotifyApiMessage:

A class representing an exchange object between a client and the Spotify Web API.

SpotifyApiMessage( methodName: str, uri: str, urlParameters: dict = None, requestData: dict = None, requestHeaders: dict = None)

Initializes a new instance of the class.

Arguments:
  • methodName (str): Name of the client method that executed the request.
  • uri (str): Target uri which should be queried.
  • urlParameters (dict): Parameter values to be placed into the http request url, if the specified uri service requires it; otherwise, None.
  • requestData (dict): Request data that is to be placed into the http request body, if the specified uri service requires it; otherwise, None.
  • requestHeaders (dict): Request header that is to be placed into the http request headers, if the specified uri service requires it; otherwise, None.
HasRequestData: bool

Returns True if request data is present, and should be supplied as part of the http request body; otherwise, False.

HasRequestHeaders: bool

Returns True if request headers are present, and should be supplied as part of the http request headers; otherwise, False.

HasRequestJson: bool

Returns True if request json is present, and should be supplied as part of the http request body; otherwise, False.

HasUrlParameters: bool

Returns True if url parameters are present, and should be supplied as part of the http request url; otherwise, False.

HasResponseData: bool

Returns True if data was returned with the response; otherwise, False.

IsRequestDataEncoded: bool

Indicates if the RequestData property is already encoded (True) or not (False).

IsResponseEmpty: bool

Returns True if the response contains no data (e.g. a pass / fail response) and is not null; otherwise, False.

IsSimpleResponse: bool

Returns True if the response contains no data (e.g. a pass / fail response); otherwise, False if the response requires further processing.

MethodName: str

The client method that executed the request.

Example: GetArtist.

RequestData: dict

Request data that is to be placed into the http request body, if the specified uri service requires it.

RequestHeaders: Mapping[str, str]

Request header data that is to be sent with the http request body, if the specified uri service requires it.

RequestJson: dict

Request data that is to be placed into the http request body, if the specified uri service requires it.

ResponseData: dict

Response data returned from the server, if the specified uri returned a response that contains data.

Uri: str

Target uri which should be queried.

UrlParameters: dict

Parameter values to be placed into the http request url, if the specified uri service requires it.

def ToString(self) -> str:

Returns a displayable string representation of the class.