private void InitializeSDKs() { var apiKey = _settingsProvider.GetAppSettingsValue(EnvKey); if (string.IsNullOrWhiteSpace(apiKey)) { var message = $"{EnvKey}: is null or empty"; _log.LogEvent(LogEventIds.CloudPortApiError, message); throw new ArgumentNullException(LogEventIds.CloudPortApiError.Name, message); } Telestream.Cloud.Stores.Client.Configuration storesConfiguration = new Telestream.Cloud.Stores.Client.Configuration(); storesConfiguration.ApiKey.Add("X-Api-Key", apiKey); CloudPortStoresApi = new StoresApi(storesConfiguration); // Notifications are not being used just yet, but we include them now for future possibilies. Telestream.Cloud.Notifications.Client.Configuration notificationsConfiguration = new Telestream.Cloud.Notifications.Client.Configuration(); notificationsConfiguration.ApiKey.Add("X-Api-Key", apiKey); CloudPortNotificationsApi = new NotificationsApi(notificationsConfiguration); Telestream.Cloud.VantageCloudPort.Client.Configuration cloudPortConfiguration = new Telestream.Cloud.VantageCloudPort.Client.Configuration(); cloudPortConfiguration.ApiKey.Add("X-Api-Key", apiKey); CloudPortApi = new Telestream.Cloud.VantageCloudPort.Api.VantageCloudPortApi(cloudPortConfiguration); Telestream.Cloud.Flip.Client.Configuration flipConfiguration = new Telestream.Cloud.Flip.Client.Configuration(); flipConfiguration.ApiKey.Add("X-Api-Key", apiKey); FlipApi = new FlipApi(flipConfiguration); }
public StoresViewModel() { //Create the stores api _storesApi = new StoresApi(); Stores = new ObservableCollection <StoreViewModel>(); PreviousPageCommand = new RelayCommand(ExecutePreviousPageCommand, m => _pageIndex > 1); NextPageCommand = new RelayCommand(ExecuteNextPageCommand, m => _pageIndex < _totalPages); SelectStoreCommand = new RelayCommand(ExecuteSelectStoreCommand, m => SelectedStore != null); SearchCommand = new RelayCommand(ExecuteSearchCommand); LogoutCommand = new RelayCommand(ExecuteLogoutCommand); }
public async Task <List <Store> > GetStores() { return(await StoresApi.GetJsonAsync <List <Store> > ()); }
public void Init() { instance = new StoresApi(); }