Ejemplo n.º 1
0
        /// <summary>
        /// Fetch a specific Factor.
        /// </summary>
        /// <param name="options"> Fetch Factor parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Factor </returns>
        public static FactorResource Fetch(FetchFactorOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Fetch a specific Factor.
        /// </summary>
        /// <param name="options"> Fetch Factor parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Factor </returns>
        public static async System.Threading.Tasks.Task <FactorResource> FetchAsync(FetchFactorOptions options,
                                                                                    ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Fetch a specific Factor.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique identity of the Entity </param>
        /// <param name="pathSid"> A string that uniquely identifies this Factor. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Factor </returns>
        public static async System.Threading.Tasks.Task <FactorResource> FetchAsync(string pathServiceSid,
                                                                                    string pathIdentity,
                                                                                    string pathSid,
                                                                                    ITwilioRestClient client = null)
        {
            var options = new FetchFactorOptions(pathServiceSid, pathIdentity, pathSid);

            return(await FetchAsync(options, client));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Fetch a specific Factor.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique identity of the Entity </param>
        /// <param name="pathSid"> A string that uniquely identifies this Factor. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Factor </returns>
        public static FactorResource Fetch(string pathServiceSid,
                                           string pathIdentity,
                                           string pathSid,
                                           ITwilioRestClient client = null)
        {
            var options = new FetchFactorOptions(pathServiceSid, pathIdentity, pathSid);

            return(Fetch(options, client));
        }
 private static Request BuildFetchRequest(FetchFactorOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Authy,
                "/v1/Services/" + options.PathServiceSid + "/Entities/" + options.PathIdentity + "/Factors/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }