Ejemplo n.º 1
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="status"> The status </param>
        /// <param name="iccid"> The iccid </param>
        /// <param name="ratePlan"> The rate_plan </param>
        /// <param name="eId"> The e_id </param>
        /// <param name="simRegistrationCode"> The sim_registration_code </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sim </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <SimResource> > ReadAsync(SimResource.StatusEnum status = null, string iccid = null, string ratePlan = null, string eId = null, string simRegistrationCode = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadSimOptions {
                Status = status, Iccid = iccid, RatePlan = ratePlan, EId = eId, SimRegistrationCode = simRegistrationCode, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Retrieve a list of Sims from your account.
        /// </summary>
        /// <param name="options"> Read Sim parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sim </returns>
        public static ResourceSet <SimResource> Read(ReadSimOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <SimResource> .FromJson("sims", response.Content);

            return(new ResourceSet <SimResource>(page, options, client));
        }
Ejemplo n.º 3
0
 private static Request BuildReadRequest(ReadSimOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Wireless,
                "/v1/Sims",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Retrieve a list of Sims from your account.
        /// </summary>
        /// <param name="status"> Only return Sims with this status. </param>
        /// <param name="iccid"> Return Sims with this Iccid. </param>
        /// <param name="ratePlan"> Only return Sims with this Rate Plan. </param>
        /// <param name="eId"> Only return Sims with this EID. </param>
        /// <param name="simRegistrationCode"> Only return Sims with this registration code. </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sim </returns>
        public static ResourceSet <SimResource> Read(SimResource.StatusEnum status = null,
                                                     string iccid               = null,
                                                     string ratePlan            = null,
                                                     string eId                 = null,
                                                     string simRegistrationCode = null,
                                                     int?pageSize               = null,
                                                     long?limit                 = null,
                                                     ITwilioRestClient client   = null)
        {
            var options = new ReadSimOptions()
            {
                Status = status, Iccid = iccid, RatePlan = ratePlan, EId = eId, SimRegistrationCode = simRegistrationCode, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Retrieve a list of Sims from your account.
        /// </summary>
        /// <param name="options"> Read Sim parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sim </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <SimResource> > ReadAsync(ReadSimOptions options,
                                                                                               ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <SimResource> .FromJson("sims", response.Content);

            return(new ResourceSet <SimResource>(page, options, client));
        }