/// <summary> /// read /// </summary> /// <param name="options"> Read Event parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Event </returns> public static ResourceSet <EventResource> Read(ReadEventOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <EventResource> .FromJson("events", response.Content); return(new ResourceSet <EventResource>(page, options, client)); }
private static Request BuildReadRequest(ReadEventOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Insights, "/v1/Voice/" + options.PathCallSid + "/Events", queryParams: options.GetParams() )); }
/// <summary> /// read /// </summary> /// <param name="pathCallSid"> The call_sid </param> /// <param name="edge"> The edge </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 Event </returns> public static async System.Threading.Tasks.Task <ResourceSet <EventResource> > ReadAsync(string pathCallSid, EventResource.TwilioEdgeEnum edge = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadEventOptions(pathCallSid) { Edge = edge, PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// read /// </summary> /// <param name="pathCallSid"> The call_sid </param> /// <param name="edge"> The edge </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 Event </returns> public static ResourceSet <EventResource> Read(string pathCallSid, EventResource.TwilioEdgeEnum edge = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadEventOptions(pathCallSid) { Edge = edge, PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read Event parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Event </returns> public static async System.Threading.Tasks.Task <ResourceSet <EventResource> > ReadAsync(ReadEventOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <EventResource> .FromJson("events", response.Content); return(new ResourceSet <EventResource>(page, options, client)); }