Exemplo n.º 1
0
        public OpswatMalwareService(IOpswatConfiguration configuration, IOpswatApi api)
        {
            Guard.AgainstNull(configuration, nameof(configuration));
            Guard.AgainstNull(api, nameof(api));

            _configuration = configuration;
            _api           = api;
        }
Exemplo n.º 2
0
        public OpswatApi(IOpswatConfiguration configuration)
        {
            Guard.AgainstNull(configuration, nameof(configuration));

            _apiUrl = configuration.ApiUrl;

            if (!_apiUrl.EndsWith("/"))
            {
                _apiUrl += "/";
            }

            _client = new RestClient(configuration.ApiUrl);

            _client.AddDefaultHeader("apikey", configuration.ApiKey);
        }