/// <summary> /// read /// </summary> /// /// <param name="actorSid"> The actor_sid </param> /// <param name="eventType"> The event_type </param> /// <param name="resourceSid"> The resource_sid </param> /// <param name="sourceIpAddress"> The source_ip_address </param> /// <param name="startDate"> The start_date </param> /// <param name="endDate"> The end_date </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 actorSid = null, string eventType = null, string resourceSid = null, string sourceIpAddress = null, DateTime?startDate = null, DateTime?endDate = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadEventOptions { ActorSid = actorSid, EventType = eventType, ResourceSid = resourceSid, SourceIpAddress = sourceIpAddress, StartDate = startDate, EndDate = endDate, PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <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.Monitor, "/v1/Events", queryParams: options.GetParams() )); }
/// <summary> /// read /// </summary> /// <param name="actorSid"> The actor_sid </param> /// <param name="eventType"> The event_type </param> /// <param name="resourceSid"> The resource_sid </param> /// <param name="sourceIpAddress"> The source_ip_address </param> /// <param name="startDate"> The start_date </param> /// <param name="endDate"> The end_date </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 actorSid = null, string eventType = null, string resourceSid = null, string sourceIpAddress = null, DateTime?startDate = null, DateTime?endDate = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadEventOptions() { ActorSid = actorSid, EventType = eventType, ResourceSid = resourceSid, SourceIpAddress = sourceIpAddress, StartDate = startDate, EndDate = endDate, 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)); }