Exemple #1
0
        /// <summary>
        /// Fetch a Super SIM instance from your account.
        /// </summary>
        /// <param name="options"> Fetch Sim parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sim </returns>
        public static SimResource Fetch(FetchSimOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Exemple #2
0
        /// <summary>
        /// Fetch a Super SIM instance from your account.
        /// </summary>
        /// <param name="pathSid"> The SID that identifies the resource to fetch </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 <SimResource> FetchAsync(string pathSid,
                                                                                 ITwilioRestClient client = null)
        {
            var options = new FetchSimOptions(pathSid);

            return(await FetchAsync(options, client));
        }
Exemple #3
0
        /// <summary>
        /// Fetch a Super SIM instance from your account.
        /// </summary>
        /// <param name="options"> Fetch 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 <SimResource> FetchAsync(FetchSimOptions options,
                                                                                 ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Exemple #4
0
 private static Request BuildFetchRequest(FetchSimOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Supersim,
                "/v1/Sims/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Exemple #5
0
        /// <summary>
        /// Fetch a Super SIM instance from your account.
        /// </summary>
        /// <param name="pathSid"> The SID that identifies the resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sim </returns>
        public static SimResource Fetch(string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchSimOptions(pathSid);

            return(Fetch(options, client));
        }