Format and .clang-format
This commit is contained in:
1 parent
6aed7b0027
commit
b94b634a87
47 files changed
+42341
-39711
No files matched your search
+262
-223
@@ -14,319 +14,358 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace Spotify {
|
||||
namespace Spotify
|
||||
{
|
||||
|
||||
// ============================================================================
|
||||
// Error Handling
|
||||
// ============================================================================
|
||||
// ============================================================================
|
||||
// Error Handling
|
||||
// ============================================================================
|
||||
|
||||
struct ApiError {
|
||||
int status;
|
||||
std::string message;
|
||||
std::string reason;
|
||||
struct ApiError {
|
||||
int status;
|
||||
std::string message;
|
||||
std::string reason;
|
||||
|
||||
auto GetStatus() const -> int { return status; }
|
||||
auto GetMessage() const -> const std::string & { return message; }
|
||||
};
|
||||
auto GetStatus() const -> int { return status; }
|
||||
auto GetMessage() const -> const std::string & { return message; }
|
||||
};
|
||||
|
||||
template <typename T> using Result = std::expected<T, ApiError>;
|
||||
template <typename T> using Result = std::expected<T, ApiError>;
|
||||
|
||||
// ============================================================================
|
||||
// HTTP Client Implementation Details
|
||||
// ============================================================================
|
||||
// ============================================================================
|
||||
// HTTP Client Implementation Details
|
||||
// ============================================================================
|
||||
|
||||
struct CurlDeleter {
|
||||
void operator()(CURL *ptr) const {
|
||||
if (ptr)
|
||||
curl_easy_cleanup(ptr);
|
||||
}
|
||||
};
|
||||
struct CurlDeleter {
|
||||
void operator()(CURL *ptr) const
|
||||
{
|
||||
if (ptr) {
|
||||
curl_easy_cleanup(ptr);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
enum class HttpMethod { GET, POST, PUT, DELETE };
|
||||
enum class HttpMethod { GET, POST, PUT, DELETE };
|
||||
|
||||
// ============================================================================
|
||||
// Main Spotify Client
|
||||
// ============================================================================
|
||||
// ============================================================================
|
||||
// Main Spotify Client
|
||||
// ============================================================================
|
||||
|
||||
class Client {
|
||||
public:
|
||||
Client(std::string accessToken);
|
||||
~Client() = default;
|
||||
class Client
|
||||
{
|
||||
public:
|
||||
|
||||
// Configuration
|
||||
void SetVerbose(bool verbose) { m_Verbose = verbose; }
|
||||
void SetProxy(ProxyConfig config) { m_Proxy = std::move(config); }
|
||||
void SetAccessToken(std::string token) { m_AccessToken = std::move(token); }
|
||||
Client(std::string accessToken);
|
||||
~Client() = default;
|
||||
|
||||
// ========================================================================
|
||||
// Albums API
|
||||
// ========================================================================
|
||||
// Configuration
|
||||
void SetVerbose(bool verbose) { m_Verbose = verbose; }
|
||||
void SetProxy(ProxyConfig config) { m_Proxy = std::move(config); }
|
||||
void SetAccessToken(std::string token)
|
||||
{
|
||||
m_AccessToken = std::move(token);
|
||||
}
|
||||
|
||||
auto GetAlbum(const std::string &id, std::optional<std::string> market = {})
|
||||
-> Result<Album>;
|
||||
// ========================================================================
|
||||
// Albums API
|
||||
// ========================================================================
|
||||
|
||||
auto GetAlbums(const std::vector<std::string> &ids,
|
||||
std::optional<std::string> market = {})
|
||||
-> Result<std::vector<Album>>;
|
||||
auto GetAlbum(const std::string &id,
|
||||
std::optional<std::string> market = {})
|
||||
-> Result<Album>;
|
||||
|
||||
auto GetAlbumTracks(const std::string &id,
|
||||
const Request::AlbumTracksParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedTrack>>;
|
||||
auto GetAlbums(const std::vector<std::string> &ids,
|
||||
std::optional<std::string> market = {})
|
||||
-> Result<std::vector<Album>>;
|
||||
|
||||
auto GetSavedAlbums(const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SavedAlbum>>;
|
||||
auto GetAlbumTracks(const std::string &id,
|
||||
const Request::AlbumTracksParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedTrack>>;
|
||||
|
||||
auto SaveAlbums(const std::vector<std::string> &ids) -> Result<void>;
|
||||
auto GetSavedAlbums(const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SavedAlbum>>;
|
||||
|
||||
auto RemoveSavedAlbums(const std::vector<std::string> &ids) -> Result<void>;
|
||||
auto SaveAlbums(const std::vector<std::string> &ids)
|
||||
-> Result<void>;
|
||||
|
||||
auto CheckSavedAlbums(const std::vector<std::string> &ids)
|
||||
-> Result<std::vector<bool>>;
|
||||
auto RemoveSavedAlbums(const std::vector<std::string> &ids)
|
||||
-> Result<void>;
|
||||
|
||||
auto GetNewReleases(const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedAlbum>>;
|
||||
auto CheckSavedAlbums(const std::vector<std::string> &ids)
|
||||
-> Result<std::vector<bool>>;
|
||||
|
||||
// ========================================================================
|
||||
// Artists API
|
||||
// ========================================================================
|
||||
auto GetNewReleases(const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedAlbum>>;
|
||||
|
||||
auto GetArtist(const std::string &id) -> Result<Artist>;
|
||||
// ========================================================================
|
||||
// Artists API
|
||||
// ========================================================================
|
||||
|
||||
auto GetArtists(const std::vector<std::string> &ids)
|
||||
-> Result<std::vector<Artist>>;
|
||||
auto GetArtist(const std::string &id) -> Result<Artist>;
|
||||
|
||||
auto GetArtistAlbums(const std::string &id,
|
||||
const Request::ArtistAlbumsParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedAlbum>>;
|
||||
auto GetArtists(const std::vector<std::string> &ids)
|
||||
-> Result<std::vector<Artist>>;
|
||||
|
||||
auto GetArtistTopTracks(const std::string &id, const std::string &market)
|
||||
-> Result<std::vector<Track>>;
|
||||
auto GetArtistAlbums(const std::string &id,
|
||||
const Request::ArtistAlbumsParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedAlbum>>;
|
||||
|
||||
auto GetArtistRelatedArtists(const std::string &id)
|
||||
-> Result<std::vector<Artist>>;
|
||||
auto GetArtistTopTracks(const std::string &id,
|
||||
const std::string &market)
|
||||
-> Result<std::vector<Track>>;
|
||||
|
||||
// ========================================================================
|
||||
// Tracks API
|
||||
// ========================================================================
|
||||
auto GetArtistRelatedArtists(const std::string &id)
|
||||
-> Result<std::vector<Artist>>;
|
||||
|
||||
auto GetTrack(const std::string &id, std::optional<std::string> market = {})
|
||||
-> Result<Track>;
|
||||
// ========================================================================
|
||||
// Tracks API
|
||||
// ========================================================================
|
||||
|
||||
auto GetTracks(const std::vector<std::string> &ids,
|
||||
std::optional<std::string> market = {})
|
||||
-> Result<std::vector<Track>>;
|
||||
auto GetTrack(const std::string &id,
|
||||
std::optional<std::string> market = {})
|
||||
-> Result<Track>;
|
||||
|
||||
auto GetSavedTracks(const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SavedTrack>>;
|
||||
auto GetTracks(const std::vector<std::string> &ids,
|
||||
std::optional<std::string> market = {})
|
||||
-> Result<std::vector<Track>>;
|
||||
|
||||
auto SaveTracks(const std::vector<std::string> &ids) -> Result<void>;
|
||||
auto GetSavedTracks(const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SavedTrack>>;
|
||||
|
||||
auto RemoveSavedTracks(const std::vector<std::string> &ids) -> Result<void>;
|
||||
auto SaveTracks(const std::vector<std::string> &ids)
|
||||
-> Result<void>;
|
||||
|
||||
auto CheckSavedTracks(const std::vector<std::string> &ids)
|
||||
-> Result<std::vector<bool>>;
|
||||
auto RemoveSavedTracks(const std::vector<std::string> &ids)
|
||||
-> Result<void>;
|
||||
|
||||
auto GetAudioFeatures(const std::string &id) -> Result<AudioFeatures>;
|
||||
auto CheckSavedTracks(const std::vector<std::string> &ids)
|
||||
-> Result<std::vector<bool>>;
|
||||
|
||||
auto GetAudioFeaturesForTracks(const std::vector<std::string> &ids)
|
||||
-> Result<std::vector<AudioFeatures>>;
|
||||
auto GetAudioFeatures(const std::string &id)
|
||||
-> Result<AudioFeatures>;
|
||||
|
||||
auto GetAudioAnalysis(const std::string &id) -> Result<AudioAnalysis>;
|
||||
auto GetAudioFeaturesForTracks(const std::vector<std::string> &ids)
|
||||
-> Result<std::vector<AudioFeatures>>;
|
||||
|
||||
auto GetRecommendations(const Request::RecommendationParams ¶ms)
|
||||
-> Result<Recommendations>;
|
||||
auto GetAudioAnalysis(const std::string &id)
|
||||
-> Result<AudioAnalysis>;
|
||||
|
||||
// ========================================================================
|
||||
// Search API
|
||||
// ========================================================================
|
||||
auto GetRecommendations(const Request::RecommendationParams ¶ms)
|
||||
-> Result<Recommendations>;
|
||||
|
||||
auto Search(const Request::SearchParams ¶ms) -> Result<SearchResults>;
|
||||
// ========================================================================
|
||||
// Search API
|
||||
// ========================================================================
|
||||
|
||||
auto SearchTracks(const Request::TrackSearchFilters &filters,
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<Track>>;
|
||||
auto Search(const Request::SearchParams ¶ms)
|
||||
-> Result<SearchResults>;
|
||||
|
||||
auto SearchAlbums(const Request::AlbumSearchFilters &filters,
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedAlbum>>;
|
||||
auto SearchTracks(const Request::TrackSearchFilters &filters,
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<Track>>;
|
||||
|
||||
auto SearchArtists(const Request::ArtistSearchFilters &filters,
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<Artist>>;
|
||||
auto SearchAlbums(const Request::AlbumSearchFilters &filters,
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedAlbum>>;
|
||||
|
||||
// ========================================================================
|
||||
// Playlists API
|
||||
// ========================================================================
|
||||
auto SearchArtists(const Request::ArtistSearchFilters &filters,
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<Artist>>;
|
||||
|
||||
auto GetPlaylist(const std::string &id,
|
||||
std::optional<std::string> market = {}) -> Result<Playlist>;
|
||||
// ========================================================================
|
||||
// Playlists API
|
||||
// ========================================================================
|
||||
|
||||
auto GetPlaylistTracks(const std::string &id,
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<PlaylistTrack>>;
|
||||
auto GetPlaylist(const std::string &id,
|
||||
std::optional<std::string> market = {})
|
||||
-> Result<Playlist>;
|
||||
|
||||
auto CreatePlaylist(const std::string &user_id,
|
||||
const Request::CreatePlaylistParams ¶ms)
|
||||
-> Result<Playlist>;
|
||||
auto GetPlaylistTracks(const std::string &id,
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<PlaylistTrack>>;
|
||||
|
||||
auto UpdatePlaylist(const std::string &id,
|
||||
const Request::UpdatePlaylistParams ¶ms)
|
||||
-> Result<void>;
|
||||
auto CreatePlaylist(const std::string &user_id,
|
||||
const Request::CreatePlaylistParams ¶ms)
|
||||
-> Result<Playlist>;
|
||||
|
||||
auto AddTracksToPlaylist(const std::string &id,
|
||||
const Request::AddTracksToPlaylistParams ¶ms)
|
||||
-> Result<std::string>;
|
||||
auto UpdatePlaylist(const std::string &id,
|
||||
const Request::UpdatePlaylistParams ¶ms)
|
||||
-> Result<void>;
|
||||
|
||||
auto RemoveTracksFromPlaylist(
|
||||
const std::string &id,
|
||||
const Request::RemoveTracksFromPlaylistParams ¶ms)
|
||||
-> Result<std::string>;
|
||||
auto AddTracksToPlaylist(
|
||||
const std::string &id,
|
||||
const Request::AddTracksToPlaylistParams ¶ms)
|
||||
-> Result<std::string>;
|
||||
|
||||
auto ReorderPlaylistTracks(const std::string &id,
|
||||
const Request::ReorderPlaylistParams ¶ms)
|
||||
-> Result<std::string>;
|
||||
auto RemoveTracksFromPlaylist(
|
||||
const std::string &id,
|
||||
const Request::RemoveTracksFromPlaylistParams ¶ms)
|
||||
-> Result<std::string>;
|
||||
|
||||
auto ReplacePlaylistTracks(const std::string &id,
|
||||
const Request::ReplacePlaylistTracksParams ¶ms)
|
||||
-> Result<void>;
|
||||
auto ReorderPlaylistTracks(
|
||||
const std::string &id,
|
||||
const Request::ReorderPlaylistParams ¶ms)
|
||||
-> Result<std::string>;
|
||||
|
||||
auto GetCurrentUserPlaylists(const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedPlaylist>>;
|
||||
auto ReplacePlaylistTracks(
|
||||
const std::string &id,
|
||||
const Request::ReplacePlaylistTracksParams ¶ms)
|
||||
-> Result<void>;
|
||||
|
||||
auto GetUserPlaylists(const std::string &user_id,
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedPlaylist>>;
|
||||
auto GetCurrentUserPlaylists(
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedPlaylist>>;
|
||||
|
||||
auto GetFeaturedPlaylists(const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedPlaylist>>;
|
||||
auto GetUserPlaylists(const std::string &user_id,
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedPlaylist>>;
|
||||
|
||||
auto GetCategoryPlaylists(const std::string &category_id,
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedPlaylist>>;
|
||||
auto GetFeaturedPlaylists(
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedPlaylist>>;
|
||||
|
||||
// ========================================================================
|
||||
// User API
|
||||
// ========================================================================
|
||||
auto GetCategoryPlaylists(
|
||||
const std::string &category_id,
|
||||
const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<SimplifiedPlaylist>>;
|
||||
|
||||
auto GetCurrentUser() -> Result<User>;
|
||||
// ========================================================================
|
||||
// User API
|
||||
// ========================================================================
|
||||
|
||||
auto GetUser(const std::string &user_id) -> Result<User>;
|
||||
auto GetCurrentUser() -> Result<User>;
|
||||
|
||||
auto GetTopArtists(const Request::TopItemsParams ¶ms = {})
|
||||
-> Result<PagingObject<Artist>>;
|
||||
auto GetUser(const std::string &user_id) -> Result<User>;
|
||||
|
||||
auto GetTopTracks(const Request::TopItemsParams ¶ms = {})
|
||||
-> Result<PagingObject<Track>>;
|
||||
auto GetTopArtists(const Request::TopItemsParams ¶ms = {})
|
||||
-> Result<PagingObject<Artist>>;
|
||||
|
||||
// ========================================================================
|
||||
// Follow API
|
||||
// ========================================================================
|
||||
auto GetTopTracks(const Request::TopItemsParams ¶ms = {})
|
||||
-> Result<PagingObject<Track>>;
|
||||
|
||||
auto FollowArtistsOrUsers(const Request::FollowParams ¶ms)
|
||||
-> Result<void>;
|
||||
// ========================================================================
|
||||
// Follow API
|
||||
// ========================================================================
|
||||
|
||||
auto UnfollowArtistsOrUsers(const Request::UnfollowParams ¶ms)
|
||||
-> Result<void>;
|
||||
auto FollowArtistsOrUsers(const Request::FollowParams ¶ms)
|
||||
-> Result<void>;
|
||||
|
||||
auto CheckFollowingArtistsOrUsers(const Request::CheckFollowingParams ¶ms)
|
||||
-> Result<std::vector<bool>>;
|
||||
auto UnfollowArtistsOrUsers(const Request::UnfollowParams ¶ms)
|
||||
-> Result<void>;
|
||||
|
||||
auto GetFollowedArtists(std::optional<int> limit = {},
|
||||
std::optional<std::string> after = {})
|
||||
-> Result<CursorPagingObject<Artist>>;
|
||||
auto CheckFollowingArtistsOrUsers(
|
||||
const Request::CheckFollowingParams ¶ms)
|
||||
-> Result<std::vector<bool>>;
|
||||
|
||||
auto FollowPlaylist(const std::string &playlist_id,
|
||||
const Request::FollowPlaylistParams ¶ms = {})
|
||||
-> Result<void>;
|
||||
auto GetFollowedArtists(std::optional<int> limit = {},
|
||||
std::optional<std::string> after = {})
|
||||
-> Result<CursorPagingObject<Artist>>;
|
||||
|
||||
auto UnfollowPlaylist(const std::string &playlist_id) -> Result<void>;
|
||||
auto
|
||||
FollowPlaylist(const std::string &playlist_id,
|
||||
const Request::FollowPlaylistParams ¶ms = {})
|
||||
-> Result<void>;
|
||||
|
||||
auto CheckFollowingPlaylist(const std::string &playlist_id,
|
||||
const std::vector<std::string> &user_ids)
|
||||
-> Result<std::vector<bool>>;
|
||||
auto UnfollowPlaylist(const std::string &playlist_id)
|
||||
-> Result<void>;
|
||||
|
||||
// ========================================================================
|
||||
// Player API
|
||||
// ========================================================================
|
||||
auto
|
||||
CheckFollowingPlaylist(const std::string &playlist_id,
|
||||
const std::vector<std::string> &user_ids)
|
||||
-> Result<std::vector<bool>>;
|
||||
|
||||
auto GetPlaybackState(std::optional<std::string> market = {})
|
||||
-> Result<PlaybackState>;
|
||||
// ========================================================================
|
||||
// Player API
|
||||
// ========================================================================
|
||||
|
||||
auto GetAvailableDevices() -> Result<std::vector<Device>>;
|
||||
auto GetPlaybackState(std::optional<std::string> market = {})
|
||||
-> Result<PlaybackState>;
|
||||
|
||||
auto GetCurrentlyPlayingTrack(std::optional<std::string> market = {})
|
||||
-> Result<PlaybackState>;
|
||||
auto GetAvailableDevices() -> Result<std::vector<Device>>;
|
||||
|
||||
auto StartOrResumePlayback(const Request::PlayParams ¶ms,
|
||||
std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
auto
|
||||
GetCurrentlyPlayingTrack(std::optional<std::string> market = {})
|
||||
-> Result<PlaybackState>;
|
||||
|
||||
auto PausePlayback(std::optional<std::string> device_id = {}) -> Result<void>;
|
||||
auto
|
||||
StartOrResumePlayback(const Request::PlayParams ¶ms,
|
||||
std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
|
||||
auto SkipToNext(std::optional<std::string> device_id = {}) -> Result<void>;
|
||||
auto PausePlayback(std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
|
||||
auto SkipToPrevious(std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
auto SkipToNext(std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
|
||||
auto SeekToPosition(int position_ms,
|
||||
std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
auto SkipToPrevious(std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
|
||||
auto SetRepeatMode(RepeatMode mode, std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
auto SeekToPosition(int position_ms,
|
||||
std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
|
||||
auto SetPlaybackVolume(int volume_percent,
|
||||
std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
auto SetRepeatMode(RepeatMode mode,
|
||||
std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
|
||||
auto TogglePlaybackShuffle(bool state,
|
||||
std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
auto SetPlaybackVolume(int volume_percent,
|
||||
std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
|
||||
auto TransferPlayback(const Request::TransferPlaybackParams ¶ms)
|
||||
-> Result<void>;
|
||||
auto
|
||||
TogglePlaybackShuffle(bool state,
|
||||
std::optional<std::string> device_id = {})
|
||||
-> Result<void>;
|
||||
|
||||
auto AddToQueue(const Request::QueueParams ¶ms) -> Result<void>;
|
||||
auto TransferPlayback(const Request::TransferPlaybackParams ¶ms)
|
||||
-> Result<void>;
|
||||
|
||||
auto GetRecentlyPlayedTracks(std::optional<int> limit = {},
|
||||
std::optional<int64_t> after = {},
|
||||
std::optional<int64_t> before = {})
|
||||
-> Result<CursorPagingObject<PlaylistTrack>>;
|
||||
auto AddToQueue(const Request::QueueParams ¶ms) -> Result<void>;
|
||||
|
||||
// ========================================================================
|
||||
// Browse API
|
||||
// ========================================================================
|
||||
auto GetRecentlyPlayedTracks(std::optional<int> limit = {},
|
||||
std::optional<int64_t> after = {},
|
||||
std::optional<int64_t> before = {})
|
||||
-> Result<CursorPagingObject<PlaylistTrack>>;
|
||||
|
||||
auto GetCategories(const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<Category>>;
|
||||
// ========================================================================
|
||||
// Browse API
|
||||
// ========================================================================
|
||||
|
||||
auto GetCategory(const std::string &category_id,
|
||||
std::optional<std::string> locale = {}) -> Result<Category>;
|
||||
auto GetCategories(const Request::PaginationParams ¶ms = {})
|
||||
-> Result<PagingObject<Category>>;
|
||||
|
||||
auto GetAvailableGenreSeeds() -> Result<std::vector<std::string>>;
|
||||
auto GetCategory(const std::string &category_id,
|
||||
std::optional<std::string> locale = {})
|
||||
-> Result<Category>;
|
||||
|
||||
auto GetAvailableMarkets() -> Result<std::vector<std::string>>;
|
||||
auto GetAvailableGenreSeeds() -> Result<std::vector<std::string>>;
|
||||
|
||||
private:
|
||||
std::string m_AccessToken;
|
||||
ProxyConfig m_Proxy;
|
||||
bool m_Verbose = false;
|
||||
auto GetAvailableMarkets() -> Result<std::vector<std::string>>;
|
||||
|
||||
auto PerformRequest(const std::string &url,
|
||||
HttpMethod method = HttpMethod::GET,
|
||||
const std::string &body = "",
|
||||
const std::vector<std::string> &extra_headers = {})
|
||||
-> Result<std::string>;
|
||||
private:
|
||||
|
||||
static auto WriteCallback(void *contents, size_t size, size_t nmemb,
|
||||
std::string *out) -> size_t;
|
||||
std::string m_AccessToken;
|
||||
ProxyConfig m_Proxy;
|
||||
bool m_Verbose = false;
|
||||
|
||||
auto BuildUrl(const std::string &endpoint,
|
||||
const std::map<std::string, std::string> ¶ms = {}) const
|
||||
-> std::string;
|
||||
auto BuildUrl(const std::string &endpoint,
|
||||
const Request::RequestParams ¶ms) const -> std::string;
|
||||
auto UrlEncode(const std::string &value) const -> std::string;
|
||||
};
|
||||
auto PerformRequest(
|
||||
const std::string &url,
|
||||
HttpMethod method = HttpMethod::GET,
|
||||
const std::string &body = "",
|
||||
const std::vector<std::string> &extra_headers = {})
|
||||
-> Result<std::string>;
|
||||
|
||||
static auto WriteCallback(void *contents, size_t size, size_t nmemb,
|
||||
std::string *out) -> size_t;
|
||||
|
||||
auto BuildUrl(const std::string &endpoint,
|
||||
const std::map<std::string, std::string> ¶ms = {})
|
||||
const -> std::string;
|
||||
auto BuildUrl(const std::string &endpoint,
|
||||
const Request::RequestParams ¶ms) const
|
||||
-> std::string;
|
||||
auto UrlEncode(const std::string &value) const -> std::string;
|
||||
};
|
||||
|
||||
} // namespace Spotify
|
||||
Reference in new issue
Block a user