Exemple #1
0
 public static string GetUserLogin(Setting setting, User user)
 {
     return(Fallball.Call <String>(setting, HttpMethod.Get, string.Format("resellers/{0}/clients/{1}/users/{2}/link",
                                                                          FbReseller.GetId(user.Tenant.App),
                                                                          FbClient.GetId(user.Tenant),
                                                                          GetId(user)
                                                                          )));
 }
Exemple #2
0
 public static void Delete(Setting setting, User user)
 {
     Fallball.Call <User>(setting, HttpMethod.Delete,
                          string.Format("resellers/{0}/clients/{1}/users/{2}",
                                        FbReseller.GetId(user.Tenant.App),
                                        FbClient.GetId(user.Tenant),
                                        GetId(user)));
 }
Exemple #3
0
        public static string Create(Setting setting, User user)
        {
            var u = new FbUser {
                Email = user.Email, Admin = true, Storage = new Storage {
                    Limit = UsersStorage
                }
            };

            var fbUser = Fallball.Call <FbUser>(setting, HttpMethod.Post,
                                                string.Format("resellers/{0}/clients/{1}/users/",
                                                              FbReseller.GetId(user.Tenant.App),
                                                              FbClient.GetId(user.Tenant)),
                                                JsonConvert.SerializeObject(u));

            return(fbUser.UserId);
        }
Exemple #4
0
        public static void Update(Setting setting, Tenant tenant)
        {
            var c = new FbClient {
                Name = GetId(tenant), Storage = new Storage {
                    Limit = tenant.DiskspaceLimit
                }
            };
            var body = JsonConvert.SerializeObject(c);

            var fbReseller = Fallball.Call <FbReseller>(
                setting,
                HttpMethod.Get,
                string.Format("resellers/{0}", FbReseller.GetId(tenant.App)));

            Fallball.Call <FbClient>(
                setting,
                HttpMethod.Put,
                string.Format("resellers/{0}/clients/{1}/", FbReseller.GetId(tenant.App), GetId(tenant)),
                body,
                fbReseller.Token);
        }