Ejemplo n.º 1
0
        public async Task <TelnyxCollection <MobileOperatorNetworksPreferencesRecord> > BulkUpdateNetworkPreferenceAsync()
        {
            TelnyxCollection <MobileOperatorNetworksPreferencesRecord> result = new TelnyxCollection <MobileOperatorNetworksPreferencesRecord>();
            SimCardBulkNetworkPreferenceUpdateOptions baseOptions             = new SimCardBulkNetworkPreferenceUpdateOptions
            {
                SimCardIds = new string[]
                {
                    "6b14e151-8493-4fa1-8664-1cc4e6d14158",
                    "6b14e151-8493-4fa1-8664-1cc4e6d14158",
                },
                MobileOperatorNetworksPreferences = new List <MobileOperatorNetworksPreferences>()
                {
                    new MobileOperatorNetworksPreferences()
                    {
                        MobileOperatorNetworkId = new Guid("6a09cdc3-8948-47f0-aa62-74ac943d6c58"),
                        Priority = 0,
                    },
                },
            };

            try
            {
                result = await service.BulkUpdateNetworkPreferenceAsync(baseOptions);

                Console.WriteLine(JsonConvert.SerializeObject(result));
            }
            catch (TelnyxException ex)
            {
                Console.WriteLine("exception");
                Console.WriteLine(JsonConvert.SerializeObject(ex));
            }
            return(result);
        }
Ejemplo n.º 2
0
        public async Task <TelnyxCollection <SimCardRecord> > RegisterAsync()
        {
            TelnyxCollection <SimCardRecord> result      = new TelnyxCollection <SimCardRecord>();
            SimCardRegisterOptions           baseOptions = new SimCardRegisterOptions
            {
                RegistrationCodes = new string[]
                {
                    "0000000001",
                    "0000000002",
                    "0000000003",
                },
                SimCardGroupId = "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
                Tags           = new string[]
                {
                    "personal",
                    "customers",
                    "active-customers",
                },
            };

            try
            {
                result = await service.RegisterAsync(baseOptions);

                Console.WriteLine(JsonConvert.SerializeObject(result));
            }
            catch (TelnyxException ex)
            {
                Console.WriteLine("exception");
                Console.WriteLine(JsonConvert.SerializeObject(ex));
            }
            return(result);
        }