/// <summary> /// Retrieve a list of all Logs. /// </summary> /// <param name="options"> Read Log parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Log </returns> public static ResourceSet <LogResource> Read(ReadLogOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <LogResource> .FromJson("logs", response.Content); return(new ResourceSet <LogResource>(page, options, client)); }
private static Request BuildReadRequest(ReadLogOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Serverless, "/v1/Services/" + options.PathServiceSid + "/Environments/" + options.PathEnvironmentSid + "/Logs", queryParams: options.GetParams() )); }
/// <summary> /// Retrieve a list of all Logs. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathEnvironmentSid"> Environment Sid. </param> /// <param name="functionSid"> Function 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 Log </returns> public static async System.Threading.Tasks.Task <ResourceSet <LogResource> > ReadAsync(string pathServiceSid, string pathEnvironmentSid, string functionSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadLogOptions(pathServiceSid, pathEnvironmentSid) { FunctionSid = functionSid, PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// Retrieve a list of all Logs. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathEnvironmentSid"> Environment Sid. </param> /// <param name="functionSid"> Function 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 Log </returns> public static ResourceSet <LogResource> Read(string pathServiceSid, string pathEnvironmentSid, string functionSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadLogOptions(pathServiceSid, pathEnvironmentSid) { FunctionSid = functionSid, PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
/// <summary> /// Retrieve a list of all Logs. /// </summary> /// <param name="options"> Read Log parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Log </returns> public static async System.Threading.Tasks.Task <ResourceSet <LogResource> > ReadAsync(ReadLogOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <LogResource> .FromJson("logs", response.Content); return(new ResourceSet <LogResource>(page, options, client)); }