public string GetIsAccountSubscribedToAccountActivityQuery(IIsAccountSubscribedToAccountActivityParameters parameters)
        {
            var query = new StringBuilder($"https://api.twitter.com/1.1/account_activity/all/{parameters.Environment}/subscriptions.json");

            query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters);
            return(query.ToString());
        }
Exemplo n.º 2
0
        public void Validate(IIsAccountSubscribedToAccountActivityParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            if (parameters.Environment == null)
            {
                throw new ArgumentNullException($"${nameof(parameters.Environment)}");
            }
        }
Exemplo n.º 3
0
        public async Task <bool> IsAccountSubscribedToAccountActivity(IIsAccountSubscribedToAccountActivityParameters parameters)
        {
            try
            {
                var twitterResult = await _accountActivityRequester.IsAccountSubscribedToAccountActivity(parameters).ConfigureAwait(false);

                return(twitterResult.Response.StatusCode == 204);
            }
            catch (TwitterException)
            {
                return(false);
            }
        }
Exemplo n.º 4
0
 public void Validate(IIsAccountSubscribedToAccountActivityParameters parameters)
 {
     _accountActivityClientParametersValidator.Validate(parameters);
 }
Exemplo n.º 5
0
 public Task <ITwitterResult> IsAccountSubscribedToAccountActivity(IIsAccountSubscribedToAccountActivityParameters parameters, ITwitterRequest request)
 {
     request.Query.Url        = _accountActivityQueryGenerator.GetIsAccountSubscribedToAccountActivityQuery(parameters);
     request.Query.HttpMethod = HttpMethod.GET;
     return(_twitterAccessor.ExecuteRequest(request));
 }
 public Task <ITwitterResult> IsAccountSubscribedToAccountActivity(IIsAccountSubscribedToAccountActivityParameters parameters)
 {
     _validator.Validate(parameters);
     return(ExecuteRequest(request => _accountActivityController.IsAccountSubscribedToAccountActivity(parameters, request)));
 }