public T Perform <T>(DeveloperApiRequest requestData) where T : class { lock (_lock) { CheckAuthHeader(requestData); } return(DirectPerform <T>(requestData)); }
private void CheckAuthHeader(DeveloperApiRequest request) { if ((_sessionAuthorization?.Expired).GetValueOrDefault(true)) { // we don't want this method running if we're getting the token so use the directperform method _sessionAuthorization = DirectPerform <DeveloperTokenResponse>(new DeveloperSessionRequest(_appId, _appSecret)); } request.WithAuthHeader($"Bearer {_sessionAuthorization!.Token}"); }