/// <summary> /// Retrieve a paginated list of all the available Event Types. /// </summary> /// <param name="options"> Read EventType parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of EventType </returns> public static ResourceSet <EventTypeResource> Read(ReadEventTypeOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <EventTypeResource> .FromJson("types", response.Content); return(new ResourceSet <EventTypeResource>(page, options, client)); }
private static Request BuildReadRequest(ReadEventTypeOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Events, "/v1/Types", queryParams: options.GetParams(), headerParams: null )); }
/// <summary> /// Retrieve a paginated list of all the available Event Types. /// </summary> /// <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 EventType </returns> public static async System.Threading.Tasks.Task <ResourceSet <EventTypeResource> > ReadAsync(int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadEventTypeOptions() { PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// Retrieve a paginated list of all the available Event Types. /// </summary> /// <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 EventType </returns> public static ResourceSet <EventTypeResource> Read(int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadEventTypeOptions() { PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
/// <summary> /// Retrieve a paginated list of all the available Event Types. /// </summary> /// <param name="options"> Read EventType parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of EventType </returns> public static async System.Threading.Tasks.Task <ResourceSet <EventTypeResource> > ReadAsync(ReadEventTypeOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <EventTypeResource> .FromJson("types", response.Content); return(new ResourceSet <EventTypeResource>(page, options, client)); }