コード例 #1
0
 public GoogleApiClient(
     IRestSharpClientFactory restSharpClientFactory,
     IGoogleConfiguration googleConfiguration,
     IMapper mapper)
 {
     _clientFactory       = restSharpClientFactory;
     _googleConfiguration = googleConfiguration;
     _mapper = mapper;
 }
コード例 #2
0
        public GoogleOcr(IGoogleConfiguration googleConfiguration)
        {
            _googleConfiguration = googleConfiguration;

            _ocrClientLazy = new Lazy <ImageAnnotatorClient>(() => new ImageAnnotatorClientBuilder
            {
                CredentialsPath = googleConfiguration.KeyPath,
                JsonCredentials = googleConfiguration.Key
            }.Build());
        }
コード例 #3
0
        public GoogleTranslate(IGoogleConfiguration googleConfiguration, ILogger <GoogleTranslate> logger)
        {
            _googleConfiguration = googleConfiguration;
            _log = logger;

            _translateClientLazy = new Lazy <TranslationServiceClient>(() => new TranslationServiceClientBuilder
            {
                CredentialsPath = googleConfiguration.KeyPath,
                JsonCredentials = googleConfiguration.Key
            }.Build());
        }
コード例 #4
0
 public GoogleSearchEngine(ILogger <GoogleSearchEngine> logger, IGoogleConfiguration googleConfiguration)
 {
     _logger = logger;
     // builder will check validity of configuration properties
     _googleConfiguration = googleConfiguration;
 }