/// <summary>
        /// Initializes a new instance of the <see cref="InfobipWhatsAppAdapter"/> class using configuration settings.
        /// </summary>
        /// <param name="infobipWhatsAppOptions">Adapter options. Typically created via appsettings loaded into an IConfiguration.</param>
        /// <param name="infobipWhatsAppClient">Client/Proxy used to communicate with Infobip.</param>
        /// <param name="logger">Logger.</param>
        public InfobipWhatsAppAdapter(InfobipWhatsAppAdapterOptions infobipWhatsAppOptions, IInfobipWhatsAppClient infobipWhatsAppClient, ILogger <InfobipWhatsAppAdapter> logger)
        {
            _whatsAppAdapterOptions = infobipWhatsAppOptions ?? throw new ArgumentNullException(nameof(infobipWhatsAppOptions));
            _infobipWhatsAppClient  = infobipWhatsAppClient ?? throw new ArgumentNullException(nameof(infobipWhatsAppClient));
            _logger = logger ?? NullLogger <InfobipWhatsAppAdapter> .Instance;

            _toWhatsAppActivityConverter = new ToWhatsAppActivityConverter(_whatsAppAdapterOptions, _infobipWhatsAppClient, _logger);
            _authorizationHelper         = new AuthorizationHelper();
        }
示例#2
0
 public InfobipWhatsAppClient(InfobipWhatsAppAdapterOptions infobipViberWhatsAppAdapterOptions, ILogger <InfobipWhatsAppClient> logger) : base(infobipViberWhatsAppAdapterOptions)
 {
     _infobipWhatsAppOptions = infobipViberWhatsAppAdapterOptions ?? throw new ArgumentNullException(nameof(infobipViberWhatsAppAdapterOptions));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _infobipHttpClient.Init(_infobipWhatsAppOptions.InfobipApiKey);
 }