/// <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)); }
/// <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)); }
/// <summary> /// Fetch a specific Factor. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathIdentity"> Unique external identifier 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)); }
/// <summary> /// Fetch a specific Factor. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathIdentity"> Unique external identifier 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.Verify, "/v2/Services/" + options.PathServiceSid + "/Entities/" + options.PathIdentity + "/Factors/" + options.PathSid + "", queryParams: options.GetParams() )); }