Exemplo 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(string 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));
        }
Exemplo n.º 2
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> A single instance of Sim </returns>
        public static ResourceSet <SimResource> Read(string 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));
        }
Exemplo n.º 3
0
        /// <summary>
        /// read
        /// </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));
        }
Exemplo n.º 4
0
 private static Request BuildReadRequest(ReadSimOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/wireless/Sims",
                queryParams: options.GetParams()
                ));
 }
Exemplo n.º 5
0
        /// <summary>
        /// read
        /// </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));
        }