BoxKite.Twitter.UsersExtensions.ChangeAccountProfile C# (CSharp) Метод

ChangeAccountProfile() публичный статический Метод

Sets values that users are able to set under the "Account" tab of their settings page. Only the parameters specified will be updated.
ref: https://dev.twitter.com/docs/api/1.1/post/account/update_profile
public static ChangeAccountProfile ( this session, string name = "", string profileUrl = "", string location = "", string description = "" ) : Task
session this
name string Full name associated with the profile. Maximum of 20 characters.
profileUrl string URL associated with the profile. Will be prepended with "http://" if not present. Maximum of 100 characters.
location string The city or country describing where the user of the account is located.
description string A description of the user owning the account. Maximum of 160 characters.
Результат Task
        public static async Task<User> ChangeAccountProfile(this IUserSession session, string name = "",
            string profileUrl = "", string location = "", string description = "")
        {
            var parameters = new TwitterParametersCollection();
            parameters.Create(include_entities: true,skip_status:true);

            // first 20 chars
            if (!string.IsNullOrWhiteSpace(name))
            {
                parameters.Add("name", name.TrimAndTruncate(20));
            }

            // first 100 chars
            if (!string.IsNullOrWhiteSpace(profileUrl))
            {
                parameters.Add("purl", profileUrl.TrimAndTruncate(100));
            }

            // first 30 chars
            if (!string.IsNullOrWhiteSpace(location))
            {
                parameters.Add("location", location.TrimAndTruncate(30));
            }

            // first 160 chars
            if (!string.IsNullOrWhiteSpace(description))
            {
                parameters.Add("description", description.TrimAndTruncate(160));
            }

            return await session.PostAsync(TwitterApi.Resolve("/1.1/account/update_profile.json"), parameters)
                .ContinueWith(c => c.MapToSingle<User>());
        }