Module endpoints

Module endpoints 

Source
Expand description

Type-safe Spotify API endpoint paths

This module provides a typed enum for all Spotify API endpoints, eliminating string formatting errors and providing a single source of truth for endpoint paths.

§Design Pattern

The Endpoint enum represents URL paths, not operations. Multiple endpoint wrapper files in src/endpoints/ can share the same variant when they use different HTTP methods:

  • Endpoint::PlaylistTracks → GET (get_playlist_items), POST (add_items), DELETE (remove_items)
  • Endpoint::PlayerState → GET (get_playback_state), PUT (transfer_playback)
  • Endpoint::SavedTracksIds → PUT (save_tracks), DELETE (remove_tracks)

This follows REST conventions: same URL, different HTTP verbs for different operations.

Enums§

Endpoint
Spotify API endpoint paths