示例#1
0
        /// <summary>
        /// Fetch a specific Stream.
        /// </summary>
        /// <param name="options"> Fetch SyncStream parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncStream </returns>
        public static SyncStreamResource Fetch(FetchSyncStreamOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
示例#2
0
        /// <summary>
        /// Fetch a specific Stream.
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathSid"> Stream SID or unique name. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SyncStream </returns>
        public static async System.Threading.Tasks.Task <SyncStreamResource> FetchAsync(string pathServiceSid,
                                                                                        string pathSid,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new FetchSyncStreamOptions(pathServiceSid, pathSid);

            return(await FetchAsync(options, client));
        }
 private static Request BuildFetchRequest(FetchSyncStreamOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Sync,
                "/v1/Services/" + options.PathServiceSid + "/Streams/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
示例#4
0
        /// <summary>
        /// Fetch a specific Stream.
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathSid"> Stream SID or unique name. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncStream </returns>
        public static SyncStreamResource Fetch(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchSyncStreamOptions(pathServiceSid, pathSid);

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

            return(FromJson(response.Content));
        }