Skip to main content

UserLogin

Struct UserLogin 

Source
pub struct UserLogin {
    pub login_type: String,
    pub username: String,
    pub password: String,
    pub optional: HashMap<String, Value>,
}
Expand description

This request must be sent over a TLS-encrypted link. It authenticates the Pandora user by sending his username, usually his email address, and password as well as the partnerAuthToken obtained by Partner login.

Additional response data can be requested by setting flags listed below.

| Name | Type | Description | | loginType | string | “user” | | username | string | Username | | password | string | User’s password | | partnerAuthToken | string | Partner token obtained by Partner login | | returnGenreStations | boolean | (optional) | | returnCapped | boolean | return isCapped parameter (optional) | | includePandoraOneInfo | boolean | (optional) | | includeDemographics | boolean | (optional) | | includeAdAttributes | boolean | (optional) | | returnStationList | boolean | Return station list, see Retrieve station list (optional) | | includeStationArtUrl | boolean | (optional) | | includeStationSeeds | boolean | (optional) | | includeShuffleInsteadOfQuickMix | boolean | (optional) | | stationArtSize | string | W130H130(optional) | | returnCollectTrackLifetimeStats | boolean | (optional) | | returnIsSubscriber | boolean | (optional) | | xplatformAdCapable | boolean | (optional) | | complimentarySponsorSupported | boolean | (optional) | | includeSubscriptionExpiration | boolean | (optional) | | returnHasUsedTrial | boolean | (optional) | | returnUserstate | boolean | (optional) | | includeAccountMessage | boolean | (optional) | | includeUserWebname | boolean | (optional) | | includeListeningHours | boolean | (optional) | | includeFacebook | boolean | (optional) | | includeTwitter | boolean | (optional) | | includeDailySkipLimit | boolean | (optional) | | includeSkipDelay | boolean | (optional) | | includeGoogleplay | boolean | (optional) | | includeShowUserRecommendations | boolean | (optional) | | includeAdvertiserAttributes | boolean | (optional) |

{
   "loginType": "user",
   "username": "user@example.com",
   "password": "example",
   "partnerAuthToken": "VAzrFQTtsy3BQ3K+3iqFi0WF5HA63B1nFA",
   "includePandoraOneInfo":true,
   "includeAdAttributes":true,
   "includeSubscriptionExpiration":true,
   "includeStationArtUrl":true,
   "returnStationList":true,
   "returnGenreStations":true,
   "syncTime": 1335777573
}

Fields§

§login_type: String

This field should always have the value user.

§username: String

The account username to login with.

§password: String

The account password to login with.

§optional: HashMap<String, Value>

Optional parameters on the call

Implementations§

Source§

impl UserLogin

Source

pub fn new(username: &str, password: &str) -> Self

Initialize a basic UserLogin request. All optional fields are set to None.

Source

pub fn and_boolean_option(self, option: &str, value: bool) -> Self

Convenience function for setting boolean flags in the request. (Chaining call)

Source

pub fn and_string_option(self, option: &str, value: &str) -> Self

Convenience function for setting string flags in the request. (Chaining call)

Source

pub fn return_genre_stations(self, value: bool) -> Self

Whether request should return genre stations in the response. (Chaining call)

Source

pub fn return_capped(self, value: bool) -> Self

Whether request should return capped in the response. (Chaining call)

Source

pub fn include_pandora_one_info(self, value: bool) -> Self

Whether request should include PandoraOne info in the response. (Chaining call)

Source

pub fn include_demographics(self, value: bool) -> Self

Whether request should include demographics in the response. (Chaining call)

Source

pub fn include_ad_attributes(self, value: bool) -> Self

Whether request should include ad attributes in the response. (Chaining call)

Source

pub fn return_station_list(self, value: bool) -> Self

Whether request should return station list in the response. (Chaining call)

Source

pub fn include_station_art_url(self, value: bool) -> Self

Whether request should include the station art url in the response. (Chaining call)

Source

pub fn include_station_seeds(self, value: bool) -> Self

Whether request should include the station seeds in the response. (Chaining call)

Source

pub fn include_shuffle_instead_of_quick_mix(self, value: bool) -> Self

Whether request should include shuffle stations instead of quickmix in the response. (Chaining call)

Source

pub fn station_art_size(self, value: &str) -> Self

The size of station art to include in the response (if includeStationArlUrl was set). (Chaining call)

Source

pub fn return_collect_track_lifetime_stats(self, value: bool) -> Self

Whether request should return collect track lifetime stats in the response. (Chaining call)

Source

pub fn return_is_subscriber(self, value: bool) -> Self

Whether request should return whether the user is a subscriber in the response. (Chaining call)

Source

pub fn xplatform_ad_capable(self, value: bool) -> Self

Whether the requesting client is cross-platform ad capable. (Chaining call)

Source

pub fn complimentary_sponsor_supported(self, value: bool) -> Self

Whether the complimentary sponsors are supported. (Chaining call)

Source

pub fn include_subscription_expiration(self, value: bool) -> Self

Whether request should include subscription expiration in the response. (Chaining call)

Source

pub fn return_has_used_trial(self, value: bool) -> Self

Whether request should return whether the user has used their trial subscription in the response. (Chaining call)

Source

pub fn return_userstate(self, value: bool) -> Self

Whether request should return user state in the response. (Chaining call)

Source

pub fn include_account_message(self, value: bool) -> Self

Whether request should return account message in the response. (Chaining call)

Source

pub fn include_user_webname(self, value: bool) -> Self

Whether request should include user webname in the response. (Chaining call)

Source

pub fn include_listening_hours(self, value: bool) -> Self

Whether request should include listening hours in the response. (Chaining call)

Source

pub fn include_facebook(self, value: bool) -> Self

Whether request should include facebook connections in the response. (Chaining call)

Source

pub fn include_twitter(self, value: bool) -> Self

Whether request should include twitter connections in the response. (Chaining call)

Source

pub fn include_daily_skip_limit(self, value: bool) -> Self

Whether request should include daily skip limit in the response. (Chaining call)

Source

pub fn include_skip_delay(self, value: bool) -> Self

Whether request should include the track skip delay in the response. (Chaining call)

Source

pub fn include_googleplay(self, value: bool) -> Self

Whether request should include Google Play metadata in the response. (Chaining call)

Source

pub fn include_show_user_recommendations(self, value: bool) -> Self

Whether request should include the user recommendations in the response. (Chaining call)

Source

pub fn include_advertiser_attributes(self, value: bool) -> Self

Whether request should include advertiser attributes in the response. (Chaining call)

Source

pub async fn merge_response( &self, session: &mut PandoraSession, ) -> Result<UserLoginResponse, Error>

This is a wrapper around the response method from the PandoraJsonApiRequest trait that automatically merges the user tokens from the response back into the session.

Trait Implementations§

Source§

impl Clone for UserLogin

Source§

fn clone(&self) -> UserLogin

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UserLogin

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PandoraJsonApiRequest for UserLogin

Source§

type Response = UserLoginResponse

The type that the json response will be deserialized to.
Source§

type Error = Error

The Error type to be returned by fallible calls on this trait.
Source§

fn encrypt_request(&self) -> bool

Whether the json body of the API call is expected to be encrypted before transmission.
Source§

fn get_method(&self) -> String

Returns the name of the Pandora JSON API call in the form that it must appear when making that call.
Source§

fn get_json(&self) -> Result<Value, Self::Error>

Returns the root json Value that should be serialized into the body of the API call.
Source§

fn request( &self, session: &PandoraSession, ) -> Result<RequestBuilder, Self::Error>

Generate an HTTP request that, when send() is called on it, will submit the built request.
Source§

fn response<'life0, 'life1, 'async_trait>( &'life0 self, session: &'life1 mut PandoraSession, ) -> Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Build the request, submit it, and extract the response content from the body json, and deserialize it into the Self::Response type.
Source§

impl Serialize for UserLogin

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more