/// <summary> /// Fetch the public key specified by the provided Credential Sid /// </summary> /// <param name="pathSid"> The unique string that identifies the resource </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of PublicKey </returns> public static async System.Threading.Tasks.Task <PublicKeyResource> FetchAsync(string pathSid, ITwilioRestClient client = null) { var options = new FetchPublicKeyOptions(pathSid); return(await FetchAsync(options, client)); }
/// <summary> /// Fetch the public key specified by the provided Credential Sid /// </summary> /// /// <param name="options"> Fetch PublicKey parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of PublicKey </returns> public static PublicKeyResource Fetch(FetchPublicKeyOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildFetchRequest(FetchPublicKeyOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Accounts, "/v1/Credentials/PublicKeys/" + options.PathSid + "", queryParams: options.GetParams() )); }
/// <summary> /// Fetch the public key specified by the provided Credential Sid /// </summary> /// /// <param name="pathSid"> Fetch by unique Credential Sid </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of PublicKey </returns> public static PublicKeyResource Fetch(string pathSid, ITwilioRestClient client = null) { var options = new FetchPublicKeyOptions(pathSid); return(Fetch(options, client)); }
/// <summary> /// Fetch the public key specified by the provided Credential Sid /// </summary> /// /// <param name="options"> Fetch PublicKey parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of PublicKey </returns> public static async System.Threading.Tasks.Task <PublicKeyResource> FetchAsync(FetchPublicKeyOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }