pub struct Partner {
pub username: String,
pub password: String,
pub device_model: String,
pub version: String,
pub encrypt_password: String,
pub decrypt_password: String,
pub endpoint_host: String,
}
Expand description
A convenience type that can produce valid PartnerLogin instances for a number of different endpoints and device types.
Fields§
§username: String
The partner login name (not the account-holder’s username) used to authenticate the application with the Pandora service.
password: String
The partner login password (not the account-holder’s username) used to authenticate the application with the Pandora service.
device_model: String
The partner device model name.
version: String
The Pandora JSON API version
encrypt_password: String
The encryption key associated with this partner login
decrypt_password: String
The decryption key associated with this partner login
endpoint_host: String
The hostname for the endpoint used to communicate with the Pandora API. This is a bare hostname, without scheme/protocol. This value will later be combined with a scheme and path to create a complete, valid URL.
Implementations§
Source§impl Partner
impl Partner
Sourcepub fn new_android() -> Self
pub fn new_android() -> Self
Generate a Partner instance using the android app credentials
Sourcepub fn new_windows_mobile() -> Self
pub fn new_windows_mobile() -> Self
Generate a Partner instance using the Windows Mobile credentials
Sourcepub fn new_desktop_air() -> Self
pub fn new_desktop_air() -> Self
Generate a Partner instance using the Desktop AIR credentials
Sourcepub fn new_vista_widget() -> Self
pub fn new_vista_widget() -> Self
Generate a Partner instance using the Vista widget credentials
Sourcepub fn init_session(&self) -> PandoraSession
pub fn init_session(&self) -> PandoraSession
Initialize a PandoraSession using the corresponding Partner tokens and endpoint.
Sourcepub fn to_partner_login(&self) -> PartnerLogin
pub fn to_partner_login(&self) -> PartnerLogin
Generate a PartnerLogin instance from this object that can be used for initiating authentication with the service.
Sourcepub async fn login(
&self,
session: &mut PandoraSession,
) -> Result<PartnerLoginResponse, Error>
pub async fn login( &self, session: &mut PandoraSession, ) -> Result<PartnerLoginResponse, Error>
Convenience method for submitting the partner login request for this partner.
Trait Implementations§
Source§impl ToEncryptionTokens for Partner
impl ToEncryptionTokens for Partner
Source§impl ToEndpoint for Partner
impl ToEndpoint for Partner
Source§fn to_endpoint(&self) -> String
fn to_endpoint(&self) -> String
Returns the service endpoint to be used for this session as a String.