/// <summary> /// Retrieve a list of all Factors for an Entity. /// </summary> /// <param name="options"> Read Factor parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Factor </returns> public static ResourceSet <FactorResource> Read(ReadFactorOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <FactorResource> .FromJson("factors", response.Content); return(new ResourceSet <FactorResource>(page, options, client)); }
private static Request BuildReadRequest(ReadFactorOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Verify, "/v2/Services/" + options.PathServiceSid + "/Entities/" + options.PathIdentity + "/Factors", queryParams: options.GetParams() )); }
/// <summary> /// Retrieve a list of all Factors for an Entity. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathIdentity"> Unique external identifier of the Entity </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 Factor </returns> public static async System.Threading.Tasks.Task <ResourceSet <FactorResource> > ReadAsync(string pathServiceSid, string pathIdentity, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadFactorOptions(pathServiceSid, pathIdentity) { PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// Retrieve a list of all Factors for an Entity. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathIdentity"> Unique external identifier of the Entity </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 Factor </returns> public static ResourceSet <FactorResource> Read(string pathServiceSid, string pathIdentity, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadFactorOptions(pathServiceSid, pathIdentity) { PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
/// <summary> /// Retrieve a list of all Factors for an Entity. /// </summary> /// <param name="options"> Read 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 <ResourceSet <FactorResource> > ReadAsync(ReadFactorOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <FactorResource> .FromJson("factors", response.Content); return(new ResourceSet <FactorResource>(page, options, client)); }