public LiveStatisticsApi(IBitmovinApiClientFactory apiClientFactory)
 {
     _apiClient = apiClientFactory.CreateClient <ILiveStatisticsApiClient>();
     Events     = new EventsApi(apiClientFactory);
     Streams    = new StreamsApi(apiClientFactory);
     Srt        = new SrtApi(apiClientFactory);
 }
        public StreamsApiTest()
        {
            var sessionManagerMock = new Mock <IAuthTokens>();

            sessionManagerMock.Setup(obj => obj.SessionToken).Returns("sessionToken");
            _apiExecutorMock = new Mock <IApiExecutor>();
            _streamsApi      = new StreamsApi(sessionManagerMock.Object, "", new HttpClient(), _apiExecutorMock.Object);
        }
 public HlsApi(IBitmovinApiClientFactory apiClientFactory)
 {
     _apiClient = apiClientFactory.CreateClient <IHlsApiClient>();
     Default    = new DefaultApi(apiClientFactory);
     Customdata = new CustomdataApi(apiClientFactory);
     Streams    = new StreamsApi(apiClientFactory);
     Media      = new MediaApi(apiClientFactory);
 }
        public StreamsApiTest()
        {
            var sessionManagerMock = new Mock <IAuthTokens>();

            sessionManagerMock.Setup(obj => obj.SessionToken).Returns("sessionToken");
            var configuration = new Configuration();

            _apiExecutorMock = new Mock <IApiExecutor>();
            _streamsApi      = new StreamsApi(sessionManagerMock.Object, configuration, _apiExecutorMock.Object);
        }
 public EncodingsApi(IBitmovinApiClientFactory apiClientFactory)
 {
     _apiClient      = apiClientFactory.CreateClient <IEncodingsApiClient>();
     Live            = new LiveApi(apiClientFactory);
     MachineLearning = new MachineLearningApi(apiClientFactory);
     Customdata      = new CustomdataApi(apiClientFactory);
     Streams         = new StreamsApi(apiClientFactory);
     InputStreams    = new InputStreamsApi(apiClientFactory);
     Muxings         = new MuxingsApi(apiClientFactory);
     TransferRetries = new TransferRetriesApi(apiClientFactory);
     Captions        = new CaptionsApi(apiClientFactory);
     Sidecars        = new SidecarsApi(apiClientFactory);
     Keyframes       = new KeyframesApi(apiClientFactory);
 }
        private void StartupSymphonyBot()
        {
            // Symphony start up boilerplate start

            SymphonyOSS.RestApiClient.Generated.OpenApi.PodApi.Client.Configuration.Default =
                new SymphonyOSS.RestApiClient.Generated.OpenApi.PodApi.Client.Configuration(timeout: config_.TimeoutInMillis);
            SymphonyOSS.RestApiClient.Generated.OpenApi.AuthenticatorApi.Client.Configuration.Default =
                new SymphonyOSS.RestApiClient.Generated.OpenApi.AuthenticatorApi.Client.Configuration(timeout: config_.TimeoutInMillis);
            SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.Configuration.Default =
                new SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.Configuration(timeout: config_.TimeoutInMillis);

            var certificate = new X509Certificate2(
                config_.BotCertificateFilePath,
                config_.BotCertificatePassword);
            var sessionManager = new UserSessionManager(
                string.Format("{0}/sessionauth/", config_.BaseApiUrl),
                string.Format("{0}/keyauth/", config_.BaseApiUrl),
                certificate);
            var agentApiFactory = new AgentApiFactory(
                string.Format("{0}/agent", config_.BaseApiUrl));
            var podApiBaseUrl = string.Format("{0}/pod", config_.BasePodUrl);
            var podApiFactory = new PodApiFactory(podApiBaseUrl);

            // Symphony start up boilerplate end

            // create a data feed API to listen for chat messages
            datafeedApi_            = agentApiFactory.CreateDatafeedApi(sessionManager);
            datafeedApi_.OnMessage += OnMessageReceived;

            // create streams API to initiate chats
            streamsApi_ = podApiFactory.CreateStreamsApi(sessionManager);

            // create messages API to send messages
            messagesApi_ = agentApiFactory.CreateMessagesApi(sessionManager);

            // create users API to resolve users by e-mail or id
            usersApi_ = podApiFactory.CreateUsersApi(sessionManager);

            // start listening for messages from out bot
            // NB: Listen() is blocking, so run on a dedicated thread
            Task.Factory.StartNew(datafeedApi_.Listen, TaskCreationOptions.LongRunning);
        }
Beispiel #7
0
        private static void GetRoutes(string accessToken, string folderPath)
        {
            Console.WriteLine($"Access Token: {accessToken}, folderPath: {folderPath}");

            Configuration.AccessToken = accessToken;
            var activitiesApi = new ActivitiesApi();
            var streamsApi    = new StreamsApi();
            var gpxFileSystem = new GpxFileSystem(folderPath);

            // Get all the activities for the logged in user
            var activities    = activitiesApi.GetAllLoggedInAthleteActivities();
            var polyLineCount = 0;

            for (var activityIndex = 0; activityIndex < activities.Count; activityIndex++)
            {
                var activity = activities[activityIndex];
                try
                {
                    var fileExists = File.Exists(gpxFileSystem.GetActivityFilePath(activity));
                    Console.WriteLine($"       {activityIndex} {activity.Id} - {activity.Name}. ({activityIndex + 1} of {activities.Count}) - {(fileExists? "EXISTS" : "FETCH")}");

                    if (fileExists)
                    {
                        gpxFileSystem.Add(activity.Type, activity.Id.Value);
                        continue;
                    }

                    //var latlng = streamsApi.GetActivityStreams(activity.Id, new List<string> { "latlng" }, true);

                    if (!activity.StartDate.HasValue)
                    {
                        throw new Exception("Start Date not set on activity");
                    }

                    var heatMapJson = new HeatMapJson()
                    {
                        ActivityType  = activity.Type,
                        Polyline      = activity.Map.Polyline ?? activity.Map.SummaryPolyline,
                        Name          = activity.Name,
                        StartDateTime = activity.StartDate
                    };

                    if (activity.Map.Polyline != null)
                    {
                        polyLineCount++;
                    }

                    var json = JsonConvert.SerializeObject(heatMapJson);

                    var activityJsonPath = gpxFileSystem.GetActivityFilePath(activity);
                    File.WriteAllText(activityJsonPath, json);

                    gpxFileSystem.Add(activity.Type, activity.Id.Value);
                }
                catch (Exception e)
                {
                    Console.WriteLine($"ERROR: {activity.Id} - {activity.Name}. {e}");
                }
            }

            Debug.WriteLine("Polyline: " + polyLineCount);

            var jsonFS = JsonConvert.SerializeObject(gpxFileSystem.FileSystem, Formatting.Indented);

            File.WriteAllText(gpxFileSystem.GetFileSystemPath(), jsonFS);
        }
Beispiel #8
0
 public void Init()
 {
     instance = new StreamsApi();
 }