/// <summary> /// Retrieve a list of all events for a call. /// </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.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Calls/" + options.PathCallSid + "/Events.json", queryParams: options.GetParams(), headerParams: null )); }
/// <summary> /// Retrieve a list of all events for a call. /// </summary> /// <param name="pathCallSid"> Call Sid. </param> /// <param name="pathAccountSid"> Account Sid. </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, string pathAccountSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadEventOptions(pathCallSid) { PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
/// <summary> /// Retrieve a list of all events for a call. /// </summary> /// <param name="pathCallSid"> Call Sid. </param> /// <param name="pathAccountSid"> Account Sid. </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, string pathAccountSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadEventOptions(pathCallSid) { PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// Retrieve a list of all events for a call. /// </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)); }