예제 #1
0
        /// <summary>
        /// Retrieve a specific Log.
        /// </summary>
        /// <param name="options"> Fetch Log parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Log </returns>
        public static LogResource Fetch(FetchLogOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
예제 #2
0
        /// <summary>
        /// Retrieve a specific Log.
        /// </summary>
        /// <param name="options"> Fetch 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 <LogResource> FetchAsync(FetchLogOptions options,
                                                                                 ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
예제 #3
0
        /// <summary>
        /// Retrieve a specific Log.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathEnvironmentSid"> Environment Sid. </param>
        /// <param name="pathSid"> Log Sid. </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 <LogResource> FetchAsync(string pathServiceSid,
                                                                                 string pathEnvironmentSid,
                                                                                 string pathSid,
                                                                                 ITwilioRestClient client = null)
        {
            var options = new FetchLogOptions(pathServiceSid, pathEnvironmentSid, pathSid);

            return(await FetchAsync(options, client));
        }
예제 #4
0
        /// <summary>
        /// Retrieve a specific Log.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathEnvironmentSid"> Environment Sid. </param>
        /// <param name="pathSid"> Log Sid. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Log </returns>
        public static LogResource Fetch(string pathServiceSid,
                                        string pathEnvironmentSid,
                                        string pathSid,
                                        ITwilioRestClient client = null)
        {
            var options = new FetchLogOptions(pathServiceSid, pathEnvironmentSid, pathSid);

            return(Fetch(options, client));
        }
예제 #5
0
 private static Request BuildFetchRequest(FetchLogOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Serverless,
                "/v1/Services/" + options.PathServiceSid + "/Environments/" + options.PathEnvironmentSid + "/Logs/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }