Esempio n. 1
0
        public static async Task <XboxProfile> GetProfileAsync(string Gamertag)
        {
            string Endpoint       = string.Format("/friends/search?gt={0}", Gamertag);
            Uri    RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint));
            string Response       = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false);

            return(new XboxProfile(Response));
        }
Esempio n. 2
0
        public static async Task <XboxProfile> GetProfileAsync()
        {
            string Endpoint       = "/account";
            Uri    RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint));
            string Response       = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false);

            return(new XboxProfile(Response));
        }
Esempio n. 3
0
        public static async Task <Friend> GetSummaryAsync()
        {
            string Endpoint       = "/player/summary";
            Uri    RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint));
            string Response       = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false);

            return(new Friend(Response));
        }
Esempio n. 4
0
        public static async Task <Conversation> GetConversationAsync(string xuid)
        {
            string Endpoint       = string.Format("/conversations/{0}", xuid);
            Uri    RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint));
            string Response       = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false);

            return(Conversation.DeserializeJSON(Response));
        }
Esempio n. 5
0
        public static async Task <List <Friend> > GetFriendsAsync()
        {
            string Endpoint       = "/friends";
            Uri    RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint));
            string Response       = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false);

            List <Friend> Return = new List <Friend>();
            List <JToken> tokens = new List <JToken>(JObject.Parse(Response).SelectTokens("people"));

            foreach (JToken t in tokens.Children())
            {
                Return.Add(new Friend(Person.DeserializeJSON(t)));
            }
            return(Return);
        }
Esempio n. 6
0
        public static async Task <List <Alert> > GetAlertsAsync()
        {
            string Endpoint       = "/alerts";
            Uri    RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint));
            string Response       = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false);

            List <JToken> tokens = new List <JToken>(JObject.Parse(Response).SelectTokens("alerts"));
            List <Alert>  l      = new List <Alert>();

            foreach (JToken t in tokens.Children())
            {
                l.Add(Alert.DeserializeJSON(t));
            }
            return(l);
        }
Esempio n. 7
0
 public static async Task RemoveFriendAsync(string xuid)
 {
     string Endpoint       = string.Format("/friends/remove/{0}", xuid);
     Uri    RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint));
     string Response       = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false);
 }