Module: Spotted::Internal::Type::RequestParameters::Converter Private

Included in:
Models::AlbumListParams, Models::AlbumListTracksParams, Models::AlbumRetrieveParams, Models::ArtistListAlbumsParams, Models::ArtistListParams, Models::ArtistListRelatedArtistsParams, Models::ArtistListTopTracksParams, Models::ArtistRetrieveParams, Models::AudioAnalysisRetrieveParams, Models::AudioFeatureListParams, Models::AudioFeatureRetrieveParams, Models::AudiobookListChaptersParams, Models::AudiobookListParams, Models::AudiobookRetrieveParams, Models::Browse::CategoryGetPlaylistsParams, Models::Browse::CategoryListParams, Models::Browse::CategoryRetrieveParams, Models::BrowseGetFeaturedPlaylistsParams, Models::BrowseGetNewReleasesParams, Models::ChapterListParams, Models::ChapterRetrieveParams, Models::EpisodeListParams, Models::EpisodeRetrieveParams, Models::MarketListParams, Models::Me::AlbumCheckParams, Models::Me::AlbumListParams, Models::Me::AlbumRemoveParams, Models::Me::AlbumSaveParams, Models::Me::AudiobookCheckParams, Models::Me::AudiobookListParams, Models::Me::AudiobookRemoveParams, Models::Me::AudiobookSaveParams, Models::Me::EpisodeCheckParams, Models::Me::EpisodeListParams, Models::Me::EpisodeRemoveParams, Models::Me::EpisodeSaveParams, Models::Me::FollowingCheckParams, Models::Me::FollowingFollowParams, Models::Me::FollowingListParams, Models::Me::FollowingUnfollowParams, Models::Me::Player::QueueAddParams, Models::Me::Player::QueueGetParams, Models::Me::PlayerGetCurrentlyPlayingParams, Models::Me::PlayerGetDevicesParams, Models::Me::PlayerGetStateParams, Models::Me::PlayerListRecentlyPlayedParams, Models::Me::PlayerPausePlaybackParams, Models::Me::PlayerSeekToPositionParams, Models::Me::PlayerSetRepeatModeParams, Models::Me::PlayerSetVolumeParams, Models::Me::PlayerSkipNextParams, Models::Me::PlayerSkipPreviousParams, Models::Me::PlayerStartPlaybackParams, Models::Me::PlayerToggleShuffleParams, Models::Me::PlayerTransferParams, Models::Me::PlaylistListParams, Models::Me::ShowCheckParams, Models::Me::ShowListParams, Models::Me::ShowRemoveParams, Models::Me::ShowSaveParams, Models::Me::TopListTopArtistsParams, Models::Me::TopListTopTracksParams, Models::Me::TrackCheckParams, Models::Me::TrackListParams, Models::Me::TrackRemoveParams, Models::Me::TrackSaveParams, Models::MeRetrieveParams, Models::PlaylistRetrieveParams, Models::PlaylistUpdateParams, Models::Playlists::FollowerCheckParams, Models::Playlists::FollowerFollowParams, Models::Playlists::FollowerUnfollowParams, Models::Playlists::ImageListParams, Models::Playlists::ImageUpdateParams, Models::Playlists::TrackAddParams, Models::Playlists::TrackListParams, Models::Playlists::TrackRemoveParams, Models::Playlists::TrackUpdateParams, Models::RecommendationGetParams, Models::RecommendationListAvailableGenreSeedsParams, Models::SearchRetrieveParams, Models::ShowListEpisodesParams, Models::ShowListParams, Models::ShowRetrieveParams, Models::TrackListParams, Models::TrackRetrieveParams, Models::UserRetrieveProfileParams, Models::Users::PlaylistCreateParams, Models::Users::PlaylistListParams, Models::WebhookUnwrapParams
Defined in:
lib/spotted/internal/type/request_parameters.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#dump_request(params) ⇒ Array(Object, Hash{Symbol=>Object})

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • params (Object)

Returns:

  • (Array(Object, Hash{Symbol=>Object}))


27
28
29
30
31
32
33
34
35
36
37
# File 'lib/spotted/internal/type/request_parameters.rb', line 27

def dump_request(params)
  state = {can_retry: true}
  case (dumped = dump(params, state: state))
  in Hash
    options = Spotted::Internal::Util.coerce_hash!(dumped[:request_options]).to_h
    request_options = state.fetch(:can_retry) ? options : {**options, max_retries: 0}
    [dumped.except(:request_options), request_options]
  else
    [dumped, nil]
  end
end