/// <summary> /// Initializes a new instance of the <see cref="DatafeedApi" /> class. /// See <see cref="Factories.AgentApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="apiExecutor">Execution strategy.</param> protected AbstractDatafeedApi(IAuthTokens authTokens, IApiExecutor apiExecutor) { Log = ApiLogging.LoggerFactory?.CreateLogger <AbstractDatafeedApi>(); AuthTokens = authTokens; ApiExecutor = apiExecutor; }
/// <summary> /// Initializes a new instance of the <see cref="AttachmentsApi" /> class. /// See <see cref="Factories.AgentApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public AttachmentsApi(IAuthTokens authTokens, Configuration configuration, IApiExecutor apiExecutor) { _attachmentsApi = new Generated.OpenApi.AgentApi.Api.AttachmentsApi(configuration); _configuration = configuration; _authTokens = authTokens; _apiExecutor = apiExecutor; }
/// <summary> /// Initializes a new instance of the <see cref="AttachmentsApi" /> class. /// See <see cref="Factories.AgentApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public AttachmentsApi(IAuthTokens authTokens, string baseUrl, HttpClient httpClient, IApiExecutor apiExecutor) { _streamApi = new Generated.OpenApi.AgentApi.StreamClient(baseUrl, httpClient); _authTokens = authTokens; _apiExecutor = apiExecutor; _log = ApiLogging.LoggerFactory?.CreateLogger <AttachmentsApi>(); }
/// <summary> /// Initializes a new instance of the <see cref="SecurityApi" /> class. /// See <see cref="Factories.PodApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public SecurityApi(IAuthTokens authTokens, string baseUrl, HttpClient httpClient, IApiExecutor apiExecutor) { _securityApi = new Generated.OpenApi.PodApi.CompanycertClient(baseUrl, httpClient); _authTokens = authTokens; _apiExecutor = apiExecutor; _log = ApiLogging.LoggerFactory?.CreateLogger <SecurityApi>(); }
/// <summary> /// Initializes a new instance of the <see cref="UsersApi" /> class. /// See <see cref="Factories.PodApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public ConnectionApi(IAuthTokens authTokens, string baseUrl, HttpClient httpClient, IApiExecutor apiExecutor) { _log = ApiLogging.LoggerFactory?.CreateLogger <ConnectionApi>(); _connectionApi = new Generated.OpenApi.PodApi.ConnectionClient(baseUrl, httpClient); _authTokens = authTokens; _apiExecutor = apiExecutor; }
/// <summary> /// Initializes a new instance of the <see cref="MessagesApi" /> class. /// See <see cref="Factories.AgentApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public MessagesApi(IAuthTokens authTokens, Configuration configuration, IApiExecutor apiExecutor) { _log = ApiLogging.LoggerFactory?.CreateLogger <MessagesApi>(); _messagesApi = new Generated.OpenApi.AgentApi.Api.MessagesApi(configuration); _authTokens = authTokens; _apiExecutor = apiExecutor; }
/// <summary> /// Initializes a new instance of the <see cref="PresenceApi" /> class. /// See <see cref="Factories.PodApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public PresenceApi(IAuthTokens authTokens, string baseUrl, HttpClient httpClient, IApiExecutor apiExecutor) { _presenceApi = new Generated.OpenApi.PodApi.PresenceClient(baseUrl, httpClient); _userApi = new Generated.OpenApi.PodApi.UserClient(baseUrl, httpClient); _authTokens = authTokens; _apiExecutor = apiExecutor; _log = ApiLogging.LoggerFactory?.CreateLogger <PresenceApi>(); }
/// <summary> /// Initializes a new instance of the <see cref="UsersApi" /> class. /// See <see cref="Factories.PodApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public UsersApi(IAuthTokens authTokens, string baseUrl, HttpClient httpClient, IApiExecutor apiExecutor) { _usersApi = new AdminClient(baseUrl, httpClient); _userApi = new UserClient(baseUrl, httpClient); _authTokens = authTokens; _apiExecutor = apiExecutor; _log = ApiLogging.LoggerFactory?.CreateLogger <UsersApi>(); }
public AppEntitlementsApi(IAuthTokens authTokens, string baseUrl, HttpClient httpClient, IApiExecutor apiExecutor) { _log = ApiLogging.LoggerFactory?.CreateLogger <AppEntitlementsApi>(); _appEntitlementsApi = new Generated.OpenApi.PodApi.AdminClient(baseUrl, httpClient); _authTokens = authTokens; _apiExecutor = apiExecutor; }
/// <summary> /// Initializes a new instance of the <see cref="RoomMembershipApi" /> class. /// See <see cref="Factories.PodApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public RoomMembershipApi(IAuthTokens authTokens, string baseUrl, HttpClient httpClient, IApiExecutor apiExecutor) { _roomMembershipApi = new Generated.OpenApi.PodApi.AdminClient(baseUrl, httpClient); _roomApi = new Generated.OpenApi.PodApi.RoomClient(baseUrl, httpClient); _authTokens = authTokens; _apiExecutor = apiExecutor; _log = ApiLogging.LoggerFactory?.CreateLogger <RoomMembershipApi>(); }
/// <summary> /// Initializes a new instance of the <see cref="StreamsApi" /> class. /// See <see cref="Factories.PodApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public StreamsApi(IAuthTokens authTokens, string baseUrl, HttpClient httpClient, IApiExecutor apiExecutor) { _streamsApi = new Generated.OpenApi.PodApi.StreamsClient(baseUrl, httpClient); _imApi = new Generated.OpenApi.PodApi.ImClient(baseUrl, httpClient); _roomApi = new RoomClient(baseUrl, httpClient); _authTokens = authTokens; _apiExecutor = apiExecutor; _log = ApiLogging.LoggerFactory?.CreateLogger <StreamsApi>(); }
private T Create <T>(ISessionManager sessionManager, IApiExecutor apiExecutor = null) { if (apiExecutor == null) { var retryStrategy = new RefreshTokensRetryStrategy(sessionManager); apiExecutor = new RetryStrategyApiExecutor(retryStrategy); } var httpClient = HttpClientUtils.CreateClient(sessionManager.Certificate); return(ApiFactoryUtils.CallConstructor <T>(new object[] { sessionManager, _baseUrl, httpClient, apiExecutor })); }
private T Create <T>(ISessionManager sessionManager, IApiExecutor apiExecutor = null) { var configuration = new Configuration(); configuration.BasePath = _baseUrl; configuration.ApiClient.RestClient.HttpClientFactory = new Internal.ClientAuthHttpClientFactory(sessionManager.Certificate); if (apiExecutor == null) { var retryStrategy = new RefreshTokensRetryStrategy(sessionManager); apiExecutor = new RetryStrategyApiExecutor(retryStrategy); } return(ApiFactoryUtils.CallConstructor <T>(new object[] { sessionManager, configuration, apiExecutor })); }
private T Create <T>(ISessionManager sessionManager, IApiExecutor apiExecutor = null) { var apiClient = new ApiClient(_baseUrl) { RestClient = { ClientCertificates = new X509Certificate2Collection { sessionManager.Certificate } } }; var configuration = new Configuration(apiClient); if (apiExecutor == null) { var retryStrategy = new RefreshTokensRetryStrategy(sessionManager); apiExecutor = new RetryStrategyApiExecutor(retryStrategy); } return(ApiFactoryUtils.CallConstructor <T>(new object[] { sessionManager, configuration, apiExecutor })); }
/// <summary> /// Constructs a SessionApi instance using the provided session manager /// for authentication. /// </summary> /// <param name="sessionManager">Session manager used for authentication.</param> /// <param name="apiExecutor">The executor, if none is provided <see cref="RetryStrategyApiExecutor"/> /// with a <see cref="RefreshTokensRetryStrategy"/> will be used.</param> /// <returns>The SessionApi instance.</returns> public SessionApi CreateSessionApi(ISessionManager sessionManager, IApiExecutor apiExecutor = null) { return(Create <SessionApi>(sessionManager, apiExecutor)); }
/// <summary> /// Constructs a PresenceApi instance using the provided session manager /// for authentication. /// </summary> /// <param name="sessionManager">Session manager used for authentication.</param> /// <param name="apiExecutor">The executor, if none is provided <see cref="RetryStrategyApiExecutor"/> /// with a <see cref="RefreshTokensRetryStrategy"/> will be used.</param> /// <returns>The PresenceApi instance.</returns> public PresenceApi CreatePresenceApi(ISessionManager sessionManager, IApiExecutor apiExecutor = null) { return(Create <PresenceApi>(sessionManager, apiExecutor)); }
/// <summary> /// Constructs a MessageSuppressionApi instance using the provided session manager /// for authentication. /// </summary> /// <param name="sessionManager">Session manager used for authentication.</param> /// <param name="apiExecutor">The executor, if none is provided <see cref="RetryStrategyApiExecutor"/> /// with a <see cref="RefreshTokensRetryStrategy"/> will be used.</param> /// <returns>The MessageSuppressionApi instance.</returns> public MessageSuppressionApi CreateMessageSuppressionApi(ISessionManager sessionManager, IApiExecutor apiExecutor = null) { return(Create <MessageSuppressionApi>(sessionManager, apiExecutor)); }
/// <summary> /// Constructs a ConnectionApi instance using the provided session manager /// for authentication. /// </summary> /// <param name="sessionManager">Session manager used for authentication.</param> /// <param name="apiExecutor">The executor, if none is provided <see cref="RetryStrategyApiExecutor"/> /// with a <see cref="RefreshTokensRetryStrategy"/> will be used.</param> /// <returns>The ConnectionApi instance.</returns> public ConnectionApi CreateConnectionApi(ISessionManager sessionManager, IApiExecutor apiExecutor = null) { return(Create <ConnectionApi>(sessionManager, apiExecutor)); }
/// <summary> /// Construcs a RoomMembershipApi using the procided session manager for authentication. /// </summary> /// <param name="sessionManager">Session manager used for authentication.</param> /// <param name="apiExecutor">The executor, if none is provided <see cref="RetryStrategyApiExecutor"/> /// with a <see cref="RefreshTokensRetryStrategy"/> will be used.</param> /// <returns>The RoomMembershipApi instance.</returns> public RoomMembershipApi CreateRoomMembershipApi(ISessionManager sessionManager, IApiExecutor apiExecutor = null) { return(Create <RoomMembershipApi>(sessionManager, apiExecutor)); }
/// <summary> /// Initializes a new instance of the <see cref="FirehoseApi" /> class. /// See <see cref="Factories.AgentApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public FirehoseApi(IAuthTokens authTokens, Configuration configuration, IApiExecutor apiExecutor) : base(authTokens, apiExecutor) { _log = ApiLogging.LoggerFactory?.CreateLogger <FirehoseApi>(); _firehoseApi = new Generated.OpenApi.AgentApi.Api.FirehoseApi(configuration); }
/// <summary> /// Initializes a new instance of the <see cref="UtilApi" /> class. /// See <see cref="Factories.PodApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public UtilApi(IAuthTokens authTokens, Configuration configuration, IApiExecutor apiExecutor) { _datafeedApi = new Generated.OpenApi.AgentApi.Api.UtilApi(configuration); _authTokens = authTokens; _apiExecutor = apiExecutor; }
/// <summary> /// Initializes a new instance of the <see cref="DatafeedApi" /> class. /// See <see cref="Factories.AgentApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public DatafeedApi(IAuthTokens authTokens, Configuration configuration, IApiExecutor apiExecutor) : base(authTokens, apiExecutor) { _datafeedApi = new Generated.OpenApi.AgentApi.Api.DatafeedApi(configuration); _log = ApiLogging.LoggerFactory?.CreateLogger <DatafeedApi>(); }
/// <summary> /// Initializes a new instance of the <see cref="SessionApi" /> class. /// See <see cref="Factories.PodApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public SessionApi(IAuthTokens authTokens, string baseUrl, HttpClient httpClient, IApiExecutor apiExecutor) { _sessionApi = new Generated.OpenApi.PodApi.SessioninfoClient(baseUrl, httpClient); _authTokens = authTokens; _apiExecutor = apiExecutor; }
/// <summary> /// Initializes a new instance of the <see cref="MessageSuppressionApi" /> class. /// Provides methods for discovering functions available through the API endpoints. /// Encapsulates <see cref="Generated.OpenApi.PodApi.Api.MessageSuppressionApi"/>, /// adding authentication token management and a custom execution strategy. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public MessageSuppressionApi(IAuthTokens authTokens, string baseUrl, HttpClient httpClient, IApiExecutor apiExecutor) { _messageSuppressionApi = new Generated.OpenApi.PodApi.AdminClient(baseUrl, httpClient); _authTokens = authTokens; _apiExecutor = apiExecutor; }
/// <summary> /// Initializes a new instance of the <see cref="DatafeedApi" /> class. /// See <see cref="Factories.AgentApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public DatafeedApi(IAuthTokens authTokens, Configuration configuration, IApiExecutor apiExecutor) : base(authTokens, apiExecutor) { _datafeedApi = new Generated.OpenApi.AgentApi.Api.DatafeedApi(configuration); }
/// <summary> /// Initializes a new instance of the <see cref="FirehoseApi" /> class. /// See <see cref="Factories.AgentApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public FirehoseApi(IAuthTokens authTokens, Configuration configuration, IApiExecutor apiExecutor) : base(authTokens, apiExecutor) { _firehoseApi = new Generated.OpenApi.AgentApi.Api.FirehoseApi(configuration); }
/// <summary> /// Initializes a new instance of the <see cref="MessagesApi" /> class. /// See <see cref="Factories.AgentApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public MessagesApi(IAuthTokens authTokens, Configuration configuration, IApiExecutor apiExecutor) { _messagesApi = new Generated.OpenApi.AgentApi.Api.MessagesApi(configuration); _authTokens = authTokens; _apiExecutor = apiExecutor; }
/// <summary> /// Initializes a new instance of the <see cref="PresenceApi" /> class. /// See <see cref="Factories.PodApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public PresenceApi(IAuthTokens authTokens, Configuration configuration, IApiExecutor apiExecutor) { _presenceApi = new Generated.OpenApi.PodApi.Api.PresenceApi(configuration); _authTokens = authTokens; _apiExecutor = apiExecutor; }
/// <summary> /// Initializes a new instance of the <see cref="StreamsApi" /> class. /// See <see cref="Factories.PodApiFactory"/> for conveniently constructing /// an instance. /// </summary> /// <param name="authTokens">Authentication tokens.</param> /// <param name="configuration">Api configuration.</param> /// <param name="apiExecutor">Execution strategy.</param> public StreamsApi(IAuthTokens authTokens, Configuration configuration, IApiExecutor apiExecutor) { _streamsApi = new Generated.OpenApi.PodApi.Api.StreamsApi(configuration); _authTokens = authTokens; _apiExecutor = apiExecutor; }
/// <summary> /// Constructs a AppEntitlementsApi instance using the provided session manager /// for authentication. /// </summary> /// <param name="sessionManager">Session manager used for authentication.</param> /// <param name="apiExecutor">The executor, if none is provided <see cref="RetryStrategyApiExecutor"/> /// with a <see cref="RefreshTokensRetryStrategy"/> will be used.</param> /// <returns>The PresenceApi instance.</returns> public AppEntitlementsApi CreateAppEntitlementsApi(ISessionManager sessionManager, IApiExecutor apiExecutor = null) { return(Create <AppEntitlementsApi>(sessionManager, apiExecutor)); }