Esempio n. 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)}");
        }
Esempio n. 3
0
        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());
        }
Esempio n. 4
0
 public void Validate(IUpdateRelationshipParameters parameters)
 {
     _usersClientParametersValidator.Validate(parameters);
 }
Esempio n. 5
0
 // Friendships
 public Task UpdateRelationship(IUpdateRelationshipParameters parameters)
 {
     return(Client.Users.UpdateRelationship(parameters));
 }
Esempio n. 6
0
 public async Task UpdateRelationship(IUpdateRelationshipParameters parameters)
 {
     await _usersRequester.UpdateRelationship(parameters).ConfigureAwait(false);
 }
Esempio n. 7
0
 public Task <ITwitterResult <IRelationshipDetailsDTO> > UpdateRelationship(IUpdateRelationshipParameters parameters)
 {
     _validator.Validate(parameters);
     return(ExecuteRequest(request => _userController.UpdateRelationship(parameters, request)));
 }
Esempio n. 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;
 }