/// <summary> /// Create a new Signing Key for the account making the request. /// </summary> /// <param name="options"> Create NewSigningKey parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of NewSigningKey </returns> public static NewSigningKeyResource Create(CreateNewSigningKeyOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// create /// </summary> /// /// <param name="pathAccountSid"> The account_sid </param> /// <param name="friendlyName"> The friendly_name </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of NewSigningKey </returns> public static NewSigningKeyResource Create(string pathAccountSid = null, string friendlyName = null, ITwilioRestClient client = null) { var options = new CreateNewSigningKeyOptions { PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; return(Create(options, client)); }
/// <summary> /// create /// </summary> /// /// <param name="pathAccountSid"> The account_sid </param> /// <param name="friendlyName"> The friendly_name </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of NewSigningKey </returns> public static async System.Threading.Tasks.Task <NewSigningKeyResource> CreateAsync(string pathAccountSid = null, string friendlyName = null, ITwilioRestClient client = null) { var options = new CreateNewSigningKeyOptions { PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; return(await CreateAsync(options, client)); }
private static Request BuildCreateRequest(CreateNewSigningKeyOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/SigningKeys.json", postParams: options.GetParams() )); }
/// <summary> /// Create a new Signing Key for the account making the request. /// </summary> /// <param name="options"> Create NewSigningKey parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of NewSigningKey </returns> public static async System.Threading.Tasks.Task <NewSigningKeyResource> CreateAsync(CreateNewSigningKeyOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }