/// <summary>
        /// Fetch a specific Sink.
        /// </summary>
        /// <param name="options"> Fetch Sink parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sink </returns>
        public static SinkResource Fetch(FetchSinkOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// Fetch a specific Sink.
        /// </summary>
        /// <param name="pathSid"> A string that uniquely identifies this Sink. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sink </returns>
        public static async System.Threading.Tasks.Task <SinkResource> FetchAsync(string pathSid,
                                                                                  ITwilioRestClient client = null)
        {
            var options = new FetchSinkOptions(pathSid);

            return(await FetchAsync(options, client));
        }
        /// <summary>
        /// Fetch a specific Sink.
        /// </summary>
        /// <param name="options"> Fetch Sink parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sink </returns>
        public static async System.Threading.Tasks.Task <SinkResource> FetchAsync(FetchSinkOptions options,
                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Exemple #4
0
 private static Request BuildFetchRequest(FetchSinkOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Events,
                "/v1/Sinks/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Fetch a specific Sink.
        /// </summary>
        /// <param name="pathSid"> A string that uniquely identifies this Sink. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sink </returns>
        public static SinkResource Fetch(string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchSinkOptions(pathSid);

            return(Fetch(options, client));
        }