Пример #1
0
        public HttpBatchTranslationRequestContentGenerator(
            AuthenticationKey authKey,
            LanguageToCodeMapper mapper)
        {
            if (authKey == null)
            {
                throw new ArgumentNullException(nameof(authKey));
            }
            if (mapper == null)
            {
                throw new ArgumentNullException(nameof(mapper));
            }

            this.authKey = authKey;
            this.mapper  = mapper;
        }
Пример #2
0
        public RestApiBatchTextTranslator(
            IHttpBatchTranslationRequestSender sender,
            IHttpBatchTranslationResponseDeserializer deserializer,
            AuthenticationKey authKey)
        {
            if (sender == null)
            {
                throw new ArgumentNullException(nameof(sender));
            }
            if (deserializer == null)
            {
                throw new ArgumentNullException(nameof(deserializer));
            }
            if (authKey == null)
            {
                throw new ArgumentNullException(nameof(authKey));
            }

            this.sender       = sender;
            this.deserializer = deserializer;
            this.authKey      = authKey;
        }