public string GetAccountActivityEnvironmentWebhooksQuery(IGetAccountActivityEnvironmentWebhooksParameters parameters)
        {
            var query = new StringBuilder($"{Resources.Webhooks_AccountActivity_All}/{parameters.Environment}/webhooks.json");

            query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters);
            return(query.ToString());
        }
Пример #2
0
        public void Validate(IGetAccountActivityEnvironmentWebhooksParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            if (parameters.Environment == null)
            {
                throw new ArgumentNullException($"${nameof(parameters.Environment)}");
            }
        }
Пример #3
0
 public void Validate(IGetAccountActivityEnvironmentWebhooksParameters parameters)
 {
     _accountActivityClientParametersValidator.Validate(parameters);
 }
Пример #4
0
        public async Task <IWebhook[]> GetAccountActivityEnvironmentWebhooks(IGetAccountActivityEnvironmentWebhooksParameters parameters)
        {
            var twitterResult = await _accountActivityRequester.GetAccountActivityEnvironmentWebhooks(parameters).ConfigureAwait(false);

            return(twitterResult?.DataTransferObject?.Select(x => _client.Factories.CreateWebhook(x)).ToArray());
        }
Пример #5
0
        public Task <ITwitterResult <IWebhookDTO[]> > GetAccountActivityEnvironmentWebhooks(IGetAccountActivityEnvironmentWebhooksParameters parameters, ITwitterRequest request)
        {
            var consumerCredentials = new ConsumerCredentials(request.Query.TwitterCredentials);

            request.Query.Url                = _accountActivityQueryGenerator.GetAccountActivityEnvironmentWebhooksQuery(parameters);
            request.Query.HttpMethod         = HttpMethod.GET;
            request.Query.TwitterCredentials = new TwitterCredentials(consumerCredentials);

            return(_twitterAccessor.ExecuteRequest <IWebhookDTO[]>(request));
        }
 public Task <ITwitterResult <IWebhookDTO[]> > GetAccountActivityEnvironmentWebhooks(IGetAccountActivityEnvironmentWebhooksParameters parameters)
 {
     _validator.Validate(parameters);
     return(ExecuteRequest(request => _accountActivityController.GetAccountActivityEnvironmentWebhooks(parameters, request)));
 }