Esempio n. 1
0
        /// <summary>
        /// Retrieve a list of Super 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));
        }
Esempio n. 2
0
 private static Request BuildReadRequest(ReadSimOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Supersim,
                "/v1/Sims",
                queryParams: options.GetParams()
                ));
 }
Esempio n. 3
0
        /// <summary>
        /// Retrieve a list of Super SIMs from your account.
        /// </summary>
        /// <param name="status"> The status of the Sim resources to read </param>
        /// <param name="fleet"> The SID or unique name of the Fleet to which a list of Sims are assigned </param>
        /// <param name="iccid"> The ICCID associated with a Super SIM to filter the list by </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 fleet             = null,
                                                                                               string iccid             = null,
                                                                                               int?pageSize             = null,
                                                                                               long?limit               = null,
                                                                                               ITwilioRestClient client = null)
        {
            var options = new ReadSimOptions()
            {
                Status = status, Fleet = fleet, Iccid = iccid, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Esempio n. 4
0
        /// <summary>
        /// Retrieve a list of Super SIMs from your account.
        /// </summary>
        /// <param name="status"> The status of the Sim resources to read </param>
        /// <param name="fleet"> The SID or unique name of the Fleet to which a list of Sims are assigned </param>
        /// <param name="iccid"> The ICCID associated with a Super SIM to filter the list by </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 fleet             = null,
                                                     string iccid             = null,
                                                     int?pageSize             = null,
                                                     long?limit               = null,
                                                     ITwilioRestClient client = null)
        {
            var options = new ReadSimOptions()
            {
                Status = status, Fleet = fleet, Iccid = iccid, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Esempio n. 5
0
        /// <summary>
        /// Retrieve a list of Super 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));
        }