示例#1
0
        static KalturaConfiguration GetConfig()
        {
            KalturaConfiguration config = new KalturaConfiguration(PARTNER_ID);

            config.ServiceUrl = SERVICE_URL;
            return(config);
        }
示例#2
0
        static KalturaConfiguration GetConfig()
        {
            KalturaConfiguration config = new KalturaConfiguration();

            config.ServiceUrl = SERVICE_URL;
            config.Logger     = new KalturaClientTester();
            return(config);
        }
 public KalturaClientBase(KalturaConfiguration config)
 {
     _Config = config;
     if (_Config.Logger != null)
     {
         _ShouldLog = true;
     }
     _CallsQueue            = new List <KalturaServiceActionCall>();
     _MultiRequestParamsMap = new KalturaParams();
 }
示例#4
0
 public KalturaClientBase(KalturaConfiguration config)
 {
     _Config = config;
     if (_Config.Logger != null)
     {
         _ShouldLog = true;
     }
     _CallsQueue = new List<KalturaServiceActionCall>();
     _MultiRequestParamsMap = new KalturaParams();
 }
 private void createProxy(HttpWebRequest request, KalturaConfiguration _Config)
 {
     if (String.IsNullOrEmpty(_Config.ProxyAddress))
     {
         return;
     }
     Console.WriteLine("Create proxy");
     if (!(String.IsNullOrEmpty(_Config.ProxyUser) || String.IsNullOrEmpty(_Config.ProxyPassword)))
     {
         ICredentials credentials = new NetworkCredential(_Config.ProxyUser, _Config.ProxyPassword);
         request.Proxy = new WebProxy(_Config.ProxyAddress, false, null, credentials);
     }
     else
     {
         request.Proxy = new WebProxy(_Config.ProxyAddress);
     }
 }
示例#6
0
 private void createProxy(HttpWebRequest request, KalturaConfiguration _Config)
 {
     if (String.IsNullOrEmpty(_Config.ProxyAddress))
         return;
     Console.WriteLine("Create proxy");
     if (!(String.IsNullOrEmpty(_Config.ProxyUser) || String.IsNullOrEmpty(_Config.ProxyPassword)))
     {
         ICredentials credentials = new NetworkCredential(_Config.ProxyUser, _Config.ProxyPassword);
         request.Proxy = new WebProxy(_Config.ProxyAddress, false, null, credentials);
     }
     else
     {
         request.Proxy = new WebProxy(_Config.ProxyAddress);
     }
 }
示例#7
0
 public KalturaClient(KalturaConfiguration config)
     : base(config)
 {
     _ApiVersion = "3.1.4";
 }
 static KalturaConfiguration GetConfig()
 {
     KalturaConfiguration config = new KalturaConfiguration(PARTNER_ID);
     config.ServiceUrl = SERVICE_URL;
     return config;
 }
示例#9
0
 static KalturaConfiguration GetConfig()
 {
     KalturaConfiguration config = new KalturaConfiguration();
     config.ServiceUrl = SERVICE_URL;
     config.Logger = new KalturaClientTester();
     return config;
 }
        static void Main(string[] args)
        {
            Console.WriteLine("Starting C# Kaltura API Client Library");
            int code = 0;

            uniqueTag = Guid.NewGuid().ToString().Replace("-", "").Substring(0, 20);

            KalturaConfiguration config = new KalturaConfiguration();

            config.ServiceUrl = SERVICE_URL;
            client            = new KalturaClient(config);

            try
            {
                Login(OPERATOR_USERNAME, OPERATOR_PASSWORD);
            }
            catch (KalturaAPIException e)
            {
                Console.WriteLine("Failed Login as operator: " + e.Message);
                code = -1;
            }

            try
            {
                Login(MASTER_USERNAME, MASTER_PASSWORD, MASTER_DEVICE);
            }
            catch (KalturaAPIException e)
            {
                Console.WriteLine("Failed Login as master: " + e.Message);
                code = -1;
            }

            try
            {
                ListUserRoles();
            }
            catch (KalturaAPIException e)
            {
                Console.WriteLine("Failed ListUserRoles: " + e.Message);
                code = -1;
            }

            try
            {
                ListAssets();
            }
            catch (KalturaAPIException e)
            {
                Console.WriteLine("Failed ListAssets: " + e.Message);
                code = -1;
            }

            try
            {
                ListOttUsers();
            }
            catch (KalturaAPIException e)
            {
                Console.WriteLine("Failed ListOttUsers: " + e.Message);
                code = -1;
            }

            try
            {
                ListHouseholdUsers();
            }
            catch (KalturaAPIException e)
            {
                Console.WriteLine("Failed ListHouseholdUsers: " + e.Message);
                code = -1;
            }

            try
            {
                GetHousehold();
            }
            catch (KalturaAPIException e)
            {
                Console.WriteLine("Failed GetHousehold: " + e.Message);
                code = -1;
            }

            try
            {
                SearchCatalog();
            }
            catch (KalturaAPIException e)
            {
                Console.WriteLine("Failed SearchCatalog: " + e.Message);
                code = -1;
            }

            try
            {
                GetHouseholdDevice();
            }
            catch (KalturaAPIException e)
            {
                Console.WriteLine("Failed GetHouseholdDevice: " + e.Message);
                code = -1;
            }

            try
            {
                AddHouseholdDevice();
            }
            catch (KalturaAPIException e)
            {
                Console.WriteLine("Failed AddHouseholdDevice: " + e.Message);
                code = -1;
            }

            try
            {
                AdvancedMultiRequestExample();
            }
            catch (KalturaAPIException e)
            {
                Console.WriteLine("Failed AdvancedMultiRequestExample: " + e.Message);
                code = -1;
            }

            if (code == 0)
            {
                Console.WriteLine("Finished running client library tests");
            }

            Environment.Exit(code);
        }