Esempio n. 1
0
 protected BaseWebApi(SendCloudConfig config)
 {
     Config     = config;
     Client     = new HttpClient();
     PostMethod = new HttpPost();
     GetMethod  = new HttpGet();
     Response   = new HttpResponse();
 }
Esempio n. 2
0
        public SendCloudSmsTest()
        {
            var configuration = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory())
                                .AddJsonFile("appsettings.json", false, true)
                                .Build();

            _config = configuration.GetSection("SMS:SendCloud").Get <SendCloudConfig>();
            _client = new SendCloudClient(_config);
        }
Esempio n. 3
0
        public SendCloudClient(SendCloudConfig config, Action <Exception> exceptionHandler = null)
        {
            _config           = config ?? throw new ArgumentNullException(nameof(config));
            _sendCloudAccount = config.Account ?? throw new ArgumentNullException(nameof(config.Account));
            _proxy            = HttpApiClient.Create <ISendCloudApi>();

            var globalHandle = ExceptionHandleResolver.ResolveHandler();

            globalHandle     += exceptionHandler;
            _exceptionHandler = globalHandle;
        }
Esempio n. 4
0
 public EmailWebApi(SendCloudConfig config)
     : base(config)
 {
 }
Esempio n. 5
0
 public SmsWebApi(SendCloudConfig config)
     : base(config)
 {
 }
Esempio n. 6
0
 public SmsWebApi(SendCloudConfig config)
     : base(config)
 {
 }
Esempio n. 7
0
 public EmailWebApi(SendCloudConfig config)
     : base(config)
 {
 }