示例#1
0
        public Task <ITwitterResult <IRelationshipDetailsDTO> > UpdateRelationship(IUpdateRelationshipParameters parameters, ITwitterRequest request)
        {
            var query = _userQueryGenerator.GetUpdateRelationshipQuery(parameters);

            request.Query.Url        = query;
            request.Query.HttpMethod = HttpMethod.POST;
            return(_twitterAccessor.ExecuteRequest <IRelationshipDetailsDTO>(request));
        }
        public void Validate(IUpdateRelationshipParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            _userQueryValidator.ThrowIfUserCannotBeIdentified(parameters.User, $"{nameof(parameters.User)}");
        }
        public string GetUpdateRelationshipQuery(IUpdateRelationshipParameters parameters)
        {
            var query = new StringBuilder(Resources.Friendship_Update);

            query.AddFormattedParameterToQuery(_userQueryParameterGenerator.GenerateIdOrScreenNameParameter(parameters.User));
            query.AddParameterToQuery("device", parameters.EnableDeviceNotifications);
            query.AddParameterToQuery("retweets", parameters.EnableRetweets);
            query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters);

            return(query.ToString());
        }
示例#4
0
 public void Validate(IUpdateRelationshipParameters parameters)
 {
     _usersClientParametersValidator.Validate(parameters);
 }
示例#5
0
 // Friendships
 public Task UpdateRelationship(IUpdateRelationshipParameters parameters)
 {
     return(Client.Users.UpdateRelationship(parameters));
 }
示例#6
0
 public async Task UpdateRelationship(IUpdateRelationshipParameters parameters)
 {
     await _usersRequester.UpdateRelationship(parameters).ConfigureAwait(false);
 }
示例#7
0
 public Task <ITwitterResult <IRelationshipDetailsDTO> > UpdateRelationship(IUpdateRelationshipParameters parameters)
 {
     _validator.Validate(parameters);
     return(ExecuteRequest(request => _userController.UpdateRelationship(parameters, request)));
 }
示例#8
0
 public Task <ITwitterResult <IRelationshipDetailsDTO> > UpdateRelationship(IUpdateRelationshipParameters parameters, ITwitterRequest request)
 {
     return(_userQueryExecutor.UpdateRelationship(parameters, request));
 }
 public UpdateRelationshipParameters(IUpdateRelationshipParameters source) : base(source)
 {
     User                      = source?.User;
     EnableRetweets            = source?.EnableRetweets;
     EnableDeviceNotifications = source?.EnableDeviceNotifications;
 }