/// <summary> /// Fetch a Network resource. /// </summary> /// <param name="pathSid"> The SID of the Network resource to fetch </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Network </returns> public static async System.Threading.Tasks.Task <NetworkResource> FetchAsync(string pathSid, ITwilioRestClient client = null) { var options = new FetchNetworkOptions(pathSid); return(await FetchAsync(options, client)); }
/// <summary> /// Fetch a Network resource. /// </summary> /// <param name="options"> Fetch Network parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Network </returns> public static NetworkResource Fetch(FetchNetworkOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Fetch a Network resource. /// </summary> /// <param name="options"> Fetch Network parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Network </returns> public static async System.Threading.Tasks.Task <NetworkResource> FetchAsync(FetchNetworkOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildFetchRequest(FetchNetworkOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Supersim, "/v1/Networks/" + options.PathSid + "", queryParams: options.GetParams() )); }
/// <summary> /// Fetch a Network resource. /// </summary> /// <param name="pathSid"> The SID of the Network resource to fetch </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Network </returns> public static NetworkResource Fetch(string pathSid, ITwilioRestClient client = null) { var options = new FetchNetworkOptions(pathSid); return(Fetch(options, client)); }