Exemplo n.º 1
0
        public AuditApiClient(IAuditApiConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            if (string.IsNullOrEmpty(configuration.ApiBaseUrl))
            {
                throw new NullReferenceException("configuration.ApiBaseUrl is not specified");
            }
            if (string.IsNullOrEmpty(configuration.ClientId))
            {
                throw new NullReferenceException("configuration.ClientId is not specified");
            }
            if (string.IsNullOrEmpty(configuration.ClientSecret))
            {
                throw new NullReferenceException("configuration.ClientSecret is not specified");
            }
            if (string.IsNullOrEmpty(configuration.Tenant))
            {
                throw new NullReferenceException("configuration.Tenant is not specified");
            }
            if (string.IsNullOrEmpty(configuration.IdentifierUri))
            {
                throw new NullReferenceException("configuration.IdentifierUri is not specified");
            }

            _configuration = configuration;
            _httpClient    = new SecureHttpClient(configuration);
        }
Exemplo n.º 2
0
 internal AuditApiClient(IAuditApiConfiguration configuration, SecureHttpClient httpClient)
 {
     _configuration = configuration;
     _httpClient    = httpClient;
 }