/// <summary> /// Fetch the Call specified by the provided Call Sid /// </summary> /// <param name="options"> Fetch Call parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Call </returns> public static CallResource Fetch(FetchCallOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Fetch the Call specified by the provided Call Sid /// </summary> /// /// <param name="options"> Fetch Call parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Call </returns> public static async System.Threading.Tasks.Task <CallResource> FetchAsync(FetchCallOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Fetch the Call specified by the provided Call Sid /// </summary> /// <param name="pathSid"> Call Sid that uniquely identifies the Call to fetch </param> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Call </returns> public static CallResource Fetch(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchCallOptions(pathSid) { PathAccountSid = pathAccountSid }; return(Fetch(options, client)); }
/// <summary> /// Fetch the Call specified by the provided Call Sid /// </summary> /// /// <param name="pathSid"> Call Sid that uniquely identifies the Call to fetch </param> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Call </returns> public static async System.Threading.Tasks.Task <CallResource> FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchCallOptions(pathSid) { PathAccountSid = pathAccountSid }; return(await FetchAsync(options, client)); }
private static Request BuildFetchRequest(FetchCallOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Calls/" + options.PathSid + ".json", client.Region, queryParams: options.GetParams() )); }