/// <summary> /// Create a new Sink Test Event for the given Sink. /// </summary> /// <param name="pathSid"> A string that uniquely identifies the Sink to be Tested. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of SinkTest </returns> public static async System.Threading.Tasks.Task <SinkTestResource> CreateAsync(string pathSid, ITwilioRestClient client = null) { var options = new CreateSinkTestOptions(pathSid); return(await CreateAsync(options, client)); }
/// <summary> /// Create a new Sink Test Event for the given Sink. /// </summary> /// <param name="options"> Create SinkTest parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of SinkTest </returns> public static SinkTestResource Create(CreateSinkTestOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateSinkTestOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Events, "/v1/Sinks/" + options.PathSid + "/Test", postParams: options.GetParams() )); }
/// <summary> /// Create a new Sink Test Event for the given Sink. /// </summary> /// <param name="pathSid"> A string that uniquely identifies the Sink to be Tested. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of SinkTest </returns> public static SinkTestResource Create(string pathSid, ITwilioRestClient client = null) { var options = new CreateSinkTestOptions(pathSid); return(Create(options, client)); }
/// <summary> /// Create a new Sink Test Event for the given Sink. /// </summary> /// <param name="options"> Create SinkTest parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of SinkTest </returns> public static async System.Threading.Tasks.Task <SinkTestResource> CreateAsync(CreateSinkTestOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }