File tree Expand file tree Collapse file tree 1 file changed +30
-3
lines changed Expand file tree Collapse file tree 1 file changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -24,21 +24,49 @@ use crate::graph::prelude::Accounts;
2424pub struct Me {
2525 name : String ,
2626 id : String ,
27+ last_name : String ,
2728 first_name : String ,
28- picture : FacebookPictureUserPicture ,
29+ picture : PictureData ,
2930 email : String ,
3031}
3132
33+ impl Me {
34+ pub fn name ( & self ) -> & str {
35+ & self . name
36+ }
37+ pub fn id ( & self ) -> & str {
38+ & self . id
39+ }
40+ pub fn first_name ( & self ) -> & str {
41+ & self . first_name
42+ }
43+ pub fn picture ( & self ) -> & PictureData {
44+ & self . picture
45+ }
46+ pub fn email ( & self ) -> & str {
47+ & self . email
48+ }
49+ pub fn last_name ( & self ) -> & str {
50+ & self . last_name
51+ }
52+ }
53+
3254#[ derive( Deserialize , Serialize ) ]
3355 pub struct PictureData {
34- data : FacebookPictureUserPicture
56+ pub data : FacebookPictureUserPicture
3557}
3658
3759#[ derive( Deserialize , Serialize ) ]
3860pub struct FacebookPictureUserPicture {
3961 url : String ,
4062}
4163
64+ impl FacebookPictureUserPicture {
65+ pub fn url ( & self ) -> & str {
66+ & self . url
67+ }
68+ }
69+
4270#[ derive( Clone , Debug , Deserialize , Serialize ) ]
4371pub struct MeApi {
4472 url : String ,
@@ -50,7 +78,6 @@ impl MeApi {
5078 url : graph_base. replace ( "NODE" , "me" ) ,
5179 }
5280 }
53-
5481 pub fn url ( & self ) -> & str {
5582 & self . url
5683 }
You can’t perform that action at this time.
0 commit comments