예제 #1
0
        /// <summary>
        /// Create a new Stream.
        /// </summary>
        /// <param name="options"> Create SyncStream parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncStream </returns>
        public static SyncStreamResource Create(CreateSyncStreamOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
예제 #2
0
        /// <summary>
        /// Create a new Stream.
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="uniqueName"> Stream unique name. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncStream </returns>
        public static SyncStreamResource Create(string pathServiceSid, string uniqueName = null, ITwilioRestClient client = null)
        {
            var options = new CreateSyncStreamOptions(pathServiceSid)
            {
                UniqueName = uniqueName
            };

            return(Create(options, client));
        }
예제 #3
0
        /// <summary>
        /// Create a new Stream.
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="uniqueName"> Stream 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> CreateAsync(string pathServiceSid, string uniqueName = null, ITwilioRestClient client = null)
        {
            var options = new CreateSyncStreamOptions(pathServiceSid)
            {
                UniqueName = uniqueName
            };

            return(await CreateAsync(options, client));
        }
 private static Request BuildCreateRequest(CreateSyncStreamOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Sync,
                "/v1/Services/" + options.PathServiceSid + "/Streams",
                postParams: options.GetParams()
                ));
 }
예제 #5
0
        /// <summary>
        /// Create a new Stream.
        /// </summary>
        /// <param name="options"> Create 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> CreateAsync(CreateSyncStreamOptions options,
                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }