Пример #1
0
        static public async Task <Group> Create(Api api, string name, string title)
        {
            UpdateGroupParams data = new UpdateGroupParams()
            {
                name  = name,
                title = title
            };

            return(await Create(api, data));
        }
Пример #2
0
        static public async Task <Group> Create(Api api, UpdateGroupParams data)
        {
            if (string.IsNullOrEmpty(data.owner_usernames))
            {
                data.owner_usernames = api.Settings.ApiUsername;
            }
            JObject j = new JObject();

            j["group"] = data.ToJObject();
            j          = await api.PostAsync(Api.Combine("admin", "groups"), null, j);

            return(j["basic_group"].ToObject <Group>());
        }