mock.endpoints — HTTP response overrides¶
Response variants you assign to mock.endpoints.<field>. See each field's type for accepted shape.
Configuration surface¶
EndpointResponses
dataclass
¶
EndpointResponses(storefront: StorefrontSetter = None, account: AccountSetter = None, station_next_tracks: StationNextTracksSetter = None, continuous_stations: ContinuousStationsSetter = None, license_catalog_song: LicenseCatalogSongSetter = None, license_hls_offers: LicenseHlsOffersSetter = None, license_live_radio: LicenseLiveRadioSetter = None, web_playback: WebPlaybackSetter = None, play_assets_catalog_song: PlayAssetsCatalogSongSetter = None, play_assets_live_audio: PlayAssetsLiveAudioSetter = None, play_assets_live_video: PlayAssetsLiveVideoSetter = None, play_assets_broadcast: PlayAssetsBroadcastSetter = None, widevine_cert: WidevineCertSetter = None, fairplay_cert: FairPlayCertSetter = None, webplayer_logout: LogoutSetter = None, play_activity: PlayActivitySetter = None, renew_music_token: RenewTokenSetter = None)
Per-endpoint response overrides and endpoint-only state.
Each setter overrides or parametrizes one specific endpoint's response.
Fields default to None; reading an unset setter raises ValueError.
Each setter's accepted shape (static value, callable arity, dict keying)
is on its type alias.
Attributes:
| Name | Type | Description |
|---|---|---|
storefront |
StorefrontSetter
|
Override for |
account |
AccountSetter
|
Override for |
station_next_tracks |
StationNextTracksSetter
|
Override for the station next-tracks endpoint. Keyed by station id; value is the list of follow-up track ids. |
continuous_stations |
ContinuousStationsSetter
|
Override for the continuous-stations endpoint. |
license_catalog_song |
LicenseCatalogSongSetter
|
Override for the catalog-song license acquisition endpoint, keyed by adam id. |
license_hls_offers |
LicenseHlsOffersSetter
|
Override for the HLS-offers license acquisition endpoint, keyed by adam id. |
license_live_radio |
LicenseLiveRadioSetter
|
Override for the live-radio license acquisition endpoint, keyed by station id. |
web_playback |
WebPlaybackSetter
|
Override for the web-playback endpoint, keyed by salable adam id. |
play_assets_catalog_song |
PlayAssetsCatalogSongSetter
|
Override for catalog-song play-assets, keyed by adam id. |
play_assets_live_audio |
PlayAssetsLiveAudioSetter
|
Override for live-audio play-assets, keyed by station id. |
play_assets_live_video |
PlayAssetsLiveVideoSetter
|
Override for live-video play-assets, keyed by station id. |
play_assets_broadcast |
PlayAssetsBroadcastSetter
|
Override for broadcast play-assets, keyed by station id. |
widevine_cert |
WidevineCertSetter
|
Override for the Widevine certificate fetch endpoint. |
fairplay_cert |
FairPlayCertSetter
|
Override for the FairPlay certificate fetch endpoint. |
webplayer_logout |
LogoutSetter
|
Override for the web-player logout endpoint. |
play_activity |
PlayActivitySetter
|
Override for the play-activity reporting endpoint. |
renew_music_token |
RenewTokenSetter
|
Override for the music-token renewal endpoint. |
Account¶
Account
dataclass
¶
Apple Music subscriber account state.
Attributes:
| Name | Type | Description |
|---|---|---|
subscription_active |
bool
|
Whether the account has an active Apple Music subscription. |
subscription_storefront |
str
|
Storefront identifier the subscription is scoped to. |
AccountResponse
module-attribute
¶
AccountResponseSuccess
dataclass
¶
200 success carrying the active account.
Attributes:
| Name | Type | Description |
|---|---|---|
account |
Account
|
The active account returned to the caller. |
AccountResponseFailure
dataclass
¶
Generic non-2xx failure that MusicKit rejects without state change.
AccountResponseSessionExpired
dataclass
¶
Auth-rejected response that triggers MusicKit's session reset.
Storefront¶
Storefront
dataclass
¶
Storefront(id: str, name: str, default_language_tag: str, supported_language_tags: list[str], explicit_content_policy: Literal['allowed', 'opt-in', 'opt-out'])
One Apple Music storefront's identity and language config.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Storefront identifier (typically a two-letter country code). |
name |
str
|
Display name of the storefront. |
default_language_tag |
str
|
BCP-47 default language for the storefront. |
supported_language_tags |
list[str]
|
BCP-47 language tags the storefront serves. |
explicit_content_policy |
Literal['allowed', 'opt-in', 'opt-out']
|
Storefront-level explicit-content policy —
one of |
StorefrontResponse
module-attribute
¶
StorefrontResponse = StorefrontResponseSuccess | StorefrontResponseSessionExpired | StorefrontResponseFailure
StorefrontResponseSuccess
dataclass
¶
200 success carrying the active storefront.
Attributes:
| Name | Type | Description |
|---|---|---|
storefront |
Storefront
|
The active storefront returned to the caller. |
StorefrontResponseFailure
dataclass
¶
Generic non-2xx failure that MusicKit rejects without state change.
StorefrontResponseSessionExpired
dataclass
¶
Auth-rejected response that triggers MusicKit's session reset.
Renew token¶
RenewTokenResponse
module-attribute
¶
RenewTokenResponseSuccess
dataclass
¶
200 success carrying the renewed music token.
Attributes:
| Name | Type | Description |
|---|---|---|
music_token |
str | None
|
Renewed music token. Leave unset to emit a 200 with no token body, matching Apple's no-renewal response. |
RenewTokenResponseUnauthorized
dataclass
¶
401 response that triggers MusicKit's user-token revoke.
Logout¶
LogoutResponseSuccess
dataclass
¶
200 success for the logout endpoint.
The caller swallows the body, so the response carries no fields.
Play activity¶
PlayActivityResponseSuccess
dataclass
¶
200 success for the fire-and-forget play-activity endpoint.
The endpoint is fire-and-forget, so the response carries no fields.
Web playback¶
WebPlaybackContext
dataclass
¶
Context for the web-playback setter.
Attributes:
| Name | Type | Description |
|---|---|---|
salable_adam_id |
str
|
Salable adam id the web-playback request is for. |
WebPlaybackSong
dataclass
¶
WebPlaybackSong(hls_key_cert_url: str, hls_key_server_url: str, widevine_cert_url: str, assets: list[WebPlaybackAsset], song_id: str, hls_playlist_url: str | None = None)
Per-song web-playback payload (DRM URLs, asset list, optional HLS).
Attributes:
| Name | Type | Description |
|---|---|---|
hls_key_cert_url |
str
|
FairPlay certificate endpoint for HLS playback. |
hls_key_server_url |
str
|
License-acquisition endpoint for HLS playback. |
widevine_cert_url |
str
|
Widevine certificate endpoint. |
assets |
list[WebPlaybackAsset]
|
Per-variant playback assets for the song. |
song_id |
str
|
Catalog song id the payload is for. |
hls_playlist_url |
str | None
|
Optional HLS master-playlist URL when an HLS rendition is available alongside the asset variants. |
WebPlaybackAsset
dataclass
¶
WebPlaybackAsset(flavor: str, url: str, metadata: dict[str, _JSONValue] | None = None, artwork_url: str | None = None)
One playback asset variant (URL plus optional metadata).
Attributes:
| Name | Type | Description |
|---|---|---|
flavor |
str
|
Apple-defined flavor tag describing the asset bitrate or
codec (e.g. |
url |
str
|
URL of the asset media. |
metadata |
dict[str, _JSONValue] | None
|
Optional metadata payload Apple emits alongside the asset. |
artwork_url |
str | None
|
Optional artwork URL specific to this asset variant. |
WebPlaybackResponse
module-attribute
¶
WebPlaybackResponse = WebPlaybackResponseSuccess | WebPlaybackResponseUnsupportedError | WebPlaybackResponseMediaLicense | WebPlaybackResponseDeviceLimit | WebPlaybackResponseGeoBlock | WebPlaybackResponseNotFound | WebPlaybackResponseAuthorizationError | WebPlaybackResponseTokenExpired | WebPlaybackResponseSubscriptionError | WebPlaybackResponseContentUnavailable | WebPlaybackResponseContentRestricted | WebPlaybackResponseStreamUpsell | WebPlaybackResponseServerError | WebPlaybackResponsePlayReadyCbcEncryptionError | WebPlaybackResponseWidevineCdmExpired
WebPlaybackResponseSuccess
dataclass
¶
200 response carrying one or more song payloads.
Attributes:
| Name | Type | Description |
|---|---|---|
song_list |
list[WebPlaybackSong]
|
Per-song web-playback payloads returned to the caller. |
WebPlaybackResponseAuthorizationError
dataclass
¶
failureType=2002 body that triggers AUTHORIZATION_ERROR (revoke).
WebPlaybackResponseContentRestricted
dataclass
¶
failureType=3082 body that triggers CONTENT_RESTRICTED.
WebPlaybackResponseContentUnavailable
dataclass
¶
failureType=3076 body that triggers CONTENT_UNAVAILABLE.
WebPlaybackResponseDeviceLimit
dataclass
¶
failureType body that triggers DEVICE_LIMIT (mock emits the canonical code).
WebPlaybackResponseGeoBlock
dataclass
¶
failureType=-1017 body that triggers GEO_BLOCK.
WebPlaybackResponseMediaLicense
dataclass
¶
failureType=-1003 body that triggers MEDIA_LICENSE.
WebPlaybackResponseNotFound
dataclass
¶
failureType=1010 body that triggers NOT_FOUND.
WebPlaybackResponsePlayReadyCbcEncryptionError
dataclass
¶
failureType=180202 body for PlayReady CBC encryption error.
WebPlaybackResponseServerError
dataclass
¶
failureType=5002 body that triggers SERVER_ERROR.
WebPlaybackResponseStreamUpsell
dataclass
¶
failureType=3084 body that triggers STREAM_UPSELL.
WebPlaybackResponseSubscriptionError
dataclass
¶
failureType=3063 body that triggers SUBSCRIPTION_ERROR.
WebPlaybackResponseTokenExpired
dataclass
¶
failureType=2034 body that triggers TOKEN_EXPIRED (renew + retry).
WebPlaybackResponseUnsupportedError
dataclass
¶
Empty songList body that triggers UNSUPPORTED_ERROR.
WebPlaybackResponseWidevineCdmExpired
dataclass
¶
failureType=190121 body for Widevine CDM expired.
License (DRM)¶
LicenseCatalogSongContext
dataclass
¶
Context for the catalog-song license setter.
Attributes:
| Name | Type | Description |
|---|---|---|
adam_id |
str
|
Catalog song id the license is being acquired for. |
key_system |
KeySystem
|
DRM key-system identifier of the requesting CDM. |
is_library |
bool
|
Whether the licensed playback is for the library counterpart (vs. the catalog song). |
LicenseHlsOffersContext
dataclass
¶
Context for the HLS-offers license setter.
Attributes:
| Name | Type | Description |
|---|---|---|
adam_id |
str
|
Catalog song id the HLS-offers license is for. |
key_system |
KeySystem
|
DRM key-system identifier of the requesting CDM. |
LicenseLiveRadioContext
dataclass
¶
Context for the live-radio license setter.
Attributes:
| Name | Type | Description |
|---|---|---|
station_id |
str
|
Catalog station id the live-radio license is for. |
key_system |
KeySystem
|
DRM key-system identifier of the requesting CDM. |
LicenseResponse
module-attribute
¶
LicenseResponse = LicenseResponseSuccess | LicenseResponseMediaLicense | LicenseResponseDeviceLimit | LicenseResponseGeoBlock | LicenseResponseNotFound | LicenseResponseAuthorizationError | LicenseResponseTokenExpired | LicenseResponseSubscriptionError | LicenseResponseContentUnavailable | LicenseResponseContentRestricted | LicenseResponseStreamUpsell | LicenseResponseServerError | LicenseResponsePlayReadyCbcEncryptionError | LicenseResponseWidevineCdmExpired
LicenseResponseSuccess
dataclass
¶
200 success carrying the license blob and optional renewal/session token.
Attributes:
| Name | Type | Description |
|---|---|---|
license |
bytes
|
License blob bytes returned to the CDM. |
renew_after |
int | None
|
Seconds until the client should renew the license. |
stkn |
str | None
|
Optional session token associated with the license. |
LicenseResponseAuthorizationError
dataclass
¶
Body status=2002 that triggers AUTHORIZATION_ERROR (user-token revoke).
LicenseResponseContentRestricted
dataclass
¶
Body status=3082 that triggers CONTENT_RESTRICTED.
LicenseResponseContentUnavailable
dataclass
¶
Body status=3076 that triggers CONTENT_UNAVAILABLE.
LicenseResponseDeviceLimit
dataclass
¶
Body status that triggers DEVICE_LIMIT (mock emits the canonical code).
LicenseResponseGeoBlock
dataclass
¶
Body status=-1017 that triggers GEO_BLOCK.
LicenseResponseMediaLicense
dataclass
¶
Body status=-1003 that triggers MEDIA_LICENSE.
LicenseResponseNotFound
dataclass
¶
Body status=1010 that triggers NOT_FOUND.
LicenseResponsePlayReadyCbcEncryptionError
dataclass
¶
Body status=180202 that triggers PLAYREADY_CBC_ENCRYPTION_ERROR.
LicenseResponseServerError
dataclass
¶
Body status=5002 that triggers SERVER_ERROR.
LicenseResponseStreamUpsell
dataclass
¶
Body status=3084 that triggers STREAM_UPSELL.
LicenseResponseSubscriptionError
dataclass
¶
Body status=3063 that triggers SUBSCRIPTION_ERROR.
LicenseResponseTokenExpired
dataclass
¶
Body status=2034 that triggers TOKEN_EXPIRED (token renew + retry).
LicenseResponseWidevineCdmExpired
dataclass
¶
Body status=190121 that triggers WIDEVINE_CDM_EXPIRED.
MusicKit also rewrites body status=-1021 to 190121 before
dispatch; the mock emits 190121 directly.
DRM certificates¶
FairPlayCertResponse
module-attribute
¶
FairPlayCertResponseSuccess
dataclass
¶
Success carrying the FairPlay certificate bytes.
Attributes:
| Name | Type | Description |
|---|---|---|
cert |
bytes
|
Raw FairPlay certificate bytes. |
FairPlayCertResponseFailure
dataclass
¶
Cert fetch failure.
MusicKit reads the body bytes only; an HTTP non-OK status is enough to signal failure.
WidevineCertResponse
module-attribute
¶
WidevineCertResponseSuccess
dataclass
¶
Success carrying the Widevine certificate bytes.
Attributes:
| Name | Type | Description |
|---|---|---|
cert |
bytes
|
Raw Widevine certificate bytes. |
WidevineCertResponseFailure
dataclass
¶
Cert fetch failure.
MusicKit reads the body bytes only; an HTTP non-OK status is enough to signal failure.
Play assets — catalog song¶
PlayAssetsCatalogSongContext
dataclass
¶
Context for the catalog-song play-assets setter.
Attributes:
| Name | Type | Description |
|---|---|---|
adam_id |
str
|
Catalog song id the play-asset is for. |
PlayAssetsCatalogSongAsset
dataclass
¶
PlayAssetsCatalogSongAsset(url: str, fair_play_key_certificate_url: str, key_server_url: str, widevine_key_certificate_url: str)
One catalog-song play-asset (URL plus DRM endpoints).
Attributes:
| Name | Type | Description |
|---|---|---|
url |
str
|
URL of the catalog-song media. |
fair_play_key_certificate_url |
str
|
FairPlay certificate endpoint. |
key_server_url |
str
|
License-acquisition endpoint. |
widevine_key_certificate_url |
str
|
Widevine certificate endpoint. |
PlayAssetsCatalogSongResponse
module-attribute
¶
PlayAssetsCatalogSongResponse = PlayAssetsCatalogSongResponseSuccess | PlayAssetsCatalogSongResponseContentUnavailable
PlayAssetsCatalogSongResponseSuccess
dataclass
¶
200 response carrying catalog-song assets.
Attributes:
| Name | Type | Description |
|---|---|---|
assets |
list[PlayAssetsCatalogSongAsset]
|
Catalog-song play-assets returned to the caller. |
PlayAssetsCatalogSongResponseContentUnavailable
dataclass
¶
Any outcome MusicKit lumps into CONTENT_UNAVAILABLE.
For the catalog-song path MusicKit does not branch on HTTP status:
empty assets, missing results, or any non-2xx body that parses as
JSON all surface as CONTENT_UNAVAILABLE. The mock emits an empty assets
body.
Play assets — live audio¶
PlayAssetsLiveAudioContext
dataclass
¶
Context for the live-audio play-assets setter.
Attributes:
| Name | Type | Description |
|---|---|---|
station_id |
str
|
Catalog station id the live-audio play-asset is for. |
PlayAssetsLiveAudioAsset
dataclass
¶
PlayAssetsLiveAudioAsset(url: str, fair_play_key_certificate_url: str, key_server_url: str, widevine_key_certificate_url: str)
One live-audio play-asset (URL plus DRM endpoints).
Attributes:
| Name | Type | Description |
|---|---|---|
url |
str
|
URL of the live-audio media. |
fair_play_key_certificate_url |
str
|
FairPlay certificate endpoint. |
key_server_url |
str
|
License-acquisition endpoint. |
widevine_key_certificate_url |
str
|
Widevine certificate endpoint. |
PlayAssetsLiveAudioResponse
module-attribute
¶
PlayAssetsLiveAudioResponse = PlayAssetsLiveAudioResponseSuccess | PlayAssetsLiveAudioResponseEmptyAssets | PlayAssetsLiveAudioResponseServerError | PlayAssetsLiveAudioResponseSubscriptionError | PlayAssetsLiveAudioResponseAccessDenied | PlayAssetsLiveAudioResponseContentUnavailable
PlayAssetsLiveAudioResponseSuccess
dataclass
¶
200 response carrying live-audio assets.
Attributes:
| Name | Type | Description |
|---|---|---|
assets |
list[PlayAssetsLiveAudioAsset]
|
Live-audio play-assets returned to the caller. |
PlayAssetsLiveAudioResponseAccessDenied
dataclass
¶
403 with body errors[0].code != "40303" that triggers ACCESS_DENIED.
PlayAssetsLiveAudioResponseContentUnavailable
dataclass
¶
Other non-2xx response, lumped by MusicKit as CONTENT_UNAVAILABLE.
PlayAssetsLiveAudioResponseEmptyAssets
dataclass
¶
200 with an empty asset list that triggers CONTENT_UNAVAILABLE.
PlayAssetsLiveAudioResponseServerError
dataclass
¶
500 response that triggers SERVER_ERROR.
PlayAssetsLiveAudioResponseSubscriptionError
dataclass
¶
403 with body errors[0].code = "40303" that triggers SUBSCRIPTION_ERROR.
Play assets — live video¶
PlayAssetsLiveVideoContext
dataclass
¶
Context for the live-video play-assets setter.
Attributes:
| Name | Type | Description |
|---|---|---|
station_id |
str
|
Catalog station id the live-video play-asset is for. |
PlayAssetsLiveVideoAsset
dataclass
¶
PlayAssetsLiveVideoAsset(url: str, fair_play_key_certificate_url: str, key_server_url: str, widevine_key_certificate_url: str)
One live-video play-asset (URL plus DRM endpoints).
Attributes:
| Name | Type | Description |
|---|---|---|
url |
str
|
URL of the live-video media. |
fair_play_key_certificate_url |
str
|
FairPlay certificate endpoint. |
key_server_url |
str
|
License-acquisition endpoint. |
widevine_key_certificate_url |
str
|
Widevine certificate endpoint. |
PlayAssetsLiveVideoResponse
module-attribute
¶
PlayAssetsLiveVideoResponse = PlayAssetsLiveVideoResponseSuccess | PlayAssetsLiveVideoResponseEmptyAssets | PlayAssetsLiveVideoResponseServerError | PlayAssetsLiveVideoResponseSubscriptionError | PlayAssetsLiveVideoResponseAccessDenied | PlayAssetsLiveVideoResponseContentUnavailable
PlayAssetsLiveVideoResponseSuccess
dataclass
¶
200 response carrying live-video assets.
Attributes:
| Name | Type | Description |
|---|---|---|
assets |
list[PlayAssetsLiveVideoAsset]
|
Live-video play-assets returned to the caller. |
PlayAssetsLiveVideoResponseAccessDenied
dataclass
¶
403 with body errors[0].code != "40303" that triggers ACCESS_DENIED.
PlayAssetsLiveVideoResponseContentUnavailable
dataclass
¶
Other non-2xx response, lumped by MusicKit as CONTENT_UNAVAILABLE.
PlayAssetsLiveVideoResponseEmptyAssets
dataclass
¶
200 with an empty asset list that triggers CONTENT_UNAVAILABLE.
PlayAssetsLiveVideoResponseServerError
dataclass
¶
500 response that triggers SERVER_ERROR.
PlayAssetsLiveVideoResponseSubscriptionError
dataclass
¶
403 with body errors[0].code = "40303" that triggers SUBSCRIPTION_ERROR.
Play assets — broadcast¶
PlayAssetsBroadcastContext
dataclass
¶
Context for the broadcast play-assets setter.
Attributes:
| Name | Type | Description |
|---|---|---|
station_id |
str
|
Catalog station id the broadcast play-asset is for. |
PlayAssetsBroadcastAsset
dataclass
¶
One broadcast play-asset (URL only; broadcast plays unencrypted).
Attributes:
| Name | Type | Description |
|---|---|---|
url |
str
|
URL of the broadcast media. |
PlayAssetsBroadcastResponse
module-attribute
¶
PlayAssetsBroadcastResponse = PlayAssetsBroadcastResponseSuccess | PlayAssetsBroadcastResponseEmptyAssets | PlayAssetsBroadcastResponseServerError | PlayAssetsBroadcastResponseSubscriptionError | PlayAssetsBroadcastResponseAccessDenied | PlayAssetsBroadcastResponseContentUnavailable
PlayAssetsBroadcastResponseSuccess
dataclass
¶
PlayAssetsBroadcastResponseSuccess(assets: list[PlayAssetsBroadcastAsset], track_info: dict[str, _JSONValue] | None = None)
200 response carrying broadcast assets and optional track-info payload.
Attributes:
| Name | Type | Description |
|---|---|---|
assets |
list[PlayAssetsBroadcastAsset]
|
Broadcast play-assets returned to the caller. |
track_info |
dict[str, _JSONValue] | None
|
Optional |
PlayAssetsBroadcastResponseAccessDenied
dataclass
¶
403 with body errors[0].code != "40303" that triggers ACCESS_DENIED.
PlayAssetsBroadcastResponseContentUnavailable
dataclass
¶
Other non-2xx response, lumped by MusicKit as CONTENT_UNAVAILABLE.
PlayAssetsBroadcastResponseEmptyAssets
dataclass
¶
200 with an empty asset list that triggers CONTENT_UNAVAILABLE.
PlayAssetsBroadcastResponseServerError
dataclass
¶
500 response that triggers SERVER_ERROR.
PlayAssetsBroadcastResponseSubscriptionError
dataclass
¶
403 with body errors[0].code = "40303" that triggers SUBSCRIPTION_ERROR.
Continuous stations¶
ContinuousStation
dataclass
¶
Result a continuous-stations setter returns.
Attributes:
| Name | Type | Description |
|---|---|---|
station |
Station
|
The resolved station. |
tracks |
list[str] | None
|
Initial follow-up track ids for the station. Leave unset to let the mock omit the tracks block. |
ContinuousStationsContext
dataclass
¶
Context for the continuous-stations setter.
Attributes:
| Name | Type | Description |
|---|---|---|
seeds |
list[StationSeed] | None
|
Seeds the request specified, or |
StationContextPlayAsset
dataclass
¶
One bit-rate variant of a station's play asset.
Attributes:
| Name | Type | Description |
|---|---|---|
bit_rate |
int
|
Bitrate of the variant in kilobits per second. |
url |
str
|
URL of the variant's media. |
StationNextTracksContext
dataclass
¶
Context for the station next-tracks setter.
Attributes:
| Name | Type | Description |
|---|---|---|
station_id |
str
|
Catalog station id the next-tracks request is for. |
limit |
int
|
Maximum number of follow-up tracks the request asked for. |
StationSeed
dataclass
¶
StationSeed(id: str, type: Literal['songs', 'library-songs', 'music-videos'], container_id: str | None = None)
Seed item passed to the continuous-stations endpoint.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Catalog or library id of the seed resource. |
type |
Literal['songs', 'library-songs', 'music-videos']
|
Seed resource type — one of |
container_id |
str | None
|
Optional containing resource id (e.g. album id of a song seed) when MusicKit JS includes one. |
ContinuousStationsResponse
module-attribute
¶
ContinuousStationsResponse = ContinuousStationsResponseSuccess | ContinuousStationsResponseContentUnsupported | ContinuousStationsResponseNoStation
ContinuousStationsResponseSuccess
dataclass
¶
200 response carrying the resolved continuous station.
Attributes:
| Name | Type | Description |
|---|---|---|
continuous_station |
ContinuousStation
|
The resolved station with optional track ids. |
ContinuousStationsResponseContentUnsupported
dataclass
¶
Non-empty body.errors[] that triggers CONTENT_UNSUPPORTED.
Attributes:
| Name | Type | Description |
|---|---|---|
errors |
list[ErrorEnvelope]
|
Error envelopes carried in the response body. |
ContinuousStationsResponseNoStation
dataclass
¶
results.station missing that triggers CONTENT_UNAVAILABLE.
Error envelope¶
ErrorEnvelope
dataclass
¶
ErrorEnvelope(code: str, title: str, status: str, detail: str | None = None, source: dict[str, _JSONValue] | None = None)
One entry in the Apple errors envelope (body.errors[]).
Attributes:
| Name | Type | Description |
|---|---|---|
code |
str
|
Apple error code string. |
title |
str
|
Short error title. |
status |
str
|
HTTP status code carried in the envelope as a string. |
detail |
str | None
|
Long-form error detail. |
source |
dict[str, _JSONValue] | None
|
Source object indicating which input triggered the error. |