public GitHubScopedProcessingService(
     IGitHubApiService gitHubApiService,
     IGitHubRepository gitHubRepository)
 {
     _gitHubApiService = gitHubApiService;
     _gitHubRepository = gitHubRepository;
 }
Exemple #2
0
 public static async Task <List <string> > Run(
     [ActivityTrigger] IDurableActivityContext context,
     [Inject] IGitHubApiService gitHubApiService,
     ILogger log)
 {
     return(await gitHubApiService.GetUserRepositoryList());
 }
Exemple #3
0
        public async Task <IActionResult> Get(string user)
        {
            try
            {
                string valorJSON = _cacheRepository.GetString(user);

                if (!string.IsNullOrEmpty(valorJSON))
                {
                    _logger.LogInformation($"Response use cache.");

                    return(Ok(valorJSON));
                }

                IGitHubApiService gitHubApiService = RestService.For <IGitHubApiService>("https://api.github.com/");

                UserResponse userResponse = await gitHubApiService.GetUser(user);

                valorJSON = JsonSerializer.Serialize(userResponse);

                _cacheRepository.SetString(user, valorJSON, 10);

                _logger.LogInformation($"Response use network.");

                return(Ok(valorJSON));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Exemple #4
0
 public ImportService(IGitHubApiService gitHubApiService,
                      IRepoSettingsStore repoSettingsStore,
                      IOwnerSettingsStore ownerSettingsStore)
 {
     _gitHubApiService   = gitHubApiService;
     _repoSettingsStore  = repoSettingsStore;
     _ownerSettingsStore = ownerSettingsStore;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="HomeController"/> class.
        /// </summary>
        /// <param name="service"><see cref="IGitHubApiService"/> instance.</param>
        public HomeController(IGitHubApiService service)
        {
            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }

            this._service = service;
        }
Exemple #6
0
        public static async Task <RepoViewCount> Run(
            [ActivityTrigger] IDurableActivityContext context,
            [Inject] IGitHubApiService gitHubApiService,
            ILogger log)
        {
            var repoName = context.GetInput <string>();

            return(await gitHubApiService.GetRepositoryViewCount(repoName));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="HomeController"/> class.
        /// </summary>
        /// <param name="service"><see cref="IGitHubApiService"/> instance.</param>
        public HomeController(IGitHubApiService service)
        {
            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }

            this._service = service;
        }
        public void Given_NullParameter_Constructor_ShouldThrow_ArgumentNullException()
        {
            // Arrange
            IGitHubApiService service = null;

            // Action
            Action action = () => { var controller = new HomeController(service); };

            // Assert
            action.ShouldThrow <ArgumentNullException>();
        }
 public CreatePullRequestTask(
     IStringLocalizer <CommitFileTask> localizer,
     IWorkflowExpressionEvaluator expressionEvaluator,
     IGitHubApiService gitHubApiService,
     ILogger <CreateBranchTask> logger
     )
 {
     S = localizer;
     _expressionEvaluator = expressionEvaluator;
     _gitHubApiService    = gitHubApiService;
     _logger = logger;
 }
Exemple #10
0
 public UsersController(IGitHubApiService apiService)
 {
     _apiService = apiService;
 }
 public GetRepositoryViewCountCore(IGitHubApiService gitHubApiService)
 {
     _gitHubApiService = gitHubApiService;
 }
Exemple #12
0
 public AppRepositoryUpdateService(IGitHubApiService gitHubApiService, IAppRepository appRepository)
 {
     _gitHubApiService = gitHubApiService;
     _appRepository    = appRepository;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GitHubApiServiceTest"/> class.
 /// </summary>
 /// <param name="fixture"><see cref="GitHubApiServiceFixture"/> instance.</param>
 public GitHubApiServiceTest(GitHubApiServiceFixture fixture)
 {
     this._helper  = fixture.HttpClientHelper;
     this._service = fixture.GitHubApiService;
 }
Exemple #14
0
 public SelectTokenViewComponent(IGitHubApiService apiService)
 {
     _apiService = apiService;
 }
 public RepositoriesComparisonControl(IGitHubApiService gitHubService)
 {
     InitializeComponent();
     GitHubService = gitHubService;
 }
Exemple #16
0
 public GitHubController(IGitHubApiService gitHubApiService)
 {
     this.gitHubApiService = gitHubApiService;
 }
Exemple #17
0
 public GetUserRepositoryList(IGitHubApiService gitHubApiService)
 {
     _gitHubApiService = gitHubApiService;
 }
 public RepositorySelectorListViewComponent(IGitHubApiService gitHubApiService)
 {
     _gitHubApiService = gitHubApiService;
 }