/// <summary> /// read /// </summary> /// <param name="options"> Read UseCase parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of UseCase </returns> public static ResourceSet <UseCaseResource> Read(ReadUseCaseOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <UseCaseResource> .FromJson("data", response.Content); return(new ResourceSet <UseCaseResource>(page, options, client)); }
private static Request BuildReadRequest(ReadUseCaseOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Messaging, "/v1/a2p/UseCases", queryParams: options.GetParams(), headerParams: null )); }
/// <summary> /// read /// </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 UseCase </returns> public static async System.Threading.Tasks.Task <ResourceSet <UseCaseResource> > ReadAsync(int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadUseCaseOptions() { PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// read /// </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 UseCase </returns> public static ResourceSet <UseCaseResource> Read(int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadUseCaseOptions() { PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read UseCase parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of UseCase </returns> public static async System.Threading.Tasks.Task <ResourceSet <UseCaseResource> > ReadAsync(ReadUseCaseOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <UseCaseResource> .FromJson("data", response.Content); return(new ResourceSet <UseCaseResource>(page, options, client)); }