/// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create TaskChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TaskChannel </returns>
        public static TaskChannelResource Create(CreateTaskChannelOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="friendlyName"> String representing user-friendly name for the TaskChannel </param>
        /// <param name="uniqueName"> String representing unique name for the TaskChannel </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TaskChannel </returns>
        public static async System.Threading.Tasks.Task <TaskChannelResource> CreateAsync(string pathWorkspaceSid,
                                                                                          string friendlyName,
                                                                                          string uniqueName,
                                                                                          ITwilioRestClient client = null)
        {
            var options = new CreateTaskChannelOptions(pathWorkspaceSid, friendlyName, uniqueName);

            return(await CreateAsync(options, client));
        }
Exemplo n.º 3
0
 private static Request BuildCreateRequest(CreateTaskChannelOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/TaskChannels",
                postParams: options.GetParams()
                ));
 }
Exemplo n.º 4
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="friendlyName"> String representing user-friendly name for the TaskChannel </param>
        /// <param name="uniqueName"> String representing unique name for the TaskChannel </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TaskChannel </returns>
        public static TaskChannelResource Create(string pathWorkspaceSid,
                                                 string friendlyName,
                                                 string uniqueName,
                                                 ITwilioRestClient client = null)
        {
            var options = new CreateTaskChannelOptions(pathWorkspaceSid, friendlyName, uniqueName);

            return(Create(options, client));
        }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create TaskChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TaskChannel </returns>
        public static async System.Threading.Tasks.Task <TaskChannelResource> CreateAsync(CreateTaskChannelOptions options,
                                                                                          ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }