pandora_rs2/
method.rs

1#[derive(Clone)]
2pub enum Method {
3    TestCheckLicensing,
4
5    AuthPartnerLogin,
6    AuthUserLogin,
7
8    MusicSearch,
9
10    UserGetStationList,
11    UserGetStationListChecksum,
12
13    StationCreateStation,
14    StationRenameStation,
15    StationDeleteStation,
16
17    StationGetStation,
18    StationAddMusic,
19    StationDeleteMusic,
20
21    StationGetPlaylist,
22    StationAddFeedback,
23}
24
25impl ToString for Method {
26    fn to_string(&self) -> String {
27        match *self {
28            Method::TestCheckLicensing => "test.checkLicensing".to_owned(),
29
30            Method::AuthPartnerLogin => "auth.partnerLogin".to_owned(),
31            Method::AuthUserLogin => "auth.userLogin".to_owned(),
32
33            Method::MusicSearch => "music.search".to_owned(),
34
35            Method::UserGetStationList => "user.getStationList".to_owned(),
36            Method::UserGetStationListChecksum => "user.getStationListChecksum".to_owned(),
37
38            Method::StationCreateStation => "station.createStation".to_owned(),
39            Method::StationRenameStation => "station.renameStation".to_owned(),
40            Method::StationDeleteStation => "station.deleteStation".to_owned(),
41
42            Method::StationGetStation => "station.getStation".to_owned(),
43            Method::StationAddMusic => "station.addMusic".to_owned(),
44            Method::StationDeleteMusic => "station.deleteMusic".to_owned(),
45
46            Method::StationGetPlaylist => "station.getPlaylist".to_owned(),
47            Method::StationAddFeedback => "station.addFeedback".to_owned(),
48        }
49    }
50}
51
52impl Method {
53    pub fn is_encrypted(&self) -> bool {
54        match *self {
55            Method::TestCheckLicensing | Method::AuthPartnerLogin => false,
56            _ => true,
57        }
58    }
59}